Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to realize EOS push operation

Shulou Source: shulou.com Published: 2022-06-01 02:21:34 10月25日 Update

Most people do not understand the knowledge points of this article "how to achieve EOS push operation", so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to achieve EOS push operation" article.

Push operation

According to the contract ABI, the message should be the contract.

For example, the ABI of a currency contract is constructed as follows.

$cleos get code-a currency.abi currencycode hash: 9b9db1a7940503a88535517049e64467a6e8f4e9e03af15e9968ec89dd794975saving 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"}]}

From the abi above, we can see that the currency contract accepts an operation called transfer, which accepts messages with from,to and amount fields.

$. / cleos push message currency transfer'{"from": "currency", "to": "tester", "amount": 50}'- S currency-S tester-p currency@active1589302ms 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": []}]}} above is the content of this article on "how to implement EOS push operation" I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please pay attention to the industry information channel.

Tags: Content push contract article message knowledge article currency value most fields that is more steps knowledge points industry information information channels facets channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology NVidia Linux MySQL vpn