7.4 Public IP Setup
To ensure your node is discoverable and can establish a healthy number of peer connections, you may need to manually set or update your node’s public IP address. This is particularly important for validators, where lower peer counts are an obsticle for accurate block proposals and attestations.
Further details about connectivity can be found on the Peer Networks and Peer Connectivity pages of the 🧠 Theory section.
The following steps are performed on your 📟 node server.
1. Check Peer Connections
To get insights into the current connections, you can check the peer connections from your local node. Every node operates two independent peer-to-peer networks: the execution and the consensus layer. Each of these networks handles communication with other nodes differently and maintains separate sets of peers. Monitoring both layers is essential to ensure healthy connectivity and network participation.
- Execution Peers
- Consensus Peers
The execution endpoint allows to fetch the peer counts and lots of other client-specific intormation.
JSON-RPC is a lightweight communication protocol encoded in JSON, allowing calls to be sent to a service or server. Each execution client exposes a related interface at port 8545
to retreive calls to interact with the Ethereum network though the local node.
By default, the LUKSO Network Configuration allows to retrieve network data for all execution clients.
1.1 Install Querying Tool: Install the JSON query service for data processing from the RPC endpoint.
sudo apt install jq
1.2 Call Execution Endpoint: While the node is running, call the JSON RPC of the execution client.
# Retrieve Execution Peers
curl -s -X POST -H "content-type: application/json" \
--data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":1}' \
http://localhost:8545 | jq -r '.result' | xargs printf '%d\n'
Full Command Explanation
Command | Description |
---|---|
curl -s -X POST -H <text> --data <text> <port> | Executes -X a silent -s HTTP POST request to the given <port> , while attaching custom header -H and --data content as <text> payload. |
jq -r '.result' | Filters the raw -r JSON object and extracts the .result value of the data object. |
xargs printf '%d\n' | Converts the hexadecimal result to a human-readable decimal %d number. |
The output should be something in the range from 5 to 50 peers.
37
If the command couldn't be executed, have a look at the Problem Scanning page to learn how to attach execution clients.
The consensus endpoint allows to fetch the peer counts and lots of other client-specific intormation.
A REST API is a web-based interface for querying structured data. Ethereum consensus clients expose their status and internal metrics on various ports like 3500
, 5051
, or 5052
, to allow users to access information such as synchronization progress, network stability, node metadata, or the current chain head.
By default, the LUKSO Network Configuration opens the REST API ports for all consensus clients.
1.1 Install Querying Tool: Install the JSON query service for data processing from the REST API endpoint.
sudo apt install jq
1.2 Call Endpoints: While the node is running, call the REST endpoint of the consensus client.
- Teku
- Prysm
- Lighthouse and Nimbus-Eth2
# Check Number of Consensus Peers
curl -s http://localhost:5051/eth/v1/node/peer_count | jq
# Check Number of Consensus Peers
curl -s http://localhost:3500/eth/v1/node/peer_count | jq
# Check Number of Consensus Peers
curl -s http://localhost:5052/eth/v1/node/peer_count | jq
The output should be something in the range from 5 to 70 peers.
59
If you have low or volatile peer counts, continue to stop the node and configure your public IP address.
2. Stop Node Operation
Depending on your setup method, there are different ways to stop your node before configuring the IP or raising the peer limits.
- LUKSO CLI
- Service Automation
cd <lukso-working-directory>
lukso stop
Exchange <lukso-working-directory>
with the path of the node folder.
sudo systemctl stop lukso-validator
Force Client Shutdown
- Geth
- Erigon
- Nethermind
- Besu
- Teku
- Nimbus-Eth2
- Lighthouse
- Prysm
sudo pkill geth
sudo pkill erigon
sudo pkill nethermind
sudo pkill besu
sudo pkill teku
sudo pkill nimbus_beacon_node
sudo pkill nimbus_validator_client
sudo pkill lighthouse
The Lighthouse client uses a single binary for both the consensus and validator processes.
sudo pkill prysm
sudo pkill validator
3. Node IP Setup
Once you retrieve your current public IP, you can configure your clients to advertise this IP address.
Internet Protocol addresses are logical, software‑assigned identifiers. IP addresses let routers move data packages between different networks, whether your local home network or across the Internet. The public IP address is how device and nodes communicate with each other to exchange data.
There are two types of public IP addresses: dynamic and static ones. An active IP address changes over time, while a static IP address remains constant. Most residential users are assigned a dynamic IP address, which can change whenever the internet service provider sees fit. Some ISPs may change the IP address every time the router is rebooted, while others change it at intervals, like once a week. If you want to further set a permanent connection, you can follow the Dynamic DNS guide.
The LUKSO CLI allows to set the current IP during installation, but need to be updated on a regular basis.
We can use a simple IP echo service to retrieve the node's current IP address and write it to an editor or notepad.
curl -s https://ipecho.net/plain
Depending on your consensus client, this public IP can be set with different properties.
- Prysm
- Teku
- Lighthouse
- Nimbus-Eth2
Open the configuration file using your preferred text editor.
- Vim
- Nano
cd <lukso-working-directory>/configs/<network>/prysm/
vim prysm.yaml
cd <lukso-working-directory>/configs/<network>/prysm/
nano prysm.yaml
Open the configuration file using your preferred text editor.
- Vim
- Nano
cd <lukso-working-directory>/configs/<network>/teku/
vim teku.yaml
cd <lukso-working-directory>/configs/<network>/teku/
nano teku.yaml
Open the configuration file using your preferred text editor.
- Vim
- Nano
cd <lukso-working-directory>/configs/<network>/lighthouse/
vim lighthouse.toml
cd <lukso-working-directory>/configs/<network>/lighthouse/
nano lighthouse.toml
Open the configuration file using your preferred text editor.
- Vim
- Nano
cd <lukso-working-directory>/configs/<network>/nimbus2/
vim nimbus.toml
cd <lukso-working-directory>/configs/<network>/nimbus2/
nano nimbus.toml
The following properties need to be exchanged:
<lukso-working-directory>
with the path to the node folder.<network>
with the name of your node's network.
Add or update the following client properties, then save and exit the file.
- Prysm
- Teku
- Lighthouse
- Nimbus
Update or add the p2p-host-ip property at the end of the file.
# Previous Value Examples
p2p-host-ip: '0.0.0.0'
p2p-host-ip: '<your-previous-ip>'
# Updated Value
p2p-host-ip: '<your-current-ip-address>'
Update or add the p2p-advertised-ip property.
# Previous Value Examples
p2p-advertised-ip: 0.0.0.0
p2p-advertised-ip: <your-previous-ip>
# Updated Value
p2p-advertised-ip: <your-current-ip-address>
Update the enr-address property.
# Previous Value Examples
enr-address = "0.0.0.0"
enr-address = "<your-previous-ip>"
# Updated Value
enr-address = "<your-current-ip-address>"
Update or add the extip and enr-auto-update properties at the end of the file.
# Previous Value Examples
nat = "extip:0.0.0.0"
nat = "extip:<your-previous-ip>"
# Updated Value
nat = "extip:<your-current-ip-address>"
enr-auto-update = true
By adding the enr-auto-update
property, the Nimbus-Eth2 client automatically detects and updates your public IP address upon changes, meaning you dont have to set up a dynamic DNS to permanently stay connected with the network.
Exchange <your-current-ip-address>
with the public IP address of your node.
Ensure there are no missing spaces, characters or unintended linebreaks before saving the configuration file.
5. Restart the Node
Depending on your setup method, there are different ways to start your node after the IP address or peer limits have changed.
- LUKSO CLI Node
- LUKSO CLI Validator
- Service Automation
cd <lukso-working-directory>
lukso start --checkpoint-sync
Exchange <lukso-working-directory>
with the path of the node folder.
cd <lukso-working-directory>
lukso start --validator --transaction-fee-recipient "<your-fee-recipient-address>" --checkpoint-sync
The following properties need to be exchanged:
<lukso-working-directory>
with the path of the node folder<your-fee-recipient-address>
with the wallet address receiving staking profits
sudo systemctl start lukso-validator
After the clients were started, verify that their services are still up.
sudo lukso status
You should always have more than 15 peers after a setup time of 4 to 6 hours. If your peer count is not improving, it indicates a misconfiguration. Check that all mandatory client ports allow data throughput as described within the Firewall Settings.