- Platform : Ethereum
- Client : Go-Ethereum (Geth) version 1.10.3-stable https://geth.ethereum.org/downloads/
- Architecture : amd64
- Go Version : go1.16.3
- OS : linux
- Consensus Model : Clique proof-of-authority
- Nodes : 1 bootnode, 1 sealer node, 1 peer
- Network name
- Chain Id, refer to [https://chainlist.org/]
- Other Geth CLI options including http port, http address http cors domain, ipc, bootnodes etc
Below listed the steps need to be taken to correctly configure the setup
-
Create 3 directories for different nodes (bootnode, sealer, and peer)
- Chaindata will go under the subdirectory 'data' (only for node1 and node2)
-
Create accounts:
- geth --datadir ./node1/data account new
- geth --datadir ./node2/data account new
-
Run the puppeth tool to generate the genesis.json file
-
Initialize node1 and node2
cd node1 && geth --datadir ./data init ../genesis.json cd node2 && geth --datadir ./data init ../genesis.json
-
Setup bootnode
- Generate a node key
bootnode -genkey boot.key
- Start using private key filename
bootnode -nodekey "./boot.key"
After run second command, take note the enode echoed. It looks something like this "enode://83cab5439021f0dcad5a12faa2c628c212bc072d78d2ebf5dd80c3cdd0d625f262bbac924492f5e0c0ce1140fdbfc569dfa5893615e386395bca2f61f551b722@127.0.0.1:0?discport=30301"
-
Launch the node1 and node2 including the enode value of the bootnode created. Example of command template is as follows
geth --networkid <> --mine --datadir "./data" --port <> --ipcdisable --syncmode full --http --http.corsdomain "*" --http.port <> --unlock <<public address of node1 without "0x">> --password <<password filename (e.g: password.txt)>> --bootnodes '<>' console
To reuse this setup and configure from the very start, feel free to clean the following folders
- node1\data\geth
- node1\data\keystore
- node2\data\geth
- node2\data\keystore
- bootnode\boot.key
- privnw-harmony.json
- privnw.json
- node1\password.txt
- node2\password.txt
- node1\launch.sh
- node2\launch.sh