eos搭建步骤:
1.下载源码
git clone https://github.com/EOSIO/eos --recursive
2.进入sctipt目录
cd ./eos/script
3.自动编译
./eosio_build.sh
编译过程可能会出现多次失败的情况,出现下面画面表示编译成功
4.部署合约
1)启动服务
cd /mnt/eos/build/bin
1.0 启动keosd
keosd &
1.1 启动nodeos
nodeos -e -p eosio \ --plugin eosio::producer_plugin \ --plugin eosio::chain_api_plugin \ --plugin eosio::http_plugin \ --access-control-allow-origin='*' \ --contracts-console \ --http-validate-host=false \ --verbose-http-errors >> nodeos.log 2>&1 &
1.2 查看日志
tail -f nodeos.log
1.3 查看钱包
cleos wallet list
1.4 查看 Nodeos endpoints
curl http://localhost:8888/v1/chain/get_info
2)钱包
2.0 创建钱包
cleos wallet create --to-console
2.1 打开钱包
cleos wallet open
2.2 查看钱包
cleos wallet list
2.3 解锁钱包
cleos wallet unlock
cleos wallet list
2.4 Import keys into your wallet(导入私钥)
2.4.1 生成私钥(一次生成两对)
cleos wallet create_key
cleos wallet create_key
2.4.2 导入eosio私钥
./cleos wallet import -n "default" --private-key 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3
3) 部署合约
3.1 创建合约管理账号eosio
./cleos create account eosio eosio.token EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV
2.2 部署合约
./cleos set contract eosio.token /mnt/eos/build/unittests/contracts/eosio.token --abi eosio.token.abi -p eosio.token@active
2.3 发行代币
./cleos push action eosio.token create '[ "eosio", "1000000000.0000 EOSU"]' -p eosio.token@active
2.4 分发代币
2.4.1 创建账户(创建两个账户,以方便用来测试相互转账)
./cleos create account eosio jackson EOS5q28Ynbv6P4DJkHouWX8sVLtasSSfxm668dbygkR94VMjTDQu1
./cleos create account eosio alice EOS8FoHEzxW5RqWUFR93q67J5oR5Y8kR9qU3ybWTDhVVR1i7kBXkL
2.4.2 分发代币
./cleos push action eosio.token issue '[ "alice", "100.0000 EOSU", "memo" ]' -p eosio@active
./cleos push action eosio.token issue '[ "jackson", "100.0000 EOSU", "memo" ]' -p eosio@active
2.4.3 转账
./cleos push action eosio.token transfer '[ "alice", "jackson", "25.0000 EOSU", "m" ]' -p alice@active
2.4.4 查询余额
./cleos get currency balance eosio.token jackson EOSU
./cleos get currency balance eosio.token alice EOSU
至此,eos本地测试节点网络搭建完毕