Settings

Blockchain
Network
Unit
Language
Theme
Sound New Block

Transaction

a0796e0bfc5c917a9387f103789bef9116d33353bc02256c68454d44c3ecf162
Timestamp (utc)
2021-02-10 06:20:27
Fee Paid
0.00003602 BSV
(
0.01000000 BSV
-
0.00996398 BSV
)
Fee Rate
509.7 sat/KB
Version
1
Confirmations
323,686
Size Stats
7,066 B

3 Outputs

Total Output:
0.00996398 BSV
  • jrun cryptofightsM•{"in":0,"ref":["4a4466c7a9318d0558bbcf5d6b6a23fad6df493a37375d12cc5a2d0f93ebfb10_o1","6866964e12d694dbbca57d72f702a4abe7d68934955930f98d2c721aa15d9b8c_o1","443a64b9222aa6f2fdac2e2c7bb108b56bc34c4b4531c37b11a47bfcbf4df58b_o1","032911debf210ef1d3c3e5c2689c4ef8f53ededde82ad0b7056ac5ce7139a461_o1","f922b38544f872c85341f0552a18e3e63991f2cd5f7d49397bd6ef6da60ff826_o1","c5b89badecdaa392c42c5f5e9930ebb17a8b6174680925d7c11d89d1dda5ce44_o1","37f95782462c7f1b9d55534debd0612548bcf24948119f6b2e1474d5fc53eba2_o1","91e2e3cb089c8342223d40abadab69c7fdc192e146a7a33c4638515159bc0b7d_o1","e895e8e8b56b0e2cb781c264ead095fae6c2abceeba64634e6475d8073ed5ce4_o1","f49c62c6608aa9689484b982ec570692e774c2ca92cef393b6008a3f5bdd7b19_o1"],"out":["b11043a9b9f8defd1445e34a4e3142d0858c1863a251eedb811323a72c1ce956"],"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":"e4d532c0e76e37473a180596a15798d86c79429ed7c2f497af9f7d7998e95a0c","sealed":false,"validators":{"032911debf210ef1d3c3e5c2689c4ef8f53ededde82ad0b7056ac5ce7139a461_o1":{"$dup":["1","deps","Bot3ValidatorAgent"]},"37f95782462c7f1b9d55534debd0612548bcf24948119f6b2e1474d5fc53eba2_o1":{"$dup":["1","deps","Bot6ValidatorAgent"]},"443a64b9222aa6f2fdac2e2c7bb108b56bc34c4b4531c37b11a47bfcbf4df58b_o1":{"$dup":["1","deps","Bot2ValidatorAgent"]},"6866964e12d694dbbca57d72f702a4abe7d68934955930f98d2c721aa15d9b8c_o1":{"$dup":["1","deps","Bot1ValidatorAgent"]},"c5b89badecdaa392c42c5f5e9930ebb17a8b6174680925d7c11d89d1dda5ce44_o1":{"$dup":["1","deps","Bot5ValidatorAgent"]},"e895e8e8b56b0e2cb781c264ead095fae6c2abceeba64634e6475d8073ed5ce4_o1":{"$dup":["1","deps","Tier7ValidatorAgent"]},"f922b38544f872c85341f0552a18e3e63991f2cd5f7d49397bd6ef6da60ff826_o1":{"$dup":["1","deps","Bot4ValidatorAgent"]}}}]}]}
    https://whatsonchain.com/tx/a0796e0bfc5c917a9387f103789bef9116d33353bc02256c68454d44c3ecf162