经验分享 cleos 命令解析 (2)

OuterST · 2018年05月31日 · 最后由 dnbstarz 回复于 2018年08月22日 · 13750 次阅读
本帖已被设为精华帖!

启动nodes和删除本地数据

nodeos -e -p eosio --plugin eosio::wallet_api_plugin --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin --plugin eosio::net_api_plugin
rm -rf ~/.local/share/eosio/nodeos/data/ ~/eosio-wallet/default.wallet 

1. cleos

Options:
 -h,--help Print this help message and exit
 -u,--url TEXT=http://localhost:8888/
 the http/https URL where nodeos is running
 --wallet-url TEXT=http://localhost:8900/
 the http/https URL where keosd is running
 -r,--header pass specific HTTP header; repeat this option to pass multiple headers
 -n,--no-verify don't verify peer certificate when using HTTPS
 -v,--verbose output verbose actions on error

Subcommands:
 version Retrieve version information
 create Create various items, on and off the blockchain
 get Retrieve various items and information from the blockchain
 set Set or update blockchain state
 transfer Transfer EOS from account to account
 net Interact with local p2p network connections
 wallet Interact with local wallet
 sign Sign a transaction
 push Push arbitrary transactions to the blockchain
 multisig Multisig contract commands
 system Send eosio.system contract action to the blockchain.

执行其他命令前,需要先满足一些条件。
钱包私钥:PW5JFneU5XMTRgXiAip6AaVr1AJnoZAnKX8mZyVtdQZ2qayuPBJRg
生成的key对:
PUB:EOS7bw5hbQBBFo742Wv1TL3sfxmkJYjTcSfn5AvAe5hLZ5zzS36PR

PRI:5JSsegNXnUsShgXZuX7HkN3JY6QgaC8Y85wUBeDeNY2T5h8FFLE

cleos wallet create
cleos wallet create_key
cleos create account eosio ost EOS7bw5hbQBBFo742Wv1TL3sfxmkJYjTcSfn5AvAe5hLZ5zzS36PR EOS7bw5hbQBBFo742Wv1TL3sfxmkJYjTcSfn5AvAe5hLZ5zzS36PR
cleos create account eosio eosio.token EOS7bw5hbQBBFo742Wv1TL3sfxmkJYjTcSfn5AvAe5hLZ5zzS36PR EOS7bw5hbQBBFo742Wv1TL3sfxmkJYjTcSfn5AvAe5hLZ5zzS36PR
cleos set contract eosio.token build/contracts/eosio.token/ -p eosio.token
cleos push action eosio.token create '["eosio.token","10000000000.0000 EOS"]' -p eosio.token
cleos push action eosio.token issue '["ost","100000.0000 EOS",""]' -p eosio.token

2. transfer

转账

cleos transfer ost eosio "1000.0000 EOS"
executed transaction: 308cfc510c59bec4b3f24140d97941b7aa0d2fb4be9050464a79848577dd0dc3 128 bytes 319 us
# eosio.token <= eosio.token::transfer {"from":"ost","to":"eosio","quantity":"1000.0000 EOS","memo":""}
# ost <= eosio.token::transfer {"from":"ost","to":"eosio","quantity":"1000.0000 EOS","memo":""}
# eosio <= eosio.token::transfer {"from":"ost","to":"eosio","quantity":"1000.0000 EOS","memo":""}
warning: transaction executed locally, but may not be confirmed by the network yet

3. net

3.1 net connect

链接节点

cleos net connect 127.0.0.1:8888
"added connection"

3.2 net disconnect

取消链接

cleos net disconnect 127.0.0.1:8888
"connection removed"

3.3 net status

查看链接状态,如果没有链接,返回null


cleos net connect  127.0.0.1:8888

cleos net status 127.0.0.1:8888
{
 "peer": "127.0.0.1:8888",
 "connecting": true,
 "syncing": false,
 "last_handshake": {
 "network_version": 0,
 "chain_id": {
 "id": "144b6ab7924ea47bae7a5846b4494a35563ae816e2ed5affa7a9c990c2b3cfb3"
 },
 "node_id": "0000000000000000000000000000000000000000000000000000000000000000",
 "key": "EOS1111111111111111111111111111111114T1Anm",
 "time": 0,
 "token": "0000000000000000000000000000000000000000000000000000000000000000",
 "sig": "SIG_K1_111111111111111111111111111111111111111111111111111111111111111116uk5ne",
 "p2p_address": "",
 "last_irreversible_block_num": 0,
 "last_irreversible_block_id": "0000000000000000000000000000000000000000000000000000000000000000",
 "head_num": 0,
 "head_id": "0000000000000000000000000000000000000000000000000000000000000000",
 "os": "",
 "agent": "",
 "generation": 0
 }
}

