启动etth私网


1、geth的官方下载地址:https://geth.ethereum.org/downloads/,开发者需要安装geth,geth&tools。

2、geth --help验证geth效果。

3、配置创世块文件,genesis.json文件如下




{
  "config": {
  "chainId": 10086,
  "homesteadBlock": 0,
  "eip150Block": 0,
  "eip155Block": 0,
  "eip158Block": 0,
  "byzantiumBlock": 0,
  "constantinopleBlock": 0,
  "petersburgBlock": 0
  },
    "alloc": {},
    "coinbase": "0x0000000000000000000000000000000000000000",
    "difficulty": "0x20000",
    "extraData": "",
    "gasLimit": "0xfffffffff",
    "nonce": "0x0000000000000042",
    "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "timestamp": "0x00"
}

 

在文件目录的控制台输入 

geth init genesis.json --datadir ./data

通过tree命令查看data目录下生成的文件,tree data

 启动节点

geth --datadir ./data init ./genesis.json

 目前最新的运行命令:geth --http --http.api personal,eth,net,web3



旧的运行命令:geth --datadir ./data --networkid 18 --port 30303 --rpc --rpcport 8545 --rpcapi 'db,net,eth,web3,personal' --rpccorsdomain '*' --gasprice 0 --allow-insecure-unlock

目前节点可以通过链接测试网或者docker来搭建。一般的ethereum stido和conflix stido编译器由黑曜石实验室开发的还是很方便的