There is no --chain
option for geth
. You can build geth
and start it at private blockchain, as follows:
Install go
Clone go-ethereum
project by git clone https://github.com/ethereum/go-ethereum.git
- Rebuild all commands by
make all
. For example geth
- Test whether everything is ok.
./build/bin/geth --datadir=./dev/data0 --networkid 2 console
. At first you should create directory ./dev/data0
to save chain data. If Ok, now you have entered geth console on private blockchain.
If you want to use genesis.json
custom some properties, as follows:
1: create a simple genesis.json
file
{
"config": {
"chainId": 10,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},
"difficulty": "0x400",
"gasLimit": "2100000",
"alloc": {
"e2e7f3b19889d7a3ada2afaf80b6e4e2b2f8fd35": { "balance": "30000000000000000000000" }
}
}
2: then execute geth init
command:
build/bin/geth --rpc --rpcport "8080" --rpccorsdomain "*" --datadir "./dev/data0" --port "30303" --nodiscover --rpcapi "db,eth,net,web3"
--networkid 1 init ./dev/genesis.json
Hope it helps~