Detailed explanation of EOS commands

cleos command analysis

Check client version

cleos version client

 

wallet

create wallet

cleos wallet create -n fish1208 --to-console

 

open wallet

cleos wallet open

 

unlock wallet

cleos wallet unlock -n fish1208 --password PW5KiK9GU2TVo2TpA9Ragpzygj8s54AiCxBi2gDVzgUzWZCxbHZsS

 

lock wallet

cleos wallet lock -n fish1208

 

lock all wallets

cleos wallet lock_all

 

Import the private key into the wallet

cleos wallet import -n fish1208 --private-key 5JZEmy65HqCu1iobB98hA7ca1NYzRtK28gqWyonC25cUA54EmJS

 

View wallet list

cleos wallet list

 

Check the private key import status

cleos wallet keys

 

stop

cleos wallet stop

 

create

create key

cleos create key --to-console

 

create user account

cleos create account eosio fish EOS8jdARRTMt1gFkKJwccdCPnkXJDi2b3sJSQuY3Db7whEBhFaF2X EOS8jdARRTMt1gFkKJwccdCPnkXJDi2b3sJSQuY3Db7whEBhFaF2X

 

get

getting information

cleos get info

 

Get block information

cleos get block 128

 

Get account information

cleos get account fish

 

get code

cleos get code fish

 

If the contract is deployed, the code hash will change

 

Get the abi corresponding to the account

cleos get abi fish

get action

cleos get actions fish -j

 

Get account list

cleos get accounts EOS7ZcTmKesEKSjTXv4txEMSVvQoQNar9RNSQSQZ2namYg5qMkD9P

Use the public key to query the account list of its "jurisdiction"

 

get balance

cleos get currency balance eosio.token fish EOS

eosio.token is the account to deploy the eosio.token contract

fish common account

 

set

set contract

cleos set contract fish hello -p fish

 

token

Create eosio.token account

cleos create account eosio eosio.token EOS7ZcTmKesEKSjTXv4txEMSVvQoQNar9RNSQSQZ2namYg5qMkD9P EOS7ZcTmKesEKSjTXv4txEMSVvQoQNar9RNSQSQZ2namYg5qMkD9P

executed transaction: 2b6f62a00fbf2f139fb233e08bfe26448d1eb05b1b3b9543aa1abb3d80c6a37b  200 bytes  239 us

#         eosio <= eosio::newaccount            {"creator":"eosio","name":"eosio.token","owner":{"threshold":1,"keys":[{"key":"EOS7ZcTmKesEKSjTXv4tx...

warning: transaction executed locally, but may not be confirmed by the network yet    ]

 

compile wast

eosiocpp -o eosio.token.wast eosio.token.cpp

 

Deploy the eosio.token smart contract

cleos set contract eosio.token eosio.token -p eosio.token

 

Create EOS Tokens

cleos push action eosio.token create '[ "eosio", "1000000000.0000 EOS", 0, 0, 0]' -p eosio.token

executed transaction: 140e133e61b65ded514b9d0a39bf206d159c668da210d0dd12e524f138df067c  120 bytes  425 us

# eosio.token <= eosio.token::create {"issuer":"eosio","maximum_supply":"1000000000.0000 EOS"}

warning: transaction executed locally, but may not be confirmed by the network yet    ]

 

Token distribution

cleos push action eosio.token issue '["fish","100.0000 EOS", "发给fish账户100个EOS"]' -p eosio

executed transaction: dfac1bfb8504f34403f977db7600140113cfc3587a89661c1ba0d25c86dd6810  144 bytes  1311 us

# eosio.token <= eosio.token::issue {"to":"fish","quantity":"100.0000 EOS","memo":"Send 100 EOS to fish account"}

#   eosio.token <= eosio.token::transfer        {"from":"eosio","to":"fish","quantity":"100.0000 EOS","memo":"发给fish账户100个EOS"}

#         eosio <= eosio.token::transfer        {"from":"eosio","to":"fish","quantity":"100.0000 EOS","memo":"发给fish账户100个EOS"}

#          fish <= eosio.token::transfer        {"from":"eosio","to":"fish","quantity":"100.0000 EOS","memo":"发给fish账户100个EOS"}

warning: transaction executed locally, but may not be confirmed by the network yet    ]

 

Query fish account balance

cleos get currency balance eosio.token fish EOS

eosio.token is the account to deploy the eosio.token contract

fish common account

 

token transaction

First create a testuer account

cleos create account eosio testuer EOS7ZcTmKesEKSjTXv4txEMSVvQoQNar9RNSQSQZ2namYg5qMkD9P EOS7ZcTmKesEKSjTXv4txEMSVvQoQNar9RNSQSQZ2namYg5qMkD9P

 

Transfer 25 tokens to the testuser account

cleos push action eosio.token transfer '["fish","testuer","25.0000 EOS", "fish转25个testuer"]' -p fish

executed transaction: fd4761bf4ae71a5fefd853a0e8b29f561ef9caf70179e60a3c72c9480be0378a  144 bytes  723 us

#   eosio.token <= eosio.token::transfer        {"from":"fish","to":"testuer","quantity":"25.0000 EOS","memo":"fish转25个testuer"}

#          fish <= eosio.token::transfer        {"from":"fish","to":"testuer","quantity":"25.0000 EOS","memo":"fish转25个testuer"}

#       testuer <= eosio.token::transfer        {"from":"fish","to":"testuer","quantity":"25.0000 EOS","memo":"fish转25个testuer"}

warning: transaction executed locally, but may not be confirmed by the network yet    ]

Check fish and testuer account balance

 

reference:

https://mymonero.com/

https://blog.csdn.net/qq1169091731/article/details/79946032

https://blog.csdn.net/caokun_8341/article/details/80713851

https://eosfans.io/wiki/smart-contracts

https://www.cnblogs.com/paluano/p/cleos.html

https://eosfans.io/topics/435

 

Guess you like

Origin blog.csdn.net/yuch_hong/article/details/107378012