3.4 peers

查看节点信息


cleos net peers
[{
 "peer": "127.0.0.1:8888",
 "connecting": true,
 "syncing": false,
 "last_handshake": {
 "network_version": 0,
 "chain_id": {
 "id": "144b6ab7924ea47bae7a5846b4494a35563ae816e2ed5affa7a9c990c2b3cfb3"
 },
 "node_id": "0000000000000000000000000000000000000000000000000000000000000000",
 "key": "EOS1111111111111111111111111111111114T1Anm",
 "time": 0,
 "token": "0000000000000000000000000000000000000000000000000000000000000000",
 "sig": "SIG_K1_111111111111111111111111111111111111111111111111111111111111111116uk5ne",
 "p2p_address": "",
 "last_irreversible_block_num": 0,
 "last_irreversible_block_id": "0000000000000000000000000000000000000000000000000000000000000000",
 "head_num": 0,
 "head_id": "0000000000000000000000000000000000000000000000000000000000000000",
 "os": "",
 "agent": "",
 "generation": 0
 }
 }
]

4. cleos sign

签名,{}里面可以对对应的参数做修改,命令回车后,要输入签名的私钥

cleos sign '{"ref_block_prefix":1}'
private key: {
 "expiration": "1970-01-01T00:00:00",
 "ref_block_num": 0,
 "ref_block_prefix": 1,
 "max_net_usage_words": 0,
 "max_cpu_usage_ms": 0,
 "delay_sec": 0,
 "context_free_actions": [],
 "actions": [],
 "transaction_extensions": [],
 "signatures": [
 "SIG_K1_KVQhqAfKstJHeoesSEGSpEcChGrjqLWj7KC1sQVnnTdk2ivCZpHeQXBbr8zDd2yTJNJg7hZof7DoXWQJfA4oiYNmMjR6d5"
 ],
 "context_free_data": []
}

5. cleos push

5.1 push action

cleos push action eosio.token issue '["ost","100.0000 EOS",""]' -p eosio.token
executed transaction: 2b126ceb62e27dd2125357e8959039a89b2e0106129efe71e61f27c559e0e9c8 120 bytes 1674 us
# eosio.token <= eosio.token::issue {"to":"ost","quantity":"100.0000 EOS","memo":""}
# eosio.token <= eosio.token::transfer {"from":"eosio.token","to":"ost","quantity":"100.0000 EOS","memo":""}
# ost <= eosio.token::transfer {"from":"eosio.token","to":"ost","quantity":"100.0000 EOS","memo":""}
warning: transaction executed locally, but may not be confirmed by the network yet

5.2 push transaction

这里笔者并没有通过,transaction 的json格式,暂时还没有弄懂。 这里仅供参考。

cleos push transaction '{"ref_block_num":"30101","ref_block_prefix":"559920843","expiration":"2018-05-29T08:23:49","scope":["eosio.token"],"actions":[{"account":"eosio.token","name":"transfer","authorization":[{"actor":"eosio.token","permission":"active"}],"data":"00000000000032a640420f000000000004454f530000000000"}],"signatures":[],"authorizations":[]}'

5.3 push transactions

由于上条没有通过,这条暂时略,希望有人解惑。

6. cleos system

ctrl+c停掉nodes,然后数据清空,在启动nodes

rm -rf ~/.local/share/eosio/nodeos/data/ ~/eosio-wallet/default.wallet

先创建帐号,部署合约,转账,准备要充足。
钱包私钥:PW5KQzcxhK7Pa81Yg5K5rhHuzbskGmQDmeBgDJ21oTomMzH45awfq
key对:
PUB: EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg
PRI: 5Js9i3oFfp9jsYBPZoZBZtcux5hke8ySxwBtwERvP51u6thM34j
4.0 以后 set contract eosio 的时候,需要拥有以下账号

