EOSIO cleos 命令大全(八)—— sign
EOSIO版本:EOSIO Dawn 3.0
最后更新日期:2018-04-21
說(shuō)明:以下所有命令均為實(shí)際操作結(jié)果。
將 nodeos 和 cleos 加入到環(huán)境變量并運(yùn)行nodeos:
# export PATH=$PATH:/alidata1/eos/build/programs/nodeos
# nodeos
# export PATH=$PATH:/alidata1/eos/build/programs/cleos
cleos sign:返回 cleos sign 順位項(xiàng)和可選參數(shù)
#?cleos sign
運(yùn)行結(jié)果:

順位項(xiàng)說(shuō)明:
transaction TEXT? ? //需要簽名的事務(wù), JSON 格式
可選參數(shù):
-k,--private-key TEXT? ? //用于簽名的私鑰
-p,--push-transaction? ? //簽名后推送事務(wù)
cleos sign transaction:簽署事務(wù)不帶私鑰
#?cleos sign '{"transaction_id": "f6e43207694bb65eef053f39acef86f42a4b606d3bd832f0faaa768269126676", "processed": {"status": "executed", "kcpu_usage": 105, "net_usage_words": 32, "id": "f6e43207694bb65eef053f39acef86f42a4b606d3bd832f0faaa768269126676", "action_traces": [{"receiver": "eosio.token", "context_free": false, "cpu_usage": 5570, "act": {"account": "eosio.token", "name": "issue", "authorization": [{"actor": "wengyingfeng", "permission": "active"}], "data": {"to": "wengyingfeng", "quantity": "300000000.0000 WYF", "memo": "issue WYF"}, "hex_data": "c0a65a6c3acfa6e20030ef7dba020000045759460000000009697373756520575946"}, "console": "issue", "data_access": [{ "type": "write", "code": "eosio.token", "scope": "........ctgpb", "sequence": 1},{"type": "write", "code": "eosio.token", "scope": "wengyingfeng", "sequence": 0}], "_profiling_us": 299}], "deferred_transaction_requests": [], "read_locks": [], "write_locks": [{"account": "eosio.token", "scope": "........ctgpb"},{"account": "eosio.token", "scope": "wengyingfeng"}], "cpu_usage": 107520, "net_usage": 256, "packed_trx_digest": "5cb966eaac2c81b7da4664214db7322be7eff0bae1da973cba4f608f4137ad47", "region_id": 0, "cycle_index": 1, "shard_index": 0, "_profiling_us": 352, "_setup_profiling_us": 126}}'
運(yùn)行結(jié)果:

備注:此命令沒(méi)有帶私鑰參數(shù),需分步執(zhí)行。輸入命令后系統(tǒng)會(huì)提示輸入私鑰,私鑰不會(huì)明文顯示,較為安全,實(shí)際操作建議使用此方法。
cleos sign transaction -k privateKey:簽署事務(wù)帶私鑰
cleos sign '{"transaction_id": "f6e43207694bb65eef053f39acef86f42a4b606d3bd832f0faaa768269126676", "processed": {"status": "executed", "kcpu_usage": 105, "net_usage_words": 32, "id": "f6e43207694bb65eef053f39acef86f42a4b606d3bd832f0faaa768269126676", "action_traces": [{"receiver": "eosio.token", "context_free": false, "cpu_usage": 5570, "act": {"account": "eosio.token", "name": "issue", "authorization": [{"actor": "wengyingfeng", "permission": "active"}], "data": {"to": "wengyingfeng", "quantity": "300000000.0000 WYF", "memo": "issue WYF"}, "hex_data": "c0a65a6c3acfa6e20030ef7dba020000045759460000000009697373756520575946"}, "console": "issue", "data_access": [{ "type": "write", "code": "eosio.token", "scope": "........ctgpb", "sequence": 1},{"type": "write", "code": "eosio.token", "scope": "wengyingfeng", "sequence": 0}], "_profiling_us": 299}], "deferred_transaction_requests": [], "read_locks": [], "write_locks": [{"account": "eosio.token", "scope": "........ctgpb"},{"account": "eosio.token", "scope": "wengyingfeng"}], "cpu_usage": 107520, "net_usage": 256, "packed_trx_digest": "5cb966eaac2c81b7da4664214db7322be7eff0bae1da973cba4f608f4137ad47", "region_id": 0, "cycle_index": 1, "shard_index": 0, "_profiling_us": 352, "_setup_profiling_us": 126}}' -k 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3
運(yùn)行結(jié)果:

備注:此命令帶私鑰,一步執(zhí)行。私鑰會(huì)在控制臺(tái)明文顯示,不建議使用此種方法。
EOSIO cleos 命令大全(一) —— version