1. 安装eosio.cdt
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
sudo apt remove eosio.cdt
2. 编译合约
eosio-cpp test.cpp -o test.wasm --abigen
3. 创建钱包
cleos wallet create --to-console
Creating wallet: default
Save password to use in the future to unlock this wallet.
Without password imported keys will not be retrievable.
"PW5H......"
4. 导入私钥进钱包
a. eosio(EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV=KEY:5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3)
root@163be9123bc2:/work# cleos wallet import
private key: imported private key for: EOS7gaWGNfUHpECQ2SyyhoMJD7gBPcPezFLWH9SghV9LjwUn8byzC
b. 测试账号
root@163be9123bc2:/work# cleos wallet import
private key: imported private key for: EOS6MRyAj.......
5. 创建账号
root@163be9123bc2:/work# cleos create account eosio kylin1111111 EOS7gaW...... EOS7gaWGNf......
executed transaction: 98d04e953cc2b26b5b8741d63a839e1f07e88ce110826697c7453f82ee8b63dc 200 bytes 200 us
# eosio <= eosio::newaccount {"creator":"eosio","name":"kylin1111111","owner":{"threshold":1,"keys": [{"key":"EOS7gaWGNfUHpECQ2Syy
warning: transaction executed locally, but may not be confirmed by the network yet ]
6. 部署合约
root@163be9123bc2:/work# cleos set contract kylin1111111 ./test -p kylin1111111
Reading WASM from ./test/test.wasm...
Publishing contract...
executed transaction: 854b1ea4336a01bc9bb6cc3a0d2631c9419b967a1bab5db5663468bca3ecc633 5376 bytes 32954 us
# eosio <= eosio::setcode {"account