
1,摘要
【本文目標(biāo)】
本文列出經(jīng)常EOS環(huán)境經(jīng)常會使用的命令格式以及樣例,作為EOS命令的快速查找手冊。
不管是EOS的命令行幫助說明還是命令行參考文檔,對參數(shù)的引用描述都比較亂,輝哥重新整理后規(guī)定,用[表示參數(shù)可選],用<>表示執(zhí)行命令時其里面的內(nèi)容需要根據(jù)實際情況進(jìn)行修改。
【技術(shù)收獲】
1) EOS各種常見命令格式及樣例演示;
2,具體命令及演示
2.1 環(huán)境相關(guān)
2.1.1 啟動錢包環(huán)境
keosd --http-server-address=127.0.0.1:8900
參數(shù)說明:
1) --http-server-address=127.0.0.1:8900 表示用于監(jiān)聽http鏈接的本地IP和端口;
作為啟動本地環(huán)境的第一步,需要啟動錢包。成功輸出結(jié)果如下:
duncanwang@duncanwang:~$ keosd --http-server-address=127.0.0.1:8900
3861ms thread-0 wallet_plugin.cpp:39 plugin_initialize ] initializing wallet plugin
3862ms thread-0 http_plugin.cpp:290 plugin_initialize ] configured http to listen on 127.0.0.1:8900
3863ms thread-0 http_plugin.cpp:377 add_handler ] add api url: /v1/keosd/stop
3863ms thread-0 http_plugin.cpp:331 plugin_startup ] start listening for http requests
3865ms thread-0 wallet_api_plugin.cpp:73 plugin_startup ] starting wallet_api_plugin
3865ms thread-0 http_plugin.cpp:377 add_handler ] add api url: /v1/wallet/create
3865ms thread-0 http_plugin.cpp:377 add_handler ] add api url: /v1/wallet/create_key
3865ms thread-0 http_plugin.cpp:377 add_handler ] add api url: /v1/wallet/get_public_keys
3865ms thread-0 http_plugin.cpp:377 add_handler ] add api url: /v1/wallet/import_key
3865ms thread-0 http_plugin.cpp:377 add_handler ] add api url: /v1/wallet/list_keys
3865ms thread-0 http_plugin.cpp:377 add_handler ] add api url: /v1/wallet/list_wallets
3865ms thread-0 http_plugin.cpp:377 add_handler ] add api url: /v1/wallet/lock
3865ms thread-0 http_plugin.cpp:377 add_handler ] add api url: /v1/wallet/lock_all
3865ms thread-0 http_plugin.cpp:377 add_handler ] add api url: /v1/wallet/open
3865ms thread-0 http_plugin.cpp:377 add_handler ] add api url: /v1/wallet/remove_key
3865ms thread-0 http_plugin.cpp:377 add_handler ] add api url: /v1/wallet/set_timeout
3865ms thread-0 http_plugin.cpp:377 add_handler ] add api url: /v1/wallet/sign_digest
3866ms thread-0 http_plugin.cpp:377 add_handler ] add api url: /v1/wallet/sign_transaction
3866ms thread-0 http_plugin.cpp:377 add_handler ] add api url: /v1/wallet/unlock
75115ms thread-0 wallet.cpp:223 save_wallet_file ] saving wallet to file /home/duncanwang/eosio-wallet/./duncanwang.wallet
2.1.2 啟動本地節(jié)點
cd ~/eos/build/programs/nodeos
./nodeos -e -p eosio --plugin eosio::wallet_plugin --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin --replay-blockchain
參數(shù)說明:
1) -e
enable-stale-production,開啟后,即使鏈過時了,也能產(chǎn)生區(qū)塊
2) -p eosio
producer-name,生產(chǎn)者的名字,這里指定為eosio
3) --plugin eosio::wallet_plugin
在啟動nodeos時,需要添加參數(shù)eosio::wallet_plugin,否則的話,每次節(jié)點重啟,之前創(chuàng)建的錢包,賬號都不會加載進(jìn)來。
4)--plugin eosio::chain_api_plugin
5) --plugin eosio::history_api_plugin
記錄執(zhí)行過程。
7) --replay-blockchain
--replay-blockchain表示清除數(shù)據(jù)庫內(nèi)鏈的狀態(tài),重新運行,它會導(dǎo)致重新啟動時先讀取之前的區(qū)塊進(jìn)行加載。
2.2 錢包,密鑰對相關(guān)命令
2.2.1 創(chuàng)建錢包
cleos wallet create [-n <wallet_name>]
參數(shù)說明:
- -n <wallet_name>:表示錢包名稱為"wallet_name",不帶該參數(shù)表示創(chuàng)建名稱為'default'的錢包。
創(chuàng)建duncanwang錢包成功,輸出結(jié)果如下:
duncanwang@duncanwang:~/eos$ cleos wallet create -n duncanwang
Creating wallet: duncanwang
Save password to use in the future to unlock this wallet.
Without password imported keys will not be retrievable.
"PW5JMZdES2Cds5LsPRUBRo2THEXpbFSM17Xmcd2XWG7XBd49wveTo"
2.2.2 顯示錢包列表
cleos wallet list [-n <wallet_name>]
顯示該節(jié)點環(huán)境存在的錢包名稱列表。
下面結(jié)果中,"duncanwang"表示錢包名稱,"*"表示該錢包已解鎖。
duncanwang@duncanwang:~$ cleos wallet list
Wallets:
[
"duncanwang *"
]
2.2.3 創(chuàng)建密鑰
cleos create key
創(chuàng)建密鑰對的輸出結(jié)果:
duncanwang@duncanwang:~/eos$ cleos create key
Private key: 5JZQmnt6ZtEzUADswgKgBwMp9qAwTSNM9JFHPRFu1FjrLjj49g7
Public key: EOS6EHAzvrpQ4wo1BPcAk86X6aGDARZgqTcAq1mJRF1SxEYgNGWN1
2.2.4 錢包導(dǎo)入密鑰
cleos wallet import <key> [-n <wallet_name>]
導(dǎo)入密鑰對的私鑰,可以用于操作該錢包內(nèi)的賬號account。命令結(jié)果會提示導(dǎo)入私鑰對應(yīng)的公鑰。
duncanwang@duncanwang:~/eos$ cleos wallet import 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3 -n duncanwang
imported private key for: EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV
2.2.5 列出錢包密鑰
cleos wallet keys [-n <wallet name>]
顯示錢包中所有的公鑰列表。
duncanwang@duncanwang:~/eos$ cleos wallet keys
[
"EOS6EHAzvrpQ4wo1BPcAk86X6aGDARZgqTcAq1mJRF1SxEYgNGWN1",
"EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
]
2.2.6 鎖定錢包
cleos wallet lock [-n <wallet name>]
節(jié)點退出或者默認(rèn)時間到達(dá)時,錢包會自動鎖定。顯示錢包列表中,鎖定的錢包在列表中沒有符號,解鎖的錢包會有""符號顯示。
$ cleos wallet lock -n duncanwang
Locked: 'duncanwang'
2.2.7 解鎖錢包
$ cleos wallet unlock [-n <wallet_name>] [--password <password>]
參數(shù)說明
--password <password>: 表示打開錢包的密碼,創(chuàng)建錢包時給出的。命令輸入時不帶該參數(shù),會在命令回車后提示輸入。
-n <wallet_name> : 錢包名稱,不存在的話表示解鎖"default"錢包。
duncanwang@duncanwang:~/eos$ cleos wallet unlock -n duncanwang
password: Unlocked: duncanwang
2.2.8 打開錢包
cleos wallet open [-n <wallet name>]
當(dāng)EOS節(jié)點重啟時,錢包列表并不能看到錢包列表時,需要重新打開錢包來加載。
$ cleos wallet open
Wallets: [
"default"
]
$ cleos wallet open -n duncanwang
Wallets: [
"default",
"duncanwang"
]
2.3 賬號相關(guān)
2.3.1 創(chuàng)建賬號
cleos create account <control_account> <new_account> <owner_public_key>[<active_public_key>]
參數(shù)說明
- control_account : 控制賬號,eosio是超級用戶,需要靠超級用戶來創(chuàng)建其它的新用戶。
- new_account :賬號名稱,本地環(huán)境創(chuàng)建賬號的命名規(guī)則遵守下邊兩個規(guī)則:小于13個字符;僅包含這些字符:.12345abcdefghijklmnopqrstuvwxyz
- owner_public_key:表示分配給新賬號的一個Owner認(rèn)證的公鑰;
- active_public_key:表示分配給新賬號一個Active認(rèn)證的一個公鑰;
成功輸出結(jié)果:
duncanwang@duncanwang:~/eos$ cleos create account eosio boss EOS6EHAzvrpQ4wo1BPcAk86X6aGDARZgqTcAq1mJRF1SxEYgNGWN1 EOS6EHAzvrpQ4wo1BPcAk86X6aGDARZgqTcAq1mJRF1SxEYgNGWN1
executed transaction: cb6801fe82816f94b447cbfb903ae8e9477f5c99920322d679a9c8c04347e536 200 bytes 367 us
# eosio <= eosio::newaccount {"creator":"eosio","name":"boss","owner":{"threshold":1,"keys":[{"key":"EOS6EHAzvrpQ4wo1BPcAk86X6aGD...
warning: transaction executed locally, but may not be confirmed by the network yet
2.3.3 獲取帳戶信息
$ cleos [-u <bp_name>] get account <account_name>
參數(shù)說明:
-u <bp_name>: 連接的EOS節(jié)點;
-<account_name>:賬號名稱
輸出結(jié)果樣例:
duncanwang@duncanwang:~$ cleos -u https://node1.eoscannon.io get account gobipartners
permissions:
owner 1: 1 EOS8gaYL4uHyAiZjviwNJ8CdY31xikYtQfexyUfkNUnDqhNpnYXQR
active 1: 1 EOS8gaYL4uHyAiZjviwNJ8CdY31xikYtQfexyUfkNUnDqhNpnYXQR
memory:
quota: 7.959 KiB used: 2.926 KiB
net bandwidth:
delegated: 0.1000 EOS (total staked delegated to account from others)
used: 0 bytes
available: 55.92 KiB
limit: 55.92 KiB
cpu bandwidth:
delegated: 0.1000 EOS (total staked delegated to account from others)
used: 0 us
available: 10.9 ms
limit: 10.9 ms
2.3.4 獲取帳戶余額
cleos [-u <bp_name>] get currency balance eosio.token <account_name>
參數(shù)說明:
-u <bp_name>: 連接的EOS節(jié)點;
-<account_name>:賬號名稱
輸出結(jié)果樣例:
表明wangdenghui1賬戶中有16.2010個EOS。
duncanwang@duncanwang:~$ cleos -u https://node1.eoscannon.io get currency balance eosio.token wangdenghui1
16.2010 EOS
2.3.5 EOS轉(zhuǎn)賬
cleos [ -u <bp_name>] transfer <from_account> <to_account> <quantity> [<comments>]
參數(shù)說明:
-u <bp_name>: 連接的EOS節(jié)點;
-<from_account>:發(fā)送賬號的名稱;
-<to_account>:接收賬號的名稱;
-quantity: EOS的數(shù)量,'0.1 EOS'可以表示到小數(shù);
-<comments>:'轉(zhuǎn)給輝哥'形式,表示本筆交易的記錄備注;
輸出案例:
duncanwang@duncanwang:~$ cleos -u https://node1.eoscannon.io transfer wangdenghui1 gobipartners '0.1 EOS' 'test'
executed transaction: fb512f699b61209707a64f188ac9740d39d5747af82a51eebe8b765165f85ea5 136 bytes 879 us
# eosio.token <= eosio.token::transfer {"from":"wangdenghui1","to":"gobipartners","quantity":"0.1000 EOS","memo":"test"}
# wangdenghui1 <= eosio.token::transfer {"from":"wangdenghui1","to":"gobipartners","quantity":"0.1000 EOS","memo":"test"}
# gobipartners <= eosio.token::transfer {"from":"wangdenghui1","to":"gobipartners","quantity":"0.1000 EOS","memo":"test"}
warning: transaction executed locally, but may not be confirmed by the network yet
2.3.6 變更賬戶的active_key
cleos set account permission <轉(zhuǎn)讓賬戶名> active '{"threshold":1,"keys":[{"key":"<對方公鑰>","weight":1}]}' owner
輸出結(jié)果案例:
變更結(jié)果成功,具體操作可參考《第9課 如何變更EOS賬號的active key和owner key?》文章描述。
duncanwang@duncanwang:~$ cleos -u https://node1.eoscannon.io set account permission gobipartners active '{"threshold":1,"keys":[{"key":"EOS7Rq86JcZLgPXwZKRGPYUnLayBy7NcBV7FBE7gSNCW3HmGApK9V","weight":1}]}' owner
executed transaction: 0b7ab9fe92413e6b4b5d25578afdef81438c73adac015972ce56f59c570034e9 160 bytes 1317 us
# eosio <= eosio::updateauth {"account":"gobipartners","permission":"active","parent":"owner","auth":{"threshold":1,"keys":[{"key...
warning: transaction executed locally, but may not be confirmed by the network yet
2.3.7 變更賬戶的owner_key
cleos set account permission [-x <number>] <轉(zhuǎn)讓賬戶名> owner '{"threshold":1,"keys":[{"key":"<對方公鑰>","weight":1}]}' -p <轉(zhuǎn)讓賬戶名>@owner
參數(shù)說明:
-x <number>:交易超時的時間。不輸入的話默認(rèn)為30秒。
輸出結(jié)果案例:
duncanwang@duncanwang:~$ cleos -u https://node1.eoscannon.io set account permission -x 120 gobipartners owner '{"threshold":1,"keys":[{"key":"EOS7Rq86JcZLgPXwZKRGPYUnLayBy7NcBV7FBE7gSNCW3HmGApK9V","weight":1}]}' -p gobipartners@owner
executed transaction: ed1593fee153baa7b02e1e3e1155e732c3e7db4fbb3fd50ff73b0de1a04d5831 160 bytes 1186 us
# eosio <= eosio::updateauth {"account":"gobipartners","permission":"owner","parent":"","auth":{"threshold":1,"keys":[{"key":"EOS...
warning: transaction executed locally, but may not be confirmed by the network yet
2.4 合約相關(guān)
2.4.1 部署合約
cleos set contract <account> ../<contract> [ -p <account_name>]
or
cleos set contract ../<contract>.wast ../<contract>.abi
參數(shù)說明:
<account>: 賬號名稱;
../<contract>: 合約類的名稱;
-p <account_name>: 表示用account_name例如wangdenghui賬戶的active權(quán)限簽署此操作;
輸出結(jié)果樣例
duncanwang@duncanwang:~/eos/build/contracts/hello$ cleos set contract wangdenghui ../hello -p wangdenghui
Reading WAST/WASM from ../hello/hello.wasm...
Using already assembled WASM...
Publishing contract...
executed transaction: 79830b81c90a22ab42b427ac70ff0c764441d92ea128999712e3376ae6b2460d 4168 bytes 741 us
# eosio <= eosio::setcode {"account":"wangdenghui","vmtype":0,"vmversion":0,"code":"0061736d01000000013b0c60027f7e006000017e60...
# eosio <= eosio::setabi {"account":"wangdenghui","abi":"0e656f73696f3a3a6162692f312e30000102686900010475736572046e616d650100...
warning: transaction executed locally, but may not be confirmed by the network yet
2.4.2 執(zhí)行合約
cleos push action <account> <action> [<data>] -p <account>
參數(shù)說明:
<account> :執(zhí)行合約的賬號,例如wangdenghui;
<action>: 動作函數(shù),例如hi;
<data> :輸入?yún)?shù),例如"World!";
-p <account>:由哪個賬號來執(zhí)行;
輸出結(jié)果樣例:
輸出結(jié)果有>> "Hello World!"
duncanwang@duncanwang:~/eos/build/contracts/hello$ cleos push action wangdenghui hi '["World!"]' -p wangdenghui
executed transaction: d10de21ee792c4997ae697e5db00ad571cfd67c374e9e9fcb741a2a7046c9e49 104 bytes 830 us
# wangdenghui <= wangdenghui::hi {"strContent":"World!"}
>> Hello World!
warning: transaction executed locally, but may not be confirmed by the network yet
2.4.3 查詢合約表信息
cleos [-u <bp_name>]get table <contract> <scope> <table>
參數(shù)說明:
-u <bp_name>: 連接的EOS節(jié)點,不填寫表示本地節(jié)點;
-<contract>:合約名稱,eosio表示擁有這個表的超級用戶;
-<scope>:查詢范圍,"gobipartners"表示查詢該賬號的相關(guān)信息;
-<table>:合同ABI信息約定的表名,例如"userres"表示用戶資源;
輸出案例:
duncanwang@duncanwang:~$ cleos -u https://node1.eoscannon.io get table eosio gobipartners userres
{
"rows": [{
"owner": "gobipartners",
"net_weight": "0.1000 EOS",
"cpu_weight": "0.1000 EOS",
"ram_bytes": 8150
}
],
"more": false
}
2.4 系統(tǒng)相關(guān)
2.4.1 創(chuàng)建系統(tǒng)賬號
cleos -u <bp_name> system newaccount -x 1000 --stake-net '0.0010 EOS' --stake-cpu '0.0010 EOS' --buy-ram-kbytes 8 <映射分配的account_name> <要申請的新賬號名> <EOS公鑰>
參數(shù)說明:
-u <bp_name>: 連接的EOS節(jié)點;
-x 1000: 1000s內(nèi)最長反饋時間;
--stake-net:使用帶寬抵押的EOS;
--stake-cpu:使用CPU抵押的EOS;
--buy-ram-kbytes:購買的內(nèi)存(最低8KB);
<映射分配的account_name>:即第3步記下來的12個字符的賬戶名;
<要申請的新賬號名>:同樣是12個字符,只能使用小寫字母a-z,和數(shù)字1-5;
<EOS公鑰>
【經(jīng)驗】
NET Stake (in EOS): 0.05
CPU Stake (in EOS): 0.1
RAM (in kbytes):8
輸出結(jié)果(創(chuàng)建成功):
duncanwang@duncanwang:~$ cleos -u https://node1.eoscannon.io system newaccount -x 1000 --stake-net "0.1 EOS" --stake-cpu "0.1 EOS" --buy-ram-kbytes 8 wangdenghui1 gobipartners EOS8gaYL4uHyAiZjviwNJ8CdY31xikYtQfexyUfkNUnDqhNpnYXQR EOS8gaYL4uHyAiZjviwNJ8CdY31xikYtQfexyUfkNUnDqhNpnYXQR
1229333ms thread-0 main.cpp:429 create_action ] result: {"binargs":"109c6e6caac4a6e180af9af99aea0e6500200000"} arg: {"code":"eosio","action":"buyrambytes","args":{"payer":"wangdenghui1","receiver":"gobipartners","bytes":8192}}
1229958ms thread-0 main.cpp:429 create_action ] result: {"binargs":"109c6e6caac4a6e180af9af99aea0e65e80300000000000004454f5300000000e80300000000000004454f530000000000"} arg: {"code":"eosio","action":"delegatebw","args":{"from":"wangdenghui1","receiver":"gobipartners","stake_net_quantity":"0.1000 EOS","stake_cpu_quantity":"0.1000 EOS","transfer":false}}
executed transaction: d0c3543b6db8787a151a748ab73d0dec9210442cf7022a442c42fa9fe2a27f3c 336 bytes 5477 us
# eosio <= eosio::newaccount {"creator":"wangdenghui1","name":"gobipartners","owner":{"threshold":1,"keys":[{"key":"EOS8gaYL4uHyA...
# eosio <= eosio::buyrambytes {"payer":"wangdenghui1","receiver":"gobipartners","bytes":8192}
# eosio.token <= eosio.token::transfer {"from":"wangdenghui1","to":"eosio.ram","quantity":"2.9714 EOS","memo":"buy ram"}
# wangdenghui1 <= eosio.token::transfer {"from":"wangdenghui1","to":"eosio.ram","quantity":"2.9714 EOS","memo":"buy ram"}
# eosio.ram <= eosio.token::transfer {"from":"wangdenghui1","to":"eosio.ram","quantity":"2.9714 EOS","memo":"buy ram"}
# eosio.token <= eosio.token::transfer {"from":"wangdenghui1","to":"eosio.ramfee","quantity":"0.0150 EOS","memo":"ram fee"}
# wangdenghui1 <= eosio.token::transfer {"from":"wangdenghui1","to":"eosio.ramfee","quantity":"0.0150 EOS","memo":"ram fee"}
# eosio.ramfee <= eosio.token::transfer {"from":"wangdenghui1","to":"eosio.ramfee","quantity":"0.0150 EOS","memo":"ram fee"}
# eosio <= eosio::delegatebw {"from":"wangdenghui1","receiver":"gobipartners","stake_net_quantity":"0.1000 EOS","stake_cpu_quanti...
# eosio.token <= eosio.token::transfer {"from":"wangdenghui1","to":"eosio.stake","quantity":"0.2000 EOS","memo":"stake bandwidth"}
# wangdenghui1 <= eosio.token::transfer {"from":"wangdenghui1","to":"eosio.stake","quantity":"0.2000 EOS","memo":"stake bandwidth"}
# eosio.stake <= eosio.token::transfer {"from":"wangdenghui1","to":"eosio.stake","quantity":"0.2000 EOS","memo":"stake bandwidth"}
warning: transaction executed locally, but may not be confirmed by the network yet
2.4.2 顯示賬號抵押的帶寬
cleos [-u <bp_name>] system listbw <account>
參數(shù)說明:
-u <bp_name>:節(jié)點名稱;
<account>: 賬號名稱;
輸出結(jié)果樣例(待補(bǔ)充有效的):
cleos -u https://node1.eoscannon.io system listbw gobipartners
2.4.3 查詢短名出價情況
cleos system bidnameinfo <short_name>
參數(shù)說明:
<short_name> : 參與競拍的小于12位的賬號名稱;
輸出結(jié)果案例,表明fenbushi的域名的當(dāng)前競標(biāo)價格為0.0221 EOS。:
duncanwang@duncanwang:~$ cleos -u https://node1.eoscannon.io system bidnameinfo fenbushi
bidname: fenbushi
highest bidder: eosallblue4u
highest bid: 221
last bid time: 2018-07-07T17:05:01.500
2.4.4 參與競拍
cleos system bidname <account_name> <short_name> <quantity>
參數(shù)說明:
<account_name>:競拍用的賬號名稱;
<short_name> :競拍的短賬號名稱;
<quantity>:給出的競拍價;
輸出結(jié)果案例:
每次競拍要有10%以上的漲幅,輝哥本次競拍的標(biāo)價為0.0444個EOS,競拍給價成功。
duncanwang@duncanwang:~$ cleos -u https://node1.eoscannon.io system bidname wangdenghui1 fenbushi '0.0444 EOS'
2574251ms thread-0 main.cpp:429 create_action ] result: {"binargs":"109c6e6caac4a6e1000000ae617da65abc0100000000000004454f5300000000"} arg: {"code":"eosio","action":"bidname","args":{"bidder":"wangdenghui1","newname":"fenbushi","bid":"0.0444 EOS"}}
executed transaction: fbcd8cbea0e7f655ce608f10a615d4a8f04acecb647e9a692b8aac78613a56ef 128 bytes 3587 us
# eosio <= eosio::bidname {"bidder":"wangdenghui1","newname":"fenbushi","bid":"0.0444 EOS"}
# eosio.token <= eosio.token::transfer {"from":"wangdenghui1","to":"eosio.names","quantity":"0.0444 EOS","memo":"bid name fenbushi"}
# wangdenghui1 <= eosio.token::transfer {"from":"wangdenghui1","to":"eosio.names","quantity":"0.0444 EOS","memo":"bid name fenbushi"}
# eosio.names <= eosio.token::transfer {"from":"wangdenghui1","to":"eosio.names","quantity":"0.0444 EOS","memo":"bid name fenbushi"}
# eosio.token <= eosio.token::transfer {"from":"eosio.names","to":"eosallblue4u","quantity":"0.0221 EOS","memo":"refund bid on name fenbush...
# eosio.names <= eosio.token::transfer {"from":"eosio.names","to":"eosallblue4u","quantity":"0.0221 EOS","memo":"refund bid on name fenbush...
# eosallblue4u <= eosio.token::transfer {"from":"eosio.names","to":"eosallblue4u","quantity":"0.0221 EOS","memo":"refund bid on name fenbush...
warning: transaction executed locally, but may not be confirmed by the network yet
2.4.5 列出所有BP
cleos [-u <bp_name>] system listproducers
輸出結(jié)果案例(待補(bǔ)充)
2.4.5 購買RAM
cleos [-u <bp_name>] system buyram <payer> <receiver> <quantity>
參數(shù)說明:
<payer>:支付RAM的賬號
<receiver> : 收益的賬號;
<quantity>:購買數(shù)量,"1 EOS"表示1個EOS。
輸出結(jié)果案例(待補(bǔ)充)
cleos -u https://eos.greymass.com system buyram 主賬號 子帳號 "1 EOS"
2.4.6 賣出RAM
cleos [-u <bp_name>] system sellram <account> <quantity>
參數(shù)說明:
<account>:支付RAM的賬號
<quantity>:RAM字節(jié)數(shù)
輸出結(jié)果案例(待補(bǔ)充)
cleos -u https://eos.greymass.com system sellram 賣出帳號 RAM字節(jié)數(shù)
2.4.7 抵押net和cpu資源
cleos [-u <bp_name>] system delegatebw <from> <receiver> <stake_net_quantity> <stake_cpu_quantity>
參數(shù)說明:
<from>:抵押扣除EOS的賬號;
<receiver> :抵押收益的賬號,就是獲得帶寬和CPU資源的賬號;
stake_net_quantity:獲取帶寬的EOS抵押數(shù)量,例如"1 EOS"
stake_cpu_quantity:獲取CPU的EOS抵押數(shù)量,例如"1 EOS"
輸出結(jié)果案例(待補(bǔ)充)
cleos -u https://eos.greymass.com system delegatebw 主賬號 子帳號 "1 EOS" "1 EOS"
2.4.8 取消抵押net和cpu資源
cleos [-u <bp_name>] system undelegatebw <from> <receiver> <unstake_net_quantity> <unstake_cpu_quantity>
參數(shù)說明:
<from>:取消抵押的賬號;
<receiver> :取消抵押收益的賬號,就是獲得EOS的賬號;
unstake_net_quantity:取消抵押帶寬獲取的EOS的數(shù)量;
unstake_cpu_quantity: 取消抵押CPU獲取的EOS的數(shù)量;
輸出結(jié)果案例(待補(bǔ)充)
cleos -u https://eos.greymass.com system undelegatebw 主賬號 子帳號 "1 EOS" "1 EOS"
3. Cleos命令框架
更多的命令和說明請參考官網(wǎng)幫助文檔。

大的功能模塊說明:
1、version:獲取版本信息
2、create:在EOS區(qū)塊鏈上或鏈下本地創(chuàng)建一些東西
3、get:從EOS區(qū)塊鏈上獲取各種數(shù)據(jù)和信息
4、set:設(shè)置或者更新區(qū)塊鏈狀態(tài)
5、transfer:在EOS賬戶之間進(jìn)行轉(zhuǎn)賬
6、net:管理或查詢本地p2p網(wǎng)絡(luò)連接狀態(tài)
7、wallet:管理本地錢包
8、sign:對交易進(jìn)行簽名
9、push:把任意交易發(fā)送至區(qū)塊鏈
10、multisig:多重簽名功能
11、sudo:通過超級賬戶eosio.sudo執(zhí)行命令,可越過權(quán)限驗證,目前該超級賬戶還未創(chuàng)建
12、system:向區(qū)塊鏈發(fā)送系統(tǒng)合約內(nèi)置的相關(guān)動作
4,參考
1) cleos快速命令查詢
2)官網(wǎng)命令參考