这篇“EOS推送操作怎么实现”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“EOS推送操作怎么实现”文章吧。
成都创新互联专注于尼木网站建设服务及定制,我们拥有丰富的企业做网站经验。 热诚为您提供尼木营销型网站建设,尼木网站制作、尼木网页设计、尼木网站官网定制、重庆小程序开发服务,打造尼木网络公司原创品牌,更为您提供尼木网站排名全网营销落地服务。
根据合约ABI,消息应该是合约。
例如,货币合约的ABI被构造如下。
$ cleos get code -a currency.abi currency code hash: 9b9db1a7940503a88535517049e64467a6e8f4e9e03af15e9968ec89dd794975 saving abi to currency.abi $ cat currency.abi { "types": [{ "newTypeName": "AccountName", "type": "Name" } ], "structs": [{ "name": "transfer", "base": "", "fields": { "from": "AccountName", "to": "AccountName", "amount": "UInt64" } },{ "name": "account", "base": "", "fields": { "account": "Name", "balance": "UInt64" } } ], "actions": [{ "action": "transfer", "type": "transfer" } ], "tables": [{ "table": "account", "indextype": "i64", "keynames": [ "account" ], "keytype": [], "type": "account" } ] }
从上面的abi中,我们可以看到货币合约接受一个叫做transfer的操作,它接受带有from,to和amount字段的消息。
$ ./cleos push message currency transfer '{"from":"currency","to":"tester","amount":50}' -S currency -S tester -p currency@active 1589302ms thread-0 main.cpp:271 operator() ] Converting argument to binary... 1589304ms thread-0 main.cpp:290 operator() ] Transaction result: { "transaction_id": "1c4911c0b277566dce4217edbbca0f688f7bdef761ed445ff31b31f286720057", "processed": { "refBlockNum": 1173, "refBlockPrefix": 2184027244, "expiration": "2017-08-24T18:28:07", "scope": [ "currency", "tester" ], "signatures": [], "messages": [{ "code": "currency", "type": "transfer", "authorization": [{ "account": "currency", "permission": "active" } ], "data": { "from": "currency", "to": "tester", "quantity": 50 }, "hex_data": "00000079b822651d00000000c84267a13200000000000000" } ], "output": [{ "notify": [{ "name": "tester", "output": { "notify": [], "sync_transactions": [], "async_transactions": [] } } ], "sync_transactions": [], "async_transactions": [] } ] } }
以上就是关于“EOS推送操作怎么实现”这篇文章的内容,相信大家都有了一定的了解,希望小编分享的内容对大家有帮助,若想了解更多相关的知识内容,请关注创新互联行业资讯频道。