Geth官方
- https://geth.ethereum.org/
- https://geth.ethereum.org/downloads/
- https://ethereum.github.io/go-ethereum/downloads/
Geth命令行环境
| 命令 | 说明 |
|---|---|
| init | 引导和初始化一个新的创始区块 |
| account | 管理账户 |
| console | 启动交互式JavaScript环境 |
| attach | 启动交互式JavaScript环境(连接到节点) |
| version | 打印版本号 |
| help | 显示一个命令列表或某个指定命令的帮助 |
创世纪区块配置(即0号块),通过init命令初始化
格式:init [command options] [arguments…]
geth --datadir D:\ethereum\data init genesis.json
genesis.json
{
"config": {
"chainId": 100,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},
"alloc" : {},
"coinbase" : "0x0000000000000000000000000000000000000000",
"difficulty" : "0x800",
"extraData" : "",
"gasLimit" : "0x8000000",
"nonce" : "0x0000000000000042",
"mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"timestamp" : "0x00"
}
通过网络编号networkid启动Geth并进入命令行环境
geth --datadir D:\ethereum\data --networkid 100 console
geth --datadir D:\ethereum\data --maxpeers 100 --networkid 100 console




