A wallet can store several keys that can be used to sign transactions. Wallets are protected by a password. Creating the wallet and the keys can be done with your machine offline.
cleos wallet create --name myWallet
Result:
Save password to use in the future to unlock this wallet.
Without password imported keys will not be retrievable.
"PW5JZgCiodBwxgcQEsgYNWLnbo8dhUaiCS9mYC5V4tdGjsXEK8xGp"
cleos create key
Result:
Private key: 5JBbSQpNVQtFt1a3KfJ2EJFGXbr949r2WHFemBsPZckawtEm9yY
Public key: EOS8Pv725YDMJhjJ93iWfEbH1zQUFE66fSqYC8GSqTvPNtGfFbmNG
cleos wallet import 5JBbSQpNVQtFt1a3KfJ2EJFGXbr949r2WHFemBsPZckawtEm9yY --name myWallet
cleos wallet lock_all
or
cleos wallet lock --name myWallet
cleos wallet unlock --name myWallet
Password: [paste/type wallet password from step 1]
cleos --url https://mainnet.eoscanada.com get account AccountName
An account can have several permissions. A permission has a key pair. By default these permissions are:
active: used for signing transaction and create other permissions (standard permission)owner: same, but also allows to change the keys for all permissions, including owner itself (like a superuser)cleos --url https://mainnet.eoscanada.com create account --stake-net “1 EOS” --stake-cpu “1 EOS” --buy-ram-kbytes 8 OldAccount NewAccount OwnerPublicKey ActivePublicKey
Alternatively, you can use the same key for both permissions:
cleos --url https://mainnet.eoscanada.com create account --stake-net “1 EOS” --stake-cpu “1 EOS” --buy-ram-kbytes 8 OldAccount NewAccount OwnerAndActivePublicKey
cleos --url https://mainnet.eoscanada.com transfer FromAccount ToAccount “1 EOS”
Unstake 1 EOS for network and 2 EOS for CPU from AccountToUnstake using a FromAccount that has some stake. FromAccount will receive the EOS. AccountToUstake and FromAccount can be the same.
cleos --url https://mainnet.eoscanada.com system undelegatebw FromAccount AccountToUnstake "1 EOS" "2 EOS"