【EOS】cleos命令

eos文檔

version

// 檢索客戶端的版本信息
$ ./cleos version client

convert

打包和解包transactionjson

  • pack_transaction
  • unpack_transaction
  • pack_action_data
  • unpack_action_data

create

create key
建立密鑰對網絡

$ ./cleos create key -f myKey.txt
$ ./cleos create key --to-console

create account
在區塊鏈上建立新的帳戶
若是加載了系統合約(例如生產網絡),則使用cleos system newaccount代替ide

Positionals:
  creator TEXT                The name of the account creating the new account
  name TEXT                   The name of the new account
  OwnerKey TEXT               The owner public key for the new account
  ActiveKey TEXT              The active public key for the new account

Options:
  -x,--expiration             set the time in seconds before a transaction expires, defaults to 30s
  -f,--force-unique           force the transaction to be unique. this will consume extra bandwidth and remove any protections against accidently issuing the same transaction multiple times
  -s,--skip-sign              Specify if unlocked wallet keys should be used to sign transaction
  -d,--dont-broadcast         don't broadcast transaction to the network (just print to stdout)
  -p,--permission TEXT ...    An account and permission level to authorize, as in 'account@permission' (defaults to 'creator@active')
$ ./cleos create account inita tester EOS4toFS3YXEQCkuuw1aqDLrtHim86Gz9u3hBdcBw5KNPZcursVHq EOS7d9A3uLe6As66jzN8j44TXJUqJSK3bFjjEEqR4oTvNAB3iM9SA

get

從區塊鏈檢索各類項目和信息。區塊鏈

// 簡單地返回當前的區塊鏈狀態信息。
$ ./cleos get info

$ ./cleos get block 1

$ cleos get account eosio --json

$ cleos get code eosio.token

$ cleos get table eosio eosio namebids --key-type i64 --index 2 -r -l 1

$ cleos get currency balance eosio.token eosio SYS
$ cleos get currency stats eosio.token SYS

// 檢索與已定義公鑰關聯的全部賬戶。
$ cleos get accounts EOS8mUftJXepGzdQ2TaCduNuSPAfXJHf22uex4u41ab1EVv9EAhWt

// 返回此帳號建立的帳號
$ cleos get servants eosio

$ ./cleos get transaction eb4b94b72718a369af09eb2e7885b3f494dd1d8a20278a6634611d5edd76b703

// 檢索範圍內引用特定賬戶名稱的全部操做。
$ ./cleos get actions eosio.token

set

設置或者更新區塊鏈狀態ui

$ ./cleos set contract currency ../../../contracts/currency/currency.wast ../../../contracts/currency/currency.abi

transfer

$ ./cleos transfer useraaaaaaaa useraaaaaaac "1.0000 SYS" "hello world"
$ ./cleos transfer useraaaaaaaa useraaaaaaac -c eosio.token "1.0000 SYS" "hello world"

net

$ cleos net connect http://somehost.com:1234
$ cleos net disconnect http://somehost.com:1234
$ cleos net status http://somepeer:1234
$ cleos net peers

wallet

# 建立帳戶,默認建立default
$ ./cleos wallet create --to-console
$ ./cleos wallet create -n second-wallet --to-console
$ ./cleos wallet create --name my-new-wallet --file my-new-wallet.txt

# 默認打開default,有open沒有close
$ ./cleos wallet open
$ ./cleos wallet open -n second-wallet

$ ./cleos wallet lock
$ ./cleos wallet lock -n second-wallet

$ ./cleos wallet lock_all

$ ./cleos wallet unlock -n second-wallet --password PW5Ji6JUrLjhKAVn68nmacLxwhvtqUAV18J7iycZppsPKeoGGgBEw

$ ./cleos wallet import 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3

# Lists opened wallets
$ ./cleos wallet list

# 全部解鎖錢包的公鑰列表。這些鍵能夠用來簽署transaction。
$ ./cleos wallet keys

# 在錢包中建立一個密鑰對,這樣您就不須要像使用cleos建立密鑰那樣手動導入它了。默認狀況下,這將建立錢包的密鑰是K1密鑰。可是這個命令也容許您建立R1格式的鍵。
$ cleos wallet create_key K1

# 能夠查詢單個錢包的公鑰對和私鑰對。錢包必須已經打開,你必須再次輸入密碼。
$ cleos wallet private_keys K1
相關文章
相關標籤/搜索