我们以currency合约为例:
发布合约:
➜ programs git:(master) ✗ ./eosc/eosc contract
ERROR: RequiredError: account
Create or update the contract on an account
Usage: ./eosc/eosc contract [OPTIONS] account wast-file [abi-file]
Positionals:
account TEXT The account to publish a contract for
wast-file TEXT The file containing the contract WAST
abi-file TEXT The ABI for the contract
Options:
-h,--help Print this help message and exit
-a,--abi TEXT The ABI for the contract
➜ programs git:(master) ✗ ./eosc/eosc contract currency ../../contracts/currency/currency.wast ../../contracts/currency/currency.abi
更多命令:
➜ programs git:(master) ✗ ./eosc/eosc
ERROR: RequiredError: Subcommand required
Command Line Interface to Eos Daemon
Usage: ./eosc/eosc [OPTIONS] SUBCOMMAND
Options:
-h,--help Print this help message and exit
Subcommands:
create Create various items, on and off the blockchain
get Retrieve various items and information from the blockchain
contract Create or update the contract on an account
transfer Transfer EOS from account to account
benchmark Configure and execute benchmarks
push Push arbitrary data to the blockchain
➜ programs git:(master) ✗ ./eosc/eosc push
ERROR: RequiredError: Subcommand required
Push arbitrary data to the blockchain
Usage: ./eosc/eosc push SUBCOMMAND
Subcommands:
message Push a transaction with a single message
transaction Push an arbitrary JSON transaction
transactions Push an array of arbitrary JSON transactions
➜ programs git:(master) ✗ ./eosc/eosc push message
ERROR: RequiredError: contract
Push a transaction with a single message
Usage: ./eosc/eosc push message [OPTIONS] contract action data
Positionals:
contract TEXT The account providing the contract to execute
action TEXT The action to execute on the contract
data TEXT The arguments to the contract
Options:
-h,--help Print this help message and exit
-p,--permission TEXT ... An account and permission level to authorize, as in 'account@permission'
-s,--scope TEXT=[] ... An account in scope for this operation
合约转账
➜ programs git:(master) ✗ ./eosc/eosc push message currency transfer '{"from":"tester","to":"inita","quantity":50}' -s inita -s tester -p tester@active
更多文档:https://eosio.github.io/eos/group__contractdev.html
https://eosio.github.io/eos/group__eosc.html
大家可以通过一下方式跟踪关注我:
github:https://github.com/philsong
本文是EOS技术研究系列的第五篇。
第一篇.Mac下的编译:http://www.jianshu.com/p/f26ee4cf1d4a
第二篇.eosc命令行工具:http://www.jianshu.com/p/b2db966435d0
第三篇.appbase库:http://www.jianshu.com/p/b7f0bbe89610
第四篇.chainbase库与database_plugin插件:http://www.jianshu.com/p/df835b574b52
第五篇.如何开发合约发行代币:http://www.jianshu.com/p/5228da9c5631
区块链技术EOS开发系列之如何开发合约发行代币
区块链技术EOS开发系列之如何开发合约发行代币
网友评论