CoreGeth currently supports a handful of networks out of the box, and can readily be configured to support others.
This guide will show you how to add a network to CoreGeth.
For the context of this tutorial, I’m going to use AlphaBeta Coin as the name of my new network. - AlphaBeta Coin (ABC) will use Proof-of-Work for block issuance, namely ETHash. (Just like Ethereum.) - AlphaBeta Coin will have some arbitrary pre-mine funds allocated to a single address. - AlphaBeta Coin will have the “Istanbul” (aka “ETC’s Phoenix”) protocol upgrades and EVM features activated from genesis (the very first block (number 0)).
Initialize geth with this configuration (using a custom data directory).
1 2 3 4 5 6 7 8 91011121314
./build/bin/geth --datadir=./abc-datadir init abc_genesis.json
INFO [03-10|09:00:25.710] Maximum peer count ETH=50 LES=0 total=50
INFO [03-10|09:00:25.710] Smartcard socket not found, disabling err="stat /run/pcscd/pcscd.comm: no such file or directory"
INFO [03-10|09:00:25.711] Set global gas cap cap=25000000
INFO [03-10|09:00:25.711] Allocated cache and file handles database=/home/ia/go/src/github.com/ethereum/go-ethereum/abc-datadir/geth/chaindata cache=16.00MiB handles=16
INFO [03-10|09:00:25.728] Writing custom genesis block
INFO [03-10|09:00:25.729] Persisted trie from memory database nodes=1 size=139.00B time="178.942µs" gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [03-10|09:00:25.729] Wrote custom genesis block OK config="NetworkID: 4269, ChainID: 4269 Engine: ethash EIP1014: 0 EIP1052: 0 EIP1108: 0 EIP1344: 0 EIP140: 0 EIP145: 0 EIP150: 0 EIP152: 0 EIP155: 0 EIP160: 0 EIP161abc: 0 EIP161d: 0 EIP170: 0 EIP1884: 0 EIP198: 0 EIP2028: 0 EIP211: 0 EIP212: 0 EIP213: 0 EIP214: 0 EIP2200: 0 EIP2: 0 EIP658: 0 EIP7: 0 EthashECIP1041: 0 EthashEIP100B: 0 EthashHomestead: 0 "
INFO [03-10|09:00:25.730] Successfully wrote genesis state database=chaindata hash="5f32ce…1fe582"
INFO [03-10|09:00:25.730] Allocated cache and file handles database=/home/ia/go/src/github.com/ethereum/go-ethereum/abc-datadir/geth/lightchaindata cache=16.00MiB handles=16
INFO [03-10|09:00:25.746] Writing custom genesis block
INFO [03-10|09:00:25.747] Persisted trie from memory database nodes=1 size=139.00B time="91.084µs" gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [03-10|09:00:25.748] Wrote custom genesis block OK config="NetworkID: 4269, ChainID: 4269 Engine: ethash EIP1014: 0 EIP1052: 0 EIP1108: 0 EIP1344: 0 EIP140: 0 EIP145: 0 EIP150: 0 EIP152: 0 EIP155: 0 EIP160: 0 EIP161abc: 0 EIP161d: 0 EIP170: 0 EIP1884: 0 EIP198: 0 EIP2028: 0 EIP211: 0 EIP212: 0 EIP213: 0 EIP214: 0 EIP2200: 0 EIP2: 0 EIP658: 0 EIP7: 0 EthashECIP1041: 0 EthashEIP100B: 0 EthashHomestead: 0 "
INFO [03-10|09:00:25.749] Successfully wrote genesis state database=lightchaindata hash="5f32ce…1fe582"
Start geth, reusing our initialized database. Since geth won’t have default bootnodes for this configuration (only available when using CLI flags), we’ll need to use geth’s --bootnodes flag.
In order to establish your network, you’ll want to make sure you have a bootnode available that new nodes coming online can use to query for their peers.
This (enode://5256dcfe7725a98f38cf15b702847fabcaf59bbaa733a6ae5ea68e1089fdd1d274192e17593dc20df00a45ea91372f7c1ca97c8d186fa9e779167240fde15338@75.134.144.252:30303) will be the bootnode enode value for the other nodes.