systemAccounts = [
    'eosio.bpay',
    'eosio.msig',
    'eosio.names',
    'eosio.ram',
    'eosio.ramfee',
    'eosio.saving',
    'eosio.stake',
    'eosio.token',
    'eosio.vpay',
]
cleos wallet create
cleos wallet create_key
cleos wallet import 5Js9i3oFfp9jsYBPZoZBZtcux5hke8ySxwBtwERvP51u6thM34j
cleos create account eosio eosio.bpay EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg
cleos create account eosio eosio.msig EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg
cleos create account eosio eosio.names EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg
cleos create account eosio eosio.ram EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg
cleos create account eosio eosio.ramfee EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg
cleos create account eosio eosio.saving EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg
cleos create account eosio eosio.stake EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg
cleos create account eosio eosio.token EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg
cleos create account eosio eosio.vpay EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg
cleos create account eosio ost EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg
cleos create account eosio ostvoter EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg
cleos set contract eosio.token build/contracts/eosio.token -p eosio.token
cleos push action eosio.token create '[ "eosio.token", "1000000000.0000 SYS", 0, 0, 0]' -p eosio.token
cleos push action eosio.token issue '["eosio","100000.0000 SYS",""]' -p eosio.token
cleos set contract eosio build/contracts/eosio.system/ -p eosio

6.1 newaccount

创建子帐号:重新试了一下,需要加三个参数 --stake-net --stake-cpu --buy-ram-bytes 不一定要12个长度的名字 。

cleos system newaccount eosio ostost EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg --stake-net "10.0000 SYS" --stake-cpu "10.0000 SYS" --buy-ram-bytes 1000
1932551ms thread-0   main.cpp:429                  create_action        ] result: {"binargs":"0000000000ea305500000000644c33a600a00f00"} arg: {"code":"eosio","action":"buyrambytes","args":{"payer":"eosio","receiver":"ostost","bytes":1024000}} 
1932553ms thread-0   main.cpp:429                  create_action        ] result: {"binargs":"0000000000ea305500000000644c33a6a0860100000000000453595300000000a086010000000000045359530000000000"} arg: {"code":"eosio","action":"delegatebw","args":{"from":"eosio","receiver":"ostost","stake_net_quantity":"10.0000 SYS","stake_cpu_quantity":"10.0000 SYS","transfer":false}} 
executed transaction: 9da466fda6436ee195a156fad9f80bbfa3aa1ba87a39e07d8335b9462d63b7cc  336 bytes  1908 us
#         eosio <= eosio::newaccount            {"creator":"eosio","name":"ostost","owner":{"threshold":1,"keys":[{"key":"EOS8kZRKTXpLozY182AtdvjZyE...
#         eosio <= eosio::buyrambytes           {"payer":"eosio","receiver":"ostost","bytes":1024000}
#   eosio.token <= eosio.token::transfer        {"from":"eosio","to":"eosio.ram","quantity":"0.0014 SYS","memo":"buy ram"}
#         eosio <= eosio.token::transfer        {"from":"eosio","to":"eosio.ram","quantity":"0.0014 SYS","memo":"buy ram"}
#     eosio.ram <= eosio.token::transfer        {"from":"eosio","to":"eosio.ram","quantity":"0.0014 SYS","memo":"buy ram"}
#         eosio <= eosio::delegatebw            {"from":"eosio","receiver":"ostost","stake_net_quantity":"10.0000 SYS","stake_cpu_quantity":"10.0000...
#   eosio.token <= eosio.token::transfer        {"from":"eosio","to":"eosio.stake","quantity":"20.0000 SYS","memo":"stake bandwidth"}
#         eosio <= eosio.token::transfer        {"from":"eosio","to":"eosio.stake","quantity":"20.0000 SYS","memo":"stake bandwidth"}
#   eosio.stake <= eosio.token::transfer        {"from":"eosio","to":"eosio.stake","quantity":"20.0000 SYS","memo":"stake bandwidth"}
warning: transaction executed locally, but may not be confirmed by the network yet

6.2 regproducer

注册节点


cleos system regproducer ost EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg
2216954ms thread-0 main.cpp:429 create_action ] result: {"binargs":"00000000000032a60003fcc7524267e23930ad21fdf8774ed13853313cce22f6ef86366ee4462f77fdf5000000"} arg: {"code":"eosio","action":"regproducer","args":{"producer":"ost","producer_key":"EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg","url":"","location":0}} 
executed transaction: 94498dc46095558e1434fdcf6c6c37ca0ac77a0bfd9d72c2b68692a85647a70b 144 bytes 2363 us
# eosio <= eosio::regproducer {"producer":"ost","producer_key":"EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg","url":"","l...
warning: transaction executed locally, but may not be confirmed by the network yet

