【cleos】
1、在.bashrc中加入以下代码,方便直接使用 cleos,7777是nodeos端口,5555是keosd端口。
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'
2、进入bash的命令
docker exec -it eosio bash
3、创建钱包需要 --file 或 --to-console 命令
cleos wallet create --to-console
cleos wallet create 的选项有三个:
可以看到,如果没有 -n 调协钱包名,则使用 default作为钱包名。
可以注意到,用户并不通过 keosd 来操作钱包,而是通过 cleos wallet 命令来操作钱包。
4、所有的wallet命令:
解锁钱包时,需要输入钱包密钥,密钥由前文create的时候产生。如下:
注意上图 list 命令的解释,如果一个钱包被锁,则后面会有一个*号。list
只能列出所有已打开的钱包,未打开的钱包不会显示 。如下:
5、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
6、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
7、创建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 ]
8、EOS中的账户的概念.
https://mp.weixin.qq.com/s/K6ClE1TDfH2hB7lbXOZUJA
9、
参考:
1、https://developers.eos.io/eosio-home/docs/getting-the-software
2、https://developers.eos.io/eosio-home/docs/wallets
3、https://developers.eos.io/eosio-home/docs/accounts-1
4、https://mp.weixin.qq.com/s/K6ClE1TDfH2hB7lbXOZUJA