Unit ID
P/eimO040v1aoNJLTeqkNn4l1YmYNi96sf2gLxvZTxQ=
Received
29.08.2019 04:13:24
Confirmation delay (full node)
2 minutes 44 seconds
Confirmation delay (light node)
4 minutes 40 seconds
Messages
Definition
Definition: [ "autonomous agent", { "messages": { "cases": [ { "if": "{ // select random registered address and send a message to it, by [email protected] // usage: // 1) interested parties sends 10000 to this AA to register address for future selection, they will be paid back when selected // 2) send 11000 and data.choose with a link or address to another AA which represent the job which the choosen address should do if( trigger.data.choose ){ if( !var[ "count" ] ) bounce( "There is currently no registered address to choose from"); if( trigger.output[ [ asset=base ]] < 11000 ) bounce( "need to send 11000 with data.choose"); if( var[ "count" ] == 1 ) $choose = 1; // special case, number from seed doesn't work with start = end else $choose = number_from_seed( trigger.address || "{timestamp}" , 1 , var[ "count" ] ); // SEMI RANDOM CHOOSE $choosen = var[ $choose || "" ]; } trigger.data.choose }", "messages": [ { "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "{ $choosen }", "amount": 10000 }, { "address": "{ trigger.address }" } ] } }, { "app": "data", "payload": { "job": "{trigger.data.choose}", "choosen": "{ $choosen }" } }, { "app": "state", "state": "{ // RESPONSE LISTENED BY NODES response[ "message" ] = "job sent to choosen"; response[ "job" ] = "{ trigger.data.choose }"; response[ "choosen" ] = $choosen; }" } ] }, { "messages": [ { "app": "state", "state": "{ if( var[ trigger.initial_address ] ) bounce( trigger.initial_address || " had registered with " || var [ trigger.initial_address ] || ", there are total of " || var[ "count" ] || " addresses to chose from "); // NEW REGISTRATION var[ "count" ] += 1; var[ var[ "count" ] || "" ] = trigger.initial_address; var[ trigger.initial_address ] = trigger.output[ [ asset = base ] ] ; response[ 'message' ] = trigger.initial_address || " registered, there are now " || var[ "count" ] || " addresses"; }" } ] } ] } } ]
Technical information
Fees:
2,402 bytes
(353 headers, 2049 payload)
Level:1031409
Witnessed level:1031402
Main chain index:1030222
Latest included mc index:1030221
Status:stable/confirmed/final