自从我最近看到一些与新的Obyte自治代理(AA)再次出现以来。 我认为最好回顾一下我在8月初的第一轮竞赛中首次提交OAAAAA概念并在8月中旬进行修订时所使用的思维过程。最新的完整版本位于底部。 为了提供AA,有些人开始考虑自动售货机。 但是我倾向于首先考虑人们可能需要或想要使用的东西以及使该想法发挥作用所需的功能是否可以去中心化。 我认为通过这种方式可以更轻松地提出一些实用的想法,并让我降低实现的困难,然后我可以为每一部分考虑如何在Oscript中实现这些功能,然后最终如何将它们连接起来以构成一个整体的工作。 AA的基本结构对我来说,Oscript是一个基于JSON的声明性结构,因此对我来说,分别开发和测试每个功能,然后将每个部分放入最终结构中对我很有帮助。 我认为这就是为什么我一直在使用流程图而不是立即开始编写代码来开发AA的原因之一。 而且,即使我有很多复杂的运动部件(如REDvsBLUE AA)在多个AA之间传递消息,它也有助于可视化整个事情的最终效果。 结论如果我从功能上考虑,很容易提出AA的想法,如果我们使用分而治之的方法,我们肯定可以使这些想法成为现实。 OAAAAA自治代理完整代码: { messages: // OAAAAA Obyte Autonomous Autonomous Agent Address Agent by [email protected] // an address registry and router that allows updates & transfer of address/properties, see below USAGE // please note : before registering an new AA or transfer ownership of an existing AA // ***MAKE SURE*** to add ```var[ 'authors' ] = <author submission address>;``` to the new AA app : `state` // as it will be the only address allowed to make future transfer { cases: [ { if: "{ $checkaddress = trigger.data.address; if ( !$checkaddress ) bounce( 'input: { address : address , [ data : passthur_data ] , [ newaddress : newaddress ] , [ checkonly : false ] }' ); // USAGE // doesn't matter if checkaddress is valid or not because it will bounce when routing to the invalid address $logicaladdress = var[ $checkaddress ]; if ( $logicaladdress ){ // FOUND LOGICAL ADDRESS $currentaddress = var[ $logicaladdress ]; // GET LATEST ADDRESS $newaddress = trigger.data.newaddress; if( $newaddress ){ // again doesn't matter if newaddress is valid or not , RECEIVED NEW ADDRESS if( var[ $currentaddress ][ 'authors' ] == trigger.address ){ // CHECK OWNERSHIP // transfer of arbitrary address types will be possible in the future when AA can explore DAG $route = $newaddress; // ROUTE TO NEW ADDRESS // actual ownership transfer done in app state } else { bounce( 'Trigger address does not match with var[ authors ] in ' || $currentaddress || ' which is require to make newaddress transfer' ); } } else { $route = $currentaddress; // ROUTE TO LATEST ADDRESS } }else{ $route = $checkaddress; // registration will be done at app state , ROUTE TO CHECK ADRESS FIRST TIME } if( trigger.data.checkonly ){ // CHECKONLY if( $checkaddress != $route ) bounce( 'Please use latest address at ' || $route ); else bounce( 'This address ' || $checkaddress || ' is the latest'); } // ROUTE with pass thur data $route }", messages: [ { app: 'payment', payload: { asset: 'base', outputs: [ { address: '{$route}' } ] } }, { app: 'data', payload: '{trigger.data}' }, { app: 'state', state: `{ if( !$logicaladdress ){ var[ 'L' || $checkaddress ] = $checkaddress; // create logical address var[ $checkaddress ] = 'L' || $checkaddress; // set checkaddress to logical address $msg = ' a new address registration'; } if( $newaddress AND $logicaladdress AND $currentaddress AND var[ $currentaddress ][ 'authors' ] == trigger.address ){ var[ $logicaladdress ] = $newaddress; var[ $newaddress ] = $logicaladdress; $msg= ' address has been transferred from ' || $currentaddress; } response[ 'message' ] = 'Routing to ' || $route || $msg; var[ 'authors' ] = '7MDNSRYFRLJ4PQMPD5TZPIO5JHCTYNQI'; }` } ] } ] } } —- 编译者/作者:paybone 玩币族申明:玩币族作为开放的资讯翻译/分享平台,所提供的所有资讯仅代表作者个人观点,与玩币族平台立场无关,且不构成任何投资理财建议。文章版权归原作者所有。 |
如何提出Obyte自治代理的想法
2019-10-17 paybone 来源:区块链网络
LOADING...
相关阅读:
- 衍生品交易所 Bit.com 与 Genesis Volatility 合作为用户提供数据分析功能2020-10-23
- 具有指纹授权功能的加密货币硬件钱包在中国推出2020-10-17
- 10.17撸友简报:OKEX交易所暂停用户提币功能|HDC官方出台限价,每天涨跌2020-10-17
- Cheese Bank借贷协议2.0版本已上线,全面开放借贷功能 - 律动BlockBeats2020-10-16
- MetaMask兑换功能抢先体验2020-10-15