6.3 unregprod

取消注册节点

cleos system unregprod ost
2240794ms thread-0 main.cpp:429 create_action ] result: {"binargs":"00000000000032a6"} arg: {"code":"eosio","action":"unregprod","args":{"producer":"ost"}} 
executed transaction: 1764d9c78a7c5ab77457737a3b575d055ca5078c8f35841dfe1b6381f41e2370 104 bytes 470 us
# eosio <= eosio::unregprod {"producer":"ost"}
warning: transaction executed locally, but may not be confirmed by the network yet

6.4 voteproducer

节点投票

Usage: cleos system voteproducer [OPTIONS] SUBCOMMAND
Options:
 -h,--help Print this help message and exit

Subcommands:
 proxy Vote your stake through a proxy
 prods Vote for one or more producers
 approve Add one producer to list of voted producers
 unapprove Remove one producer from list of voted producers

6.4.1 proxy

设置代理

cleos system voteproducer proxy eosio ostvoter
563265ms thread-0 main.cpp:429 create_action ] result: {"binargs":"0000000000ea30550000005765ba33a600"} arg: {"code":"eosio","action":"voteproducer","args":{"voter":"eosio","proxy":"ostvoter","producers":[]}} 
executed transaction: 6e571756de62acf1e46c491faae3851e2dd921dcf09450fb554da32bfa17e696 112 bytes 1770 us
# eosio <= eosio::voteproducer {"voter":"eosio","proxy":"ostvoter","producers":[]}
# ostvoter <= eosio::voteproducer {"voter":"eosio","proxy":"ostvoter","producers":[]}
warning: transaction executed locally, but may not be confirmed by the network yet

6.4.2 prods

投票

cleos system voteproducer prods ostvoter ost

3283542ms thread-0 main.cpp:429 create_action ] result: {"binargs":"0000005765ba33a600000000000000000100000000000032a6"} arg: {"code":"eosio","action":"voteproducer","args":{"voter":"ostvoter","proxy":"","producers":["ost"]}} 
executed transaction: 5d4e6c287dab220d9a50a4dad968ed678fc0025e21b550746c5c863b4e668b2e 120 bytes 3465 us
# eosio <= eosio::voteproducer {"voter":"ostvoter","proxy":"","producers":["ost"]}
warning: transaction executed locally, but may not be confirmed by the network yet

6.4.3 approve

通过投票

cleos system voteproducer approve ostvoter ost
782998ms thread-0 main.cpp:429 create_action ] result: {"binargs":"0000005765ba33a600000000000000000100000000000032a6"} arg: {"code":"eosio","action":"voteproducer","args":{"voter":"ostvoter","proxy":"","producers":["ost"]}} 
executed transaction: 2615f5bceb339f0fd479625721d0cbbfea061c0a81e81d61103147f89291d30f 120 bytes 1993 us
# eosio <= eosio::voteproducer {"voter":"ostvoter","proxy":"","producers":["ost"]}
warning: transaction executed locally, but may not be confirmed by the network yet

6.4.4 unapprove

取消通过


cleos system voteproducer unapprove ostvoter ost
759301ms thread-0 main.cpp:429 create_action ] result: {"binargs":"0000005765ba33a6000000000000000000"} arg: {"code":"eosio","action":"voteproducer","args":{"voter":"ostvoter","proxy":"","producers":[]}} 
executed transaction: 0628d57971a45a79953dbc27e7c89ee432cf960dff38e2a3263f1df3b3568148 112 bytes 2863 us
# eosio <= eosio::voteproducer {"voter":"ostvoter","proxy":"","producers":[]}
warning: transaction executed locally, but may not be confirmed by the network yet

6.5 listproducers

查看节点

cleos system listproducers
Producer Producer key Url Scaled votes
ost EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbK

6.6 delegatebw

投票抵押

cleos system buyram eosio ostvoter "1000.0000 SYS"

