Erigon - Lodestar

Pre-requisites: git, go Clone and build from source develop branch of Erigon

Execution layer conclusions

After starting the client, you will be able to interact with the client using the following ports:

  • localhost:8545: Web3 json rpc

  • localhost:8550: Engine json rpc

  • localhost:8551: Engine json rpc with json rpc authentication

  • jwt.hex in the repository where you ran the rpcdaemon: verification key for JWT authentication

Build Erigon Execution Layer

git clone https://github.com/ledgerwatch/erigon
cd erigon
make erigon rpcdaemon
cd ..
# Initialize database
./erigon/build/bin/erigon init \
--datadir=erigon-datadir genesis.json

# Run Erigon
./erigon/build/bin/erigon \
--datadir erigon-datadir  \
--externalcl \
--networkid=1881 \
--authrpc.jwtsecret=/tmp/jwtsecret \
--http --http.api=engine,net,eth \
--bootnodes="TAKE IT FROM THE CARTENZ TESTNET REPOSITORY" 

Before running the Node, we use the POSIX Nohup (No Hang UP) command which means (Do Not Close) a command in Linux systems that keeps the process running even after exiting the shell or terminal. Nohup prevents the process or job from receiving the SIGHUP (Signal Hang UP) signal. This is the signal sent to the process after closing or exiting the terminal.

Running Consensus Layer

nohup lodestar beacon \
--suggestedFeeRecipient "YOUR ADDRESS HERE" \
--execution.urls "http://127.0.0.1:8551" \
--jwt-secret /path/your/folder/jwt.hex \
--dataDir "/path/your/folder/data-2" \
--paramsFile "/path/your/folder/consensus/config.yaml" \
--genesisStateFile "/path/your/folder/consensus/genesis.ssz" \
--enr.ip 172.31.22.244 \
--rest.port 9599 \
--port 9001 \
--network.connectToDiscv5Bootnodes true \
--logLevel info \
> /path/your/folder/logs/beacon_1.log &

Getting ENR Key

curl http://localhost:5052/eth/v1/node/identity | jq 

Example Output: 
{
  "data": {
    "peer_id": "16Uiu2HAmGLNCWcsWgVR6Q2YvmGvGyyaEM3y5Tcq2rjmpv4dqo8JJ",
    "enr": "enr:-L24QCeN4AtWKWQfWMl9ubWXj_rWzxmVLG54qJtNQuXfEd9xPjPHrafoC3iyt_NUf4RNyiGaA-5yumvmSitnsd_Cx4SBiodhdHRuZXRziP__________hGV0aDKQWOqKlwJndzn__________4JpZIJ2NIJpcITUL_GtiXNlY3AyNTZrMaEDNqlqq2_MsiLqswykyIsqFIX10A-1COt29ZTpmlxf9teIc3luY25ldHMPg3RjcIIjKIN1ZHCCIyg",
    "p2p_addresses": [
      "/ip4/212.47.241.173/tcp/9000/p2p/16Uiu2HAmGLNCWcsWgVR6Q2YvmGvGyyaEM3y5Tcq2rjmpv4dqo8JJ"
    ],
    "discovery_addresses": [
      "/ip4/212.47.241.173/udp/9000/p2p/16Uiu2HAmGLNCWcsWgVR6Q2YvmGvGyyaEM3y5Tcq2rjmpv4dqo8JJ"
    ],
    "metadata": {
      "seq_number": "205",
      "attnets": "0xffffffffffffffff",
      "syncnets": "0x0f"
    }
  }
}

# SAVE YOUR ENR KEY!

Running Second Consensus Layer

nohup lodestar beacon \
--suggestedFeeRecipient "YOUR ADDRESS HERE" \
--execution.urls "http://127.0.0.1:8551" \
--jwt-secret /path/your/folder/jwt.hex \
--dataDir "/home/ubuntu/cartenz/data-2" \
--paramsFile "/home/ubuntu/cartenz/consensus/config.yaml" \
--genesisStateFile "/home/ubuntu/cartenz/consensus/genesis.ssz" \
--enr.ip 172.31.22.244 \
--rest.port 9599 \
--port 9001 \
--network.connectToDiscv5Bootnodes true \
--logLevel info \
--bootnodes="ADD YOUR ENR HERE AND ADDING MORE FROM THE CARTENZ TESTNET REPOSITORY" \
> /home/ubuntu/cartenz/logs/beacon_2.log &

Building a Staker To Be Good Validator

Visit the Staking Website and Select Deposit and Make a Deposit with Command:

// Example From Deposit 

deposit new-mnemonic --num_validators 200 --eth1_withdrawal_address 0x9adddA86C9479C45bD145BBa9FC28146FdF46C83

# Example Output Mnemonic: 
"vibrant refuse observe flag shy depth disagree proud race angle vote picnic fancy renew museum bonus arena people thumb there atom tuna abstract negative"

Running Validator Node

nohup lodestar validator \
--dataDir  "/path/your/folder/validator" \
--beaconNodes "http://127.0.0.1:9596" \
--suggestedFeeRecipient "YOUR ADDRESS HERE" \
--graffiti "YOUR UNIQUE GRAFFITI HERE" \
--paramsFile "/path/your/folder/consensus/config.yaml" \
--importKeystores "/path/your/folder/validator_keys" \
--importKeystoresPassword "/path/your/folder/validator_keys/password.txt" \
--logLevel info \
> /path/your/folder/logs/validator_1.log &

How long does it take to sync a node?

48-72 hours this cannot be an actual reference time. The sync process is very long and can take up to 48-72 hours. Sync speed depends on your internet speed and storage device write speed. Because data is stored in blocks and linked together, corruption in a single block can corrupt the entire data chain

Last updated