Unit ID
rvRKFGooUqamtqY6a/scF/dcsB87nntXZatglR4fgXo=
Received
25.09.2019 15:50:25
Confirmation delay (full node)
2 minutes 32 seconds
Confirmation delay (light node)
4 minutes 41 seconds
Messages
Definition
Definition: [ "autonomous agent", { "init": "{ $provider = "HFNBIQTUNVMRM7PDP6NT2QRKLR62FOGR" ; $processor = "HFNBIQTUNVMRM7PDP6NT2QRKLR62FOGR" ; $fee = var[ "fee" ] otherwise 21000 ; // Obot by [email protected] // Get paid for doing computation on your computer, think Lambda function for Obyte // The perfect function is one that takes little input data or a link to a big data set, then do complex or private computation // real world examples are science data analysis like SETI or WCG // usage: // 1) function caller calls this AA with { "args" : '<value or json>' } and pays processing fee to get { "job" : <job number> } // 2) processor computes and send back to this AA { "job" : <job number> , "result" : <value or json> } // 3) provider only gets the processing fee when the result is sent back to caller by this AA // 4) result verification is up to the function caller, perhaps using simple technique like compare results from multiple Obots // setup: // set $processor address and fee above // the provider runs a headless wallet processor which listens for jobs from this AA // example use: // caller sends { "args" : "[ 3 , 4 , 1 , 2 ]" } with 11000 bytes and gets response { "job" : 1 } // wait for result { "job" : 1 , "result" : "[ 1 , 2 , 3 , 4 ]" } $job = trigger.data.job ; $txfee = 1000 ; }", "messages": { "cases": [ { "if": "{ trigger.address == $processor AND $job }", "messages": [ { "app": "data", "payload": { "job": "{ $job }", "result": "{ trigger.data.result }" } }, { "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "{ $provider }", "amount": "{ var[ $job ] - ( 3 * $txfee ) }" }, { "address": "{ var[ "caller_" || $job ] }", "amount": "{ $txfee }" } ] } }, { "app": "state", "state": "{ if( trigger.data.result == false ) bounce( "must have result" ) ; if( var[ $job ] == false ) bounce( "there is no such job " || trigger.data.job ) ; var[ $job ] = false ; // clear job var[ "caller_" || $job ] = false ; }" } ] }, { "messages": [ { "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "{ $processor }", "amount": 10000 } ] } }, { "app": "state", "state": "{ if( trigger.output[[asset=base]] < $fee ) bounce( "function requires fee of " || $fee ) ; // START JOB var[ "job" ] += 1 ; var[ var[ "job" ] ] = $fee - 10000 ; // save current fee var[ "caller_" || var[ "job" ] ] = trigger.address ; // store caller to send result later // send job to listening Obot headless wallet response[ "job" ] = var[ "job" ] ; response[ "args" ] = trigger.data.args ; // possible to have no args }" } ] } ] } } ]
Technical information
Fees:
2,969 bytes
(353 headers, 2616 payload)
Level:1077609
Witnessed level:1077602
Main chain index:1076372
Latest included mc index:1076371
Status:stable/confirmed/final