查看linux 系统版本
head -n 1 /etc/issue
按照官网使用对应系统版本安装 cleos
https://developers.eos.io/eosio-home/docs/setting-up-your-environment
直接指定主网节点IP:PORT即可连上主网
cleos -u https://node1.eosphere.io get info
"chain_id": "aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906", 主网
"chain_id": "038f4b0fc8ff18a4f0842a8f0564611f6e96e8535901dd45e43ac8691a1c4dca", 测试网
出现以下为成功
{
"server_version": "ced8d7db",
"chain_id": "aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906", 主网
"head_block_num": 37511270,
"last_irreversible_block_num": 37510944,
"last_irreversible_block_id": "023c5f20284c924337a735022be54c382729b88b55e02639cb9834b796bc301d",
"head_block_id": "023c6066c3d1f689683cad1dd46c2c84e69463640c4b1b24e9adf8cdfce3c17f",
"head_block_time": "2019-01-15T05:50:36.500",
"head_block_producer": "cochainworld",
"virtual_block_cpu_limit": 200000000,
"virtual_block_net_limit": 1048576000,
"block_cpu_limit": 150448,
"block_net_limit": 1042680
}
安装CDT
Ubuntu(Debian)
wget https://github.com/EOSIO/eosio.cdt/releases/download/v1.4.1/eosio.cdt-1.4.1.x86_64.deb
sudo apt install ./eosio.cdt-1.4.1.x86_64.deb
获取合同来源
git clone https://github.com/EOSIO/eosio.contracts --branch v1.4.0 --single-branch
cd eosio.contracts/eosio.token
编译合约
eosio-cpp -I include -o eosio.token.wasm src/eosio.token.cpp --abigen
合约帐号替换
abc1234
创建钱包
cleos wallet create -n abc1234 --file abc1234.txt
在txt文件里面有密码
XXXXX
导入eos账户 (保证该账户拥有200kb的内存)
↓↓↓↓↓(私钥)↓↓↓↓↓
cleos wallet import -n abc1234 --private-key XXXXX
解锁钱包
cleos wallet unlock -n abc1234 --password XXXXX
部署合约
cleos -u https://node1.eosphere.io set contract abc1234 /data/coins/eos/eosio.contracts/eosio.token
创建代币
cleos -u https://node1.eosphere.io push action abc1234 create '[ "abc1234", "1000000000.0000 ABC"]' -p abc1234
发放代币
cleos -u https://node1.eosphere.io push action abc1234 issue '["abc1234", "1000000000.0000 ABC", "memo"]' -p abc1234
announce zoo material number property patient symbol reason town float mind refuse
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓cleos 命令 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
cleos wallet list
其中带 *代表未锁定的钱包
cleos wallet unlock
1.7 查看钱包的公钥
cleos wallet keys
1.8 查看钱包的私钥
cleos wallet private_keys
1.11 锁定所有钱包
cleos wallet lock_all