Settings

Blockchain
Network
Unit
Language
Theme
Sound New Block

Transaction

34bd8570cdfae8a44c14d9ada0edfccf65ba0d87e82e228419a3d5f396c4e885
Timestamp (utc)
2021-02-19 23:02:03
Fee Paid
0.00006964 BSV
(
0.00968820 BSV
-
0.00961856 BSV
)
Fee Rate
985.5 sat/KB
Version
1
Confirmations
315,750
Size Stats
7,066 B

3 Outputs

Total Output:
0.00961856 BSV
  • jrun cryptofightsM•{"in":0,"ref":["601edbeb03cc17a04d7ef75d78deddf3c51cd45c84d0850effc475cc2f6ca0b5_o1","9722562cda13300dbb7a7e65c8c18b4c0398754cbb4e3bbb26dce8f52d46bd77_o1","90f743975e87c8f8110109d7ac456008ede6d1c4c0d697810cbca67b93555a95_o1","6090413011a0187a44d6031c494862971ddcf6741ed5130b1efe9d223f63d800_o1","c59c5c6a9c7f56707f58f307122af7fc2755ba1349e24d5a483173b6f706d915_o1","c131a205de1680453d32ac651b253d7b847f182f21423460997780bf3323cb62_o1","80ab4cc694497b49cc9b934d3d533f4c4e1ae006a09bc4915788eb01a2037287_o1","68b0772a4f166e9e67e518ba6a53c03d7b66575d33ff132094856dbfbedf2d7f_o1","7dbb54ae5635de93eb056a2d1f23f6e805a013d8570216f5d6aa23b1286c45b5_o1","1c1accbca985304f5b5d3f8058d640d6a2b47edb8c9119ec1adbcacd0defe53c_o1"],"out":["88c6bc2780d9179aa03ab6794984d63fe8718ff29ddadf3bdcb7f9f5b8b1e8c9"],"del":[],"cre":["n2Bd4cWhEQK1aVjb1R7EBGV9mrw3etvSdC"],"exec":[{"op":"DEPLOY","data":["class QueueAgent extends Agent {\n async init() {\n console.log('Initializing', this.constructor.name);\n\n Object.values(this.constructor.validators).forEach(v => this.messageHandlers.set(v.origin, this.onEnterQueue));\n this.messageHandlers.set('ExitQueue', this.onExitQueue);\n this.messageHandlers.set('RefreshQueue', this.onRefreshQueue);\n }\n\n onMessage(message) {\n if (!this.messageHandlers.has(message.subject)) {\n throw new KronoError(410, 'Invalid Lobby');\n }\n\n return super.onMessage(message);\n }\n\n async onExitQueue(message) {\n\n const pipeline = this.storage.pipeline();\n for (const rules of Object.values(QueueAgent.validators)) {\n pipeline.hdel(rules.origin, message.from);\n }\n await pipeline.exec();\n return;\n }\n\n async onEnterQueue(message) {\n console.log('Enter Queue:', message.subject);\n const rules = this.constructor.validators[message.subject];\n if (!rules) throw new Error('Unsupported Rules');\n\n console.log('RULES:', JSON.stringify({ ...rules }));\n\n // Remove user from Queue\n const pipeline = this.storage.pipeline();\n for (const rules of Object.values(QueueAgent.validators)) {\n pipeline.hdel(rules.origin, message.from);\n }\n await pipeline.exec();\n\n console.time('loadPlayer');\n const player = await rules.loadPlayer(message, this.wallet);\n console.timeEnd('loadPlayer');\n console.time('validatePlayer');\n rules.validatePlayer(player);\n console.timeEnd('validatePlayer');\n\n if (rules.playerCount === 1) {\n await this.createBattle(rules, [{ ...message }]);\n }\n else {\n let queue = await this.storage.hgetall(message.subject);\n console.log('Queue Loaded', JSON.stringify(queue));\n for (let [pubkey, msgId] of Object.entries(queue)) {\n console.log(`pubkey: ${pubkey} msgId: ${msgId}`);\n const opponentData = await this.storage.get(msgId);\n if(!opponentData) {\n await this.storage.hdel(message.subject, pubkey);\n continue;\n }\n const opponent = JSON.parse(opponentData);\n await this.storage.hdel(rules.origin, opponent.from);\n console.time('creatingBattle');\n await this.createBattle(rules, [message, opponent]);\n console.timeEnd('creatingBattle');\n return;\n }\n\n console.log('Adding to queue');\n await this.storage.pipeline()\n .set(message.id, JSON.stringify(message))\n .hset(message.subject, message.from, message.id)\n .expire(message.id, 60)\n .exec();\n await rules.sendEnterQueueStatus(message, this.wallet, this.blockchain);\n }\n }\n\n async onRefreshQueue(message) {\n const { queueId } = message.payloadObj;\n await this.storage.expire(queueId, 60);\n return await this.storage.exists(queueId);\n }\n\n async createBattle(rules, messages) {\n console.log('Sending to Validator');\n const message = this.wallet.buildMessage({\n to: [ValidatorConfig.pubkey],\n subject: 'LaunchAgent',\n payload: JSON.stringify({\n location: rules.origin,\n initParams: {\n messages,\n nonce: this.wallet.randomBytes(16)\n }\n })\n });\n await this.blockchain.sendMessage(message);\n\n // Remove from queue\n const pipeline = this.storage.pipeline();\n messages.forEach(m => {\n pipeline.hdel(m.subject, m.from);\n pipeline.del(m.id);\n });\n await pipeline.exec();\n }\n\n static async preDeploy() {\n const { Bot1ValidatorAgent, Bot2ValidatorAgent, Bot3ValidatorAgent, Bot4ValidatorAgent, Bot5ValidatorAgent, Bot6ValidatorAgent, Tier7ValidatorAgent } = this.deps;\n QueueAgent.validators = {\n [Bot1ValidatorAgent.origin]: Bot1ValidatorAgent,\n [Bot2ValidatorAgent.origin]: Bot2ValidatorAgent,\n [Bot3ValidatorAgent.origin]: Bot3ValidatorAgent,\n [Bot4ValidatorAgent.origin]: Bot4ValidatorAgent,\n [Bot5ValidatorAgent.origin]: Bot5ValidatorAgent,\n [Bot6ValidatorAgent.origin]: Bot6ValidatorAgent,\n [Tier7ValidatorAgent.origin]: Tier7ValidatorAgent\n };\n }\n}",{"agentId":"queue","deps":{"Agent":{"$jig":0},"Bot1ValidatorAgent":{"$jig":1},"Bot2ValidatorAgent":{"$jig":2},"Bot3ValidatorAgent":{"$jig":3},"Bot4ValidatorAgent":{"$jig":4},"Bot5ValidatorAgent":{"$jig":5},"Bot6ValidatorAgent":{"$jig":6},"KronoError":{"$jig":7},"Tier7ValidatorAgent":{"$jig":8},"ValidatorConfig":{"$jig":9}},"hash":"0fb0dfe119c61fde6ba5aa49d586f5a8c41f0426ab69a0c257053c26b4eabaa9","sealed":false,"validators":{"6090413011a0187a44d6031c494862971ddcf6741ed5130b1efe9d223f63d800_o1":{"$dup":["1","deps","Bot3ValidatorAgent"]},"7dbb54ae5635de93eb056a2d1f23f6e805a013d8570216f5d6aa23b1286c45b5_o1":{"$dup":["1","deps","Tier7ValidatorAgent"]},"80ab4cc694497b49cc9b934d3d533f4c4e1ae006a09bc4915788eb01a2037287_o1":{"$dup":["1","deps","Bot6ValidatorAgent"]},"90f743975e87c8f8110109d7ac456008ede6d1c4c0d697810cbca67b93555a95_o1":{"$dup":["1","deps","Bot2ValidatorAgent"]},"9722562cda13300dbb7a7e65c8c18b4c0398754cbb4e3bbb26dce8f52d46bd77_o1":{"$dup":["1","deps","Bot1ValidatorAgent"]},"c131a205de1680453d32ac651b253d7b847f182f21423460997780bf3323cb62_o1":{"$dup":["1","deps","Bot5ValidatorAgent"]},"c59c5c6a9c7f56707f58f307122af7fc2755ba1349e24d5a483173b6f706d915_o1":{"$dup":["1","deps","Bot4ValidatorAgent"]}}}]}]}
    https://whatsonchain.com/tx/34bd8570cdfae8a44c14d9ada0edfccf65ba0d87e82e228419a3d5f396c4e885