[root@bogon config]# cleos --help
文本信息
Command Line Interface to EOSIO Client
Usage: cleos [OPTIONS] SUBCOMMANDOptions:-h,--help Print this help message and exit 獲取幫助信息-u,--url TEXT=http://127.0.0.1:8888/the http/https URL where nodeos is running--wallet-url TEXT=unix:///root/eosio-wallet/keosd.sockthe 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--no-auto-keosd don't automatically launch a keosd if one is not currently running-v,--verbose output verbose actions on error //輸出冗長的錯誤信息--print-request print HTTP request to STDERR //向標準輸出打印http請求--print-response print HTTP response to STDERR //向標準輸出打印http響應Subcommands:version Retrieve version information //檢索版本信息create Create various items, on and off the blockchain //創(chuàng)建,啟動和關閉鏈上的各種項目convert Pack and unpack transactions //打包和解壓交易get Retrieve various items and information from the blockchainset Set or update blockchain statetransfer Transfer EOS from account to accountnet Interact with local p2p network connectionswallet Interact with local walletsign Sign a transactionpush Push arbitrary transactions to the blockchainmultisig Multisig contract commandswrap Wrap contract commandssystem Send eosio.system contract action to the blockchain.
[root@bogon config]# cleos version client
Build version: 59626f1e
a. create:創(chuàng)建賬戶和密鑰對
[root@bogon config]# cleos create
輸出:
Subcommands:key Create a new keypair and print the public and private keys//創(chuàng)建新的密鑰對和打印公鑰和私鑰account Create a new account on the blockchain (assumes system contract does not restrict RAM usage)//創(chuàng)建區(qū)塊鏈上的賬戶(假定系統(tǒng)合約不限制RAM使用)
1.創(chuàng)建密鑰對
Cleos create key -h
Options:-h,--help Print this help message and exit--r1 Generate a key using the R1 curve (iPhone), instead of the K1 curve (Bitcoin)-f,--file TEXT Name of file to write private/public key output to. (Must be set, unless "--to-console" is passed //將密鑰對生成輸出到文件中--to-console Print private/public keys to console. //在控制臺上顯示
[root@bogon config]# cleos create account eosio bob EOS4uUhxvwm1DdDETv2g8NFgVRCZWzChAcciC4ek2tLuu6oBLDbtw
輸出:
b.convert
[root@bogon config]# cleos convert
Subcommands:pack_transaction From plain signed json to packed formunpack_transaction From packed to plain signed json formpack_action_data From json action data to packed formunpack_action_data From packed to json action data form
輸出:
c.**get:**重要的,用與從區(qū)塊中獲取信息。
[root@bogon config]# cleos get
Subcommands:info Get current blockchain information //獲得當前區(qū)塊的信息block Retrieve a full block from the blockchain //獲得指定區(qū)塊的信息account Retrieve an account from the blockchain //j檢索區(qū)塊鏈中的一個賬戶code Retrieve the code and ABI for an accountabi Retrieve the ABI for an accounttable Retrieve the contents of a database tablescope Retrieve a list of scopes and tables owned by a contractcurrency Retrieve information related to standard currenciesaccounts Retrieve accounts associated with a public keyservants Retrieve accounts which are servants of a given account transaction Retrieve a transaction from the blockchainactions Retrieve all actions with specific account name referenced in authorization or receiverschedule Retrieve the producer scheduletransaction_id Get transaction id given transaction object
測試: 1.
[root@bogon config]# cleos get info
{"server_version": "59626f1e","chain_id": "cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f","head_block_num": 10187,"last_irreversible_block_num": 10186,"last_irreversible_block_id": "000027cadb2dbda86aa16637bc55b775f6f6dda46efb0cfb42198f2bf44498d5","head_block_id": "000027cb90c5b9a60aae26dd83c4a256a2e31fdb9f95f9249f6476f83bcd40d1","head_block_time": "2018-12-08T18:14:54.500","head_block_producer": "eosio","virtual_block_cpu_limit": 200000000,"virtual_block_net_limit": 1048576000,"block_cpu_limit": 199900,"block_net_limit": 1048576,"server_version_string": "v1.4.4-dirty"
}
[root@bogon config]# cleos get block
Positionals:block TEXT The number or ID of the block to retrieve (required) //指定區(qū)塊的ID號Options:--header-state Get block header state from fork database instead//獲取區(qū)塊的頭部狀態(tài)
輸出:
block TEXT 指的是 head_block_num,頭部區(qū)塊編號
[root@bogon config]# cleos get block 10187
輸出:
[root@bogon config]# cleos get account
Usage: cleos get account [OPTIONS] name [core-symbol]Positionals:name TEXT The name of the account to retrieve (required)//檢索賬戶的名字core-symbol TEXT The expected core symbol of the chain you are queryingOptions:-j,--json Output in JSON format //以json格式輸出
[root@bogon config]# cleos get account bob