cleos system delegatebw ostvoter ostvoter "10.0000 SYS" "10.0000 SYS"
231556ms thread-0 main.cpp:1092 operator() ] act_payload: {"from":"ostvoter","receiver":"ostvoter","stake_net_quantity":"10.0000 SYS","stake_cpu_quantity":"10.0000 SYS","transfer":false} 
231559ms thread-0 main.cpp:429 create_action ] result: {"binargs":"0000005765ba33a60000005765ba33a6a0860100000000000453595300000000a086010000000000045359530000000000"} arg: {"code":"eosio","action":"delegatebw","args":{"from":"ostvoter","receiver":"ostvoter","stake_net_quantity":"10.0000 SYS","stake_cpu_quantity":"10.0000 SYS","transfer":false}} 
executed transaction: 329f7748fe057be4bf58f8f83c414a1b7c7aac28d56586c7fea05a6eedbc3fc1 144 bytes 2300 us
# eosio <= eosio::delegatebw {"from":"ostvoter","receiver":"ostvoter","stake_net_quantity":"10.0000 SYS","stake_cpu_quantity":"10...
# eosio.token <= eosio.token::transfer {"from":"ostvoter","to":"eosio.stake","quantity":"20.0000 SYS","memo":"stake bandwidth"}
# ostvoter <= eosio.token::transfer {"from":"ostvoter","to":"eosio.stake","quantity":"20.0000 SYS","memo":"stake bandwidth"}
# eosio.stake <= eosio.token::transfer {"from":"ostvoter","to":"eosio.stake","quantity":"20.0000 SYS","memo":"stake bandwidth"}
warning: transaction executed locally, but may not be confirmed by the network yet

6.7 undelegatebw

取消抵押:暂时没通过

cleos system undelegatebw ostvoter ostvoter "5.0000 SYS" "5.0000 SYS"

6.8 listbw

抵押列表

cleos system listbw ostvoter
Receiver Net bandwidth CPU bandwidth 
ostvoter 15.0000 SYS 15.0000 SYS

6.9 buyram

购买ram

cleos system buyram eosio ostvoter "1000.0000 SYS" 
2461577ms thread-0 main.cpp:429 create_action ] result: {"binargs":"0000000000ea30550000005765ba33a680969800000000000453595300000000"} arg: {"code":"eosio","action":"buyram","args":{"payer":"eosio","receiver":"ostvoter","quant":"1000.0000 SYS"}} 
executed transaction: 72736f41b854d4ccf7645115552c1521dc639e6df13bec2386cd0897a8d4f34e 128 bytes 4001 us
# eosio <= eosio::buyram {"payer":"eosio","receiver":"ostvoter","quant":"1000.0000 SYS"}
# eosio.token <= eosio.token::transfer {"from":"eosio","to":"eosio.ram","quantity":"995.0000 SYS","memo":"buy ram"}
# eosio <= eosio.token::transfer {"from":"eosio","to":"eosio.ram","quantity":"995.0000 SYS","memo":"buy ram"}
# eosio.ram <= eosio.token::transfer {"from":"eosio","to":"eosio.ram","quantity":"995.0000 SYS","memo":"buy ram"}
# eosio.token <= eosio.token::transfer {"from":"eosio","to":"eosio.ramfee","quantity":"5.0000 SYS","memo":"ram fee"}
# eosio <= eosio.token::transfer {"from":"eosio","to":"eosio.ramfee","quantity":"5.0000 SYS","memo":"ram fee"}
# eosio.ramfee <= eosio.token::transfer {"from":"eosio","to":"eosio.ramfee","quantity":"5.0000 SYS","memo":"ram fee"}
warning: transaction executed locally, but may not be confirmed by the network yet

6.10 sellram

销售ram

