cleos

cleosnode

一、在.bashrc中加入如下代碼,方便直接使用 cleos,7777是nodeos端口,5555是keosd端口。docker

alias cleos='docker exec -it eosio /opt/eosio/bin/cleos --url http://127.0.0.1:7777 --wallet-url http://127.0.0.1:5555'

二、進入bash的命令bash

docker exec -it eosio bash

三、建立錢包須要 --file 或 --to-console 命令ide

cleos wallet create --to-console

  cleos wallet create 的選項有三個:區塊鏈

  

  能夠看到,若是沒有 -n 調協錢包名,則使用 default做爲錢包名。flex

  能夠注意到,用戶並不經過 keosd 來操做錢包,而是經過 cleos wallet 命令來操做錢包。ui

四、全部的wallet命令:this

  

  解鎖錢包時,須要輸入錢包密鑰,密鑰由前文create的時候產生。以下:url

  

  注意上圖 list 命令的解釋,若是一個錢包被鎖,則後面會有一個*號。list只能列出全部已打開的錢包,未打開的錢包不會顯示 。以下:spa

  

五、What is an account?

  An account is 1)a collection of authorizations, 2)stored on the blockchain, and 3)used to identify a sender/recipient.

   帳戶是權限的集合,存儲於區塊鏈上,用於標識 一個發送者、接收者。

  It has a flexible authorization structure that enables it to be owned either by an individual or group of individuals depending on how permissions have been configured.

  帳戶有彈性的受權結構,能夠被我的或集體擁有,取決於配置了什麼樣的permission。

  An account is required to send or receive a valid transaction to the blockchain

六、eosio development key

  Every new EOSIO chain has a default "system" user called "eosio".

  This account is used to set up the chain by loading system contracts that dictate the governance and consensus of the EOSIO chain. Every new EOSIO chain comes with a development key, and this key is the same. On a production chain, the eosio user is forfeited once the chain is set up.

  eosio 用戶會自動銷燬。

  Load this key to sign transactions on behalf of the system user (eosio).

  下面的Key,就是 eosio 的 DevelopmentKey.

cleos wallet import

//You'll be prompted for a private key, enter the eosio development key provided below
5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3

 七、建立account

cleos create account eosio bob EOS5fwGUnXRktjjj1zbofG5VwhjuaN15cVqVystmAV3Aw5bbLowcU 
cleos create account eosio alice EOS5fwGUnXRktjjj1zbofG5VwhjuaN15cVqVystmAV3Aw5bbLowcU

  上面account後面三個參數的意思是:

  

 將會看到以下的輸出 :

executed transaction: 40c605006de...  200 bytes  153 us
#         eosio <= eosio::newaccount            {"creator":"eosio","name":"alice","owner":{"threshold":1,"keys":[{"key":"EOS5rti4LTL53xptjgQBXv9HxyU...
warning: transaction executed locally, but may not be confirmed by the network yet    ]

 八、EOS中的帳戶的概念.

  https://mp.weixin.qq.com/s/K6ClE1TDfH2hB7lbXOZUJA

九、

參考:

一、https://developers.eos.io/eosio-home/docs/getting-the-software

二、https://developers.eos.io/eosio-home/docs/wallets

三、https://developers.eos.io/eosio-home/docs/accounts-1

四、https://mp.weixin.qq.com/s/K6ClE1TDfH2hB7lbXOZUJA

相關文章
相關標籤/搜索