Settings

Blockchain
Network
Unit
Language
Theme
Sound New Block

Transaction

2e46d6db5b1f2db497f49616cf14e65654d8a64566d97169bac337b07100cb24
Timestamp (utc)
2021-02-20 00:37:42
Fee Paid
0.00006964 BSV
(
0.00940278 BSV
-
0.00933314 BSV
)
Fee Rate
985.7 sat/KB
Version
1
Confirmations
320,146
Size Stats
7,065 B

3 Outputs

Total Output:
0.00933314 BSV
  • jrun cryptofightsM•{"in":0,"ref":["601edbeb03cc17a04d7ef75d78deddf3c51cd45c84d0850effc475cc2f6ca0b5_o1","286c9cbdc5eb21933e3908d09c7fab1059fcfb6c854fdd1ced04fbc8699c3e97_o1","6ea67a1792e7267be5afe13a1222ca94d5933ddd762b4f2ea174d1fe8d3db21a_o1","7861a30e95ec59cae829d899b84b31da95708eb496c5d78c2b19c30840cc8e1d_o1","87c1cf10a0de5ff406b41b0e5f418e8af1c178703ff4543779c99501b356ec9a_o1","0566e75a4c2d6b002e5fea2a26cd2144a9006682571b796fcb6550874410b686_o1","a15d52597d1229672661f00eff21ab8054eb60e9dda1f7c54e8895d7a533f4a5_o1","68b0772a4f166e9e67e518ba6a53c03d7b66575d33ff132094856dbfbedf2d7f_o1","17b5f4f9ed698003089ddf5501fa7515530fb65d9e2ede9a875513b351e88adc_o1","1c1accbca985304f5b5d3f8058d640d6a2b47edb8c9119ec1adbcacd0defe53c_o1"],"out":["f488d355d6dcf63db3b7c17e0d9fe5ba51c681c7d7ceecfd543a98e5b4a70850"],"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":"40f1664a0d57f9175e3e16b732270d45931a72e245755fdc6057b0696accb5d6","sealed":false,"validators":{"0566e75a4c2d6b002e5fea2a26cd2144a9006682571b796fcb6550874410b686_o1":{"$dup":["1","deps","Bot5ValidatorAgent"]},"17b5f4f9ed698003089ddf5501fa7515530fb65d9e2ede9a875513b351e88adc_o1":{"$dup":["1","deps","Tier7ValidatorAgent"]},"286c9cbdc5eb21933e3908d09c7fab1059fcfb6c854fdd1ced04fbc8699c3e97_o1":{"$dup":["1","deps","Bot1ValidatorAgent"]},"6ea67a1792e7267be5afe13a1222ca94d5933ddd762b4f2ea174d1fe8d3db21a_o1":{"$dup":["1","deps","Bot2ValidatorAgent"]},"7861a30e95ec59cae829d899b84b31da95708eb496c5d78c2b19c30840cc8e1d_o1":{"$dup":["1","deps","Bot3ValidatorAgent"]},"87c1cf10a0de5ff406b41b0e5f418e8af1c178703ff4543779c99501b356ec9a_o1":{"$dup":["1","deps","Bot4ValidatorAgent"]},"a15d52597d1229672661f00eff21ab8054eb60e9dda1f7c54e8895d7a533f4a5_o1":{"$dup":["1","deps","Bot6ValidatorAgent"]}}}]}]}
    https://whatsonchain.com/tx/2e46d6db5b1f2db497f49616cf14e65654d8a64566d97169bac337b07100cb24