cleos get table eosio ostvoter userres
{
 "rows": [{
 "owner": "ostvoter",
 "net_weight": "0.0000 SYS",
 "cpu_weight": "0.0000 SYS",
 "ram_bytes": "62443725433"
 }
 ],
 "more": false
}
cleos system sellram ostvoter 62443722309
2706566ms thread-0 main.cpp:429 create_action ] result: {"binargs":"0000005765ba33a64596ef890e000000"} arg: {"code":"eosio","action":"sellram","args":{"account":"ostvoter","bytes":"62443722309"}} 
executed transaction: ba707c836c509b4bcf91d15f92220a71776de8b127dc4ce6588135abacaeffea 112 bytes 5967 us
# eosio <= eosio::sellram {"account":"ostvoter","bytes":"62443722309"}
# eosio.token <= eosio.token::transfer {"from":"eosio.ram","to":"ostvoter","quantity":"994.9999 SYS","memo":"sell ram"}
# eosio.ram <= eosio.token::transfer {"from":"eosio.ram","to":"ostvoter","quantity":"994.9999 SYS","memo":"sell ram"}
# ostvoter <= eosio.token::transfer {"from":"eosio.ram","to":"ostvoter","quantity":"994.9999 SYS","memo":"sell ram"}
# eosio.token <= eosio.token::transfer {"from":"ostvoter","to":"eosio.ramfee","quantity":"4.9749 SYS","memo":"sell ram fee"}
# ostvoter <= eosio.token::transfer {"from":"ostvoter","to":"eosio.ramfee","quantity":"4.9749 SYS","memo":"sell ram fee"}
# eosio.ramfee <= eosio.token::transfer {"from":"ostvoter","to":"eosio.ramfee","quantity":"4.9749 SYS","memo":"sell ram fee"}
warning: transaction executed locally, but may not be confirmed by the network yet
cleos get table eosio ostvoter userres
{
 "rows": [{
 "owner": "ostvoter",
 "net_weight": "0.0000 SYS",
 "cpu_weight": "0.0000 SYS",
 "ram_bytes": 3124
 }
 ],
 "more": false
}

6.11 claimrewards

发放奖励:暂时未通过。

cleos system claimrewards ost

6.12 regproxy

注册代理

cleos system regproxy ostvoter
3414211ms thread-0 main.cpp:429 create_action ] result: {"binargs":"0000005765ba33a601"} arg: {"code":"eosio","action":"regproxy","args":{"proxy":"ostvoter","isproxy":true}} 
executed transaction: 884b12b9062eba6699eb761de74e281a741d8fc036e958c12979c53b10db25c3 104 bytes 852 us
# eosio <= eosio::regproxy {"proxy":"ostvoter","isproxy":1}
warning: transaction executed locally, but may not be confirmed by the network yet

6.13 unregproxy

取消的代理

cleos system unregproxy ostvoter
3426210ms thread-0 main.cpp:429 create_action ] result: {"binargs":"0000005765ba33a600"} arg: {"code":"eosio","action":"regproxy","args":{"proxy":"ostvoter","isproxy":false}} 
executed transaction: fa461e80fcb868f670826b88e3a42208791733e43da850480195bc7a68bdba75 104 bytes 1712 us
# eosio <= eosio::regproxy {"proxy":"ostvoter","isproxy":0}
warning: transaction executed locally, but may not be confirmed by the network yet

6.14 canceldelay

Usage: cleos system canceldelay [OPTIONS] canceling_account canceling_permission trx_id

Positionals:
 canceling_account TEXT Account from authorization on the original delayed transaction
 canceling_permission TEXT Permission from authorization on the original delayed transaction
 trx_id TEXT The transaction id of the original delayed transaction

7. multisig

钱包私钥 :PW5Hw182MikB6hCZBZ766DvVmwwDZYyJnsvfpKJNuZagbSZzN6d4p
keys:
PUB: EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg
PRI: 5Js9i3oFfp9jsYBPZoZBZtcux5hke8ySxwBtwERvP51u6thM34j
下面的ram msig ramfee stake 是必须的。

cleos wallet create
cleos wallet import 5Js9i3oFfp9jsYBPZoZBZtcux5hke8ySxwBtwERvP51u6thM34j
cleos create account eosio eosio.msig EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg
cleos create account eosio eosio.ram EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg
cleos create account eosio eosio.ramfee EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg
cleos create account eosio eosio.stake EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg
cleos create account eosio eosio.token EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg
cleos create account eosio ost EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg
cleos create account eosio imtube EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg EOS8kZRKTXpLozY182AtdvjZyEEwz96vvFvJttj7nbKc3N27s35wg
cleos set contract eosio.msig build/contracts/eosio.msig/ -p eosio.msig
cleos set contract eosio.token build/contracts/eosio.token -p eosio.token
cleos push action eosio.token create '[ "eosio.token", "1000000000.0000 SYS", 0, 0, 0]' -p eosio.token
cleos push action eosio.token issue '["eosio","100000.0000 SYS",""]' -p eosio.token
cleos push action eosio.token issue '["ost","100000.0000 SYS",""]' -p eosio.token

