环境准备
搭建以太坊链
详细可参考之前博客:以太坊学习笔记(一)
1、创建创世块文件
{
"config": {
"chainId": 10001,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},
"alloc" : {
},
"coinbase" : "0x0000000000000000000000000000000000000000",
"difficulty" : "0x20000",
"extraData" : "",
"gasLimit" : "0x2fefd8",
"nonce" : "0x0000000000000042",
"mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"timestamp" : "0x00"
}
2、启动节点
//节点1
mkdir node1
geth init --datadir node1 genesis.json
//启动节点
geth --datadir node1 --port 30312 --rpc --rpcaddr 127.0.0.1 --rpcport 8541 --networkid 10001 console
//控制台查看
> admin