ref:
http://blog.csdn.net/lhtzbj12/article/details/79405238
https://www.cnblogs.com/jackluo/p/8513880.html
>docker pull ethereum/client-go
>cd docker_ethereum/
>[root@mo-cn-491 docker_ethereum]# ls
data start_ethereum.sh
start-ethereum.sh的内容如下
docker stop ethereum-node
docker rm ethereum-node
docker run -d --name ethereum-node -v /home/jka07@int.hrs.com/hrs_doc/docker_ethereum/data:/root \
-p 8545:8545 -p 30303:30303 \
ethereum/client-go
docker exec -it ethereum-node /bin/sh
我们根据官方的文档 创建 genesis.json文件里面写入
{
"config": {
"chainId": 12, //这里不能为0,否则转账时报错
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},
"alloc" : {},
"coinbase" : "0x0000000000000000000000000000000000000000",
"difficulty" : "0x20000",
"extraData" : "",
"gasLimit" : "0x2fefd8",
"nonce" : "0x0000000000000042",
"mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"timestamp" : "0x00"
}
>./start-ethereum.sh
/ # cd /root/
~ # ls
genesis.json
#geth --datadir data0 init genesis.json
#ls
data0 genesis.json
#geth --networkid 12 --identity "TestNode" --rpc --rpcport "8545" --datadir data0 --port "3033" --nodiscover console
>eth.accounts
>personal.newAccount('123456')
>personal.newAccount('123456')
> personal.unlockAccount(eth.coinbase)
>us1=eth.accounts[0]
>us2=eth.accounts[1]
>eth.sendTransaction({from:us1,to:us2,value:web3.toWei(3,"ether")})
>eth.getBalance(us1)