先啰嗦几句:本人区块链小白一枚,正在自学EOS应用开发(当然目前也没有培训班培训),我的这个系列文章是我的学习笔记,因此,鉴于水平有限,难免有许多错误之处,还希望各位读者海涵,若能留言勘误,更是感激不尽。同时也欢迎热爱EOS开发的朋友加我微信(微信号:361757),暗号EOS,我已经创建了一个交流群,发布本文时(2018年4月13日),群人数已经达到106人!好了,系好安全带,我们的EOS应用开发之旅,马上开始!
本系列文章共分4篇,学习的内容为EOS.IO Programs & Tools
本文为第三部分,重点探索cleos的transfer的用法。
在学习本文前,您需要先部署好EOS.IO运行环境,测试一下智能合约,然后再开始学习。
transfer的作用是从一个账户发送EOS到另一个账户
首先,测试一下有哪些命令
$ cleos transfer
ERROR: RequiredError: sender
Transfer EOS from account to account
Usage: cleos transfer [OPTIONS] sender recipient amount [memo]
Positionals:
sender TEXT The account sending EOS
recipient TEXT The account receiving EOS
amount UINT The amount of EOS to send
memo TEXT The memo for the transfer
Options:
-x,--expiration set the time in seconds before a transaction expires, defaults to 30s
-f,--force-unique force the transaction to be unique. this will consume extra bandwidth and remove any protections against accidently issuing the same transaction multiple times
-s,--skip-sign Specify if unlocked wallet keys should be used to sign transaction
-j,--json print result as json
-d,--dont-broadcast don''t broadcast transaction to the network (just print to stdout)
-p,--permission TEXT ... An account and permission level to authorize, as in 'account@permission' (defaults to 'sender@active')
--max-cpu-usage UINT set an upper limit on the cpu usage budget, in instructions-retired, for the execution of the transaction (defaults to 0 which means no limit)
--max-net-usage UINT set an upper limit on the net usage budget, in bytes, for the transaction (defaults to 0 which means no limit)
命令格式为:
$ cleos transfer sender recipient amount [memo]
其中,sender为发送者,recipient为接受者,amount为数量,memo为备注。
转账操作需要部署好智能合约,所以这里没办法测试,待回头来修改。
网友评论