包含命令:

Subcommands:
 propose Propose transaction
 review Review transaction
 approve Approve proposed transaction
 unapprove Unapprove proposed transaction
 cancel Cancel proposed transaction
 exec Execute proposed transaction

7.1 propose
提案:

cleos multisig propose test '[{"actor": "ost", "permission": "active"}]' '[{"actor": "ost", "permission": "active"}]' eosio.token issue '{"to": "imtube", "quantity": "1000.0000 EOS", "memo": ""}' -p imtube
executed transaction: 75f9d3f38ebf1cb84cac4ff9d23dc3d864fae0b5f5481485d7e56d637822997a 200 bytes 1205 us
# eosio.msig <= eosio.msig::propose {"proposer":"imtube","proposal_name":"test","requested":[{"actor":"ost","permission":"active"}],"trx...
warning: transaction executed locally, but may not be confirmed by the network yet

7.2 review

查看提案:

cleos multisig review imtube test -p ost
{
 "proposal_name": "test",
 "packed_transaction": "1603115b000000000000000000000100a6823403ea30550000000000a531760100000000000032a600000000a8ed32321900000000a8a3b374809698000000000004454f53000000000000",
 "transaction": {
 "expiration": "2018-06-01T08:25:58",
 "ref_block_num": 0,
 "ref_block_prefix": 0,
 "max_net_usage_words": 0,
 "max_cpu_usage_ms": 0,
 "delay_sec": 0,
 "context_free_actions": [],
 "actions": [{
 "account": "eosio.token",
 "name": "issue",
 "authorization": [{
 "actor": "ost",
 "permission": "active"
 }
 ],
 "data": {
 "to": "imtube",
 "quantity": "1000.0000 EOS",
 "memo": ""
 },
 "hex_data": "00000000a8a3b374809698000000000004454f530000000000"
 }
 ],
 "transaction_extensions": []
 }
}

7.3 approve
通过提案:

cleos multisig approve imtube test '{"actor": "ost", "permission": "active"}' -p ost
executed transaction: d5ccb49dd085214cc97e8c27c30e8cf80f414d168ab6eee6edafe0e8649d6fe1 128 bytes 1022 us
# eosio.msig <= eosio.msig::approve {"proposer":"imtube","proposal_name":"test","level":{"actor":"ost","permission":"active"}}
warning: transaction executed locally, but may not be confirmed by the network yet

7.4 unapprove

否决提案:

cleos multisig unapprove imtube test '{"actor":"ost","permission":"active"}' -p ost
executed transaction: db9fb29dd5c67f8c44ae391a944dbcc49e39502caa5282eebc209aa86cdef8a0 128 bytes 243 us
# eosio.msig <= eosio.msig::unapprove {"proposer":"imtube","proposal_name":"test","level":{"actor":"ost","permission":"active"}}
warning: transaction executed locally, but may not be confirmed by the network yet

7.5 cancel

取消前:

cleos multisig propose test '[{"actor": "ost", "permission": "active"}]' '[{"actor": "ost", "permission": "active"}]' eosio.token issue '{"to": "imtube", "quantity": "1000.0000 EOS", "memo": ""}' -p imtube
cleos multisig approve imtube test '{"actor": "ost", "permission": "active"}' -p ost

取消提案:

cleos multisig cancel imtube test -p imtube
executed transaction: b785ca9f47bdc6d4ffd34792a885d9bb58c9fa0c91132fe69eef6fcf5bd4940a 120 bytes 295 us
# eosio.msig <= eosio.msig::cancel {"proposer":"imtube","proposal_name":"test","canceler":"imtube"}
warning: transaction executed locally, but may not be confirmed by the network yet

7.6 exec

执行提案:暂未通过

Usage: cleos multisig exec [OPTIONS] proposer proposal_name [executer]

Positionals:
 proposer TEXT proposer name (string)
 proposal_name TEXT proposal name (string)
 executer TEXT account paying for execution (string)
共收到 46 条回复
strahe 将本帖设为了精华贴 05月31日 18:12

关于 eosio system newaccount 你们可以试一下12字节的account name(中间不能带字符“.”)就可以创建

dragon 回复

好的,谢谢

赞!要是每个命令后加上相关表查询就更赞了

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册