Settings

Blockchain
Network
Unit
Language
Theme
Sound New Block

Transaction

6690329b8450691d7e51f65509b3c4be13e7f3bf885d12058c08452575c39c69
Timestamp (utc)
2021-02-17 21:25:10
Fee Paid
0.00003602 BSV
(
0.00412722 BSV
-
0.00409120 BSV
)
Fee Rate
509.6 sat/KB
Version
1
Confirmations
322,791
Size Stats
7,065 B

3 Outputs

Total Output:
0.00409120 BSV
  • jrun cryptofightsM•{"in":0,"ref":["4a4466c7a9318d0558bbcf5d6b6a23fad6df493a37375d12cc5a2d0f93ebfb10_o1","02fe9cef12f9d0c7cb373b45d3df70c6733b16b3db9c12f19f156246f66d3183_o1","45f729a90fec143a9d1ed6afec715df04241524af856ce122182deb614ac9019_o1","cae1256e5e9c6a7603cb3b12e5440274a1c0d4f01ce0f259996802e0e4cad3f9_o1","63c45ae941c9458d0b98d581c78152c6b6a9b6e8d41ca852192e78e7a2348775_o1","c94768023418325bdb7e8f5126e9a08e96160ba7555627188fe620457fa14cce_o1","3e5e3661f9ca5aacaeae49cd7e85421537c163d8d49d38451a8f451ae9951726_o1","91e2e3cb089c8342223d40abadab69c7fdc192e146a7a33c4638515159bc0b7d_o1","d1b20b4e254b2ba463518c80aaa7610e125d4dadb79162780ed2c5aee65ef24a_o1","4265da657b40362a30db8f71151d1502c97ccfcdb9876f13dcd935e122fa8dbd_o1"],"out":["e36d0c8f68c8f03dbdfa6eb8ef35c72e18e71659c644c4790ab824c7acd53825"],"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":"7c70c67a924a93bc6c556d6a1f627379e930d23954a247f65a480d3cd42c8465","sealed":false,"validators":{"02fe9cef12f9d0c7cb373b45d3df70c6733b16b3db9c12f19f156246f66d3183_o1":{"$dup":["1","deps","Bot1ValidatorAgent"]},"3e5e3661f9ca5aacaeae49cd7e85421537c163d8d49d38451a8f451ae9951726_o1":{"$dup":["1","deps","Bot6ValidatorAgent"]},"45f729a90fec143a9d1ed6afec715df04241524af856ce122182deb614ac9019_o1":{"$dup":["1","deps","Bot2ValidatorAgent"]},"63c45ae941c9458d0b98d581c78152c6b6a9b6e8d41ca852192e78e7a2348775_o1":{"$dup":["1","deps","Bot4ValidatorAgent"]},"c94768023418325bdb7e8f5126e9a08e96160ba7555627188fe620457fa14cce_o1":{"$dup":["1","deps","Bot5ValidatorAgent"]},"cae1256e5e9c6a7603cb3b12e5440274a1c0d4f01ce0f259996802e0e4cad3f9_o1":{"$dup":["1","deps","Bot3ValidatorAgent"]},"d1b20b4e254b2ba463518c80aaa7610e125d4dadb79162780ed2c5aee65ef24a_o1":{"$dup":["1","deps","Tier7ValidatorAgent"]}}}]}]}
    https://whatsonchain.com/tx/6690329b8450691d7e51f65509b3c4be13e7f3bf885d12058c08452575c39c69