Creating the Genesis JSON File
For each network, the genesis.json file is as follows:
emission genesis.json
{
"config": {
"chainId": 5555,
"homesteadBlock": 0,
"eip150Block": 0,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"clique": {
"period": 15,
"epoch": 30000
}
},
"nonce": "0x0",
"timestamp": "0x65852297",
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000420784628828c485950fd9a3594682b394fe4b280000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0x1C9C380",
"difficulty": "0x1",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"alloc": {
"420784628828c485950fd9a3594682b394fe4b28": {
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
}
},
"number": "0x0",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"baseFeePerGas": null
}
neutral genesis.json
{
"config": {
"chainId": 5555,
"homesteadBlock": 0,
"eip150Block": 0,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"clique": {
"period": 15,
"epoch": 30000
}
},
"nonce": "0x0",
"timestamp": "0x65852297",
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000ea9c97bda3f40ef86e90c84dc05554b661fbbafee4E7714903967388770A39746e9A6e8C744E5f890000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0x1C9C380",
"difficulty": "0x1",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"alloc": {
"ea9c97bda3f40ef86e90c84dc05554b661fbbafe": {
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
}
},
"number": "0x0",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"baseFeePerGas": null
}
offset genesis.json
{
"config": {
"chainId": 5555,
"homesteadBlock": 0,
"eip150Block": 0,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"clique": {
"period": 15,
"epoch": 30000
}
},
"nonce": "0x0",
"timestamp": "0x65852297",
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000232a028cc31da413a024ac579f4fe18c653c289f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0x1C9C380",
"difficulty": "0x1",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"alloc": {
"232a028cc31da413a024ac579f4fe18c653c289f": {
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
}
},
"number": "0x0",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"baseFeePerGas": null
}
Network Initialization
Now, to initialize the network, create a Docker Compose file as follows:
docker-compose-geth-init.yml
version: '3'services: init: image: ethereum/client-go command: init /root/.ethereum/genesis.json volumes: - ./node:/root/.ethereum
After creating the file, run the following command to execute it:
$ docker-compose -f docker-compose-geth-init.yml up
Running this command will create the geth
directory, where the genesis block and initial network configuration will be stored.
Running Geth
Now, to run Geth, create a Docker Compose file as follows. Enter your previously created wallet address in the --unlock
and --miner.etherbase
options:
docker-compose.yml
version: '3.8'services: node: image: ethereum/client-go:v1.13.11 container_name: node command: --datadir="/root/.ethereum" --syncmode="full" --gcmode="archive" --port=30303 --http --http.addr="0.0.0.0" --http.port=8501 --http.corsdomain="*" --http.api="personal,miner,eth,net,txpool,debug,clique" --http.vhosts="*" --ws --ws.addr="0.0.0.0" --ws.port=8502 --ws.api="personal,miner,eth,net,txpool,debug,clique" --networkid=5555 --verbosity=5 --unlock="88bA2E9BC988506C3F588493EdC53Acaf52a9Faf" --password=/root/.ethereum/password --miner.gasprice=0 --miner.etherbase="88bA2E9BC988506C3F588493EdC53Acaf52a9Faf" --allow-insecure-unlock --nodiscover --mine volumes: - ./node:/root/.ethereum:rw ports: - '30303:30303' - '8501:8501' - '8502:8502' networks: - gesia-networknetworks: gesia-network: driver: bridge
After creating the file, run the following command to execute it:
Once you have completed this step, the node installation should be successfully completed.
Last updated