Skip to main content

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.

tip

Further details about connectivity can be found on the Peer Networks and Peer Connectivity pages of the 🧠 Theory section.

info

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.

The execution endpoint allows to fetch the peer counts and lots of other client-specific intormation.

JSON RPC

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.

tip

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
CommandDescription
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
warning

If the command couldn't be executed, have a look at the Problem Scanning page to learn how to attach execution clients.

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.

cd <lukso-working-directory>
lukso stop
info

Exchange <lukso-working-directory> with the path of the node folder.

Force Client Shutdown
sudo pkill geth

3. Node IP Setup

Once you retrieve your current public IP, you can configure your clients to advertise this IP address.

IP Addresses

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.

IP Changes

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.

note

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.

Open the configuration file using your preferred text editor.

cd <lukso-working-directory>/configs/<network>/prysm/
vim prysm.yaml
info

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.

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>'
info

Exchange <your-current-ip-address> with the public IP address of your node.

warning

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.

cd <lukso-working-directory>
lukso start --checkpoint-sync
info

Exchange <lukso-working-directory> with the path of the node folder.

After the clients were started, verify that their services are still up.

sudo lukso status
tip

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.