Home

How do I add peers to monerod?

You can add peers to monerod, the program that runs your Monero node, with the --add-peer or --add-priority-node startup options. For a connection you want your node to keep trying to maintain, use --add-priority-node; then restart monerod with that setting.

Add a peer when you start monerod

A peer is another Monero node that exchanges blocks and transactions with yours. You need its address and its P2P port, the network connection number it uses to talk to other nodes.

For Monero’s main network, the default P2P port is 18080. A node operator can choose a different port, so check the address they provide.

To add a peer:

monerod --add-peer NODE_ADDRESS:18080

Replace NODE_ADDRESS with the node’s actual IP address or hostname. Keep any other startup options you already use.

To make it a priority connection instead:

monerod --add-priority-node NODE_ADDRESS:18080

You can repeat the option for several peers:

monerod --add-priority-node NODE_A:18080 --add-priority-node NODE_B:18080

These are startup options, not commands to type into the console of an already-running daemon.

Save peers in your configuration file

If you want the setting to survive future restarts, add it to the configuration file your node loads. Configuration entries use the option name without the leading --:

add-priority-node=NODE_A:18080
add-priority-node=NODE_B:18080

Use add-peer= instead if you only want ordinary peer entries.

If you start your node manually, you can explicitly select the file:

monerod --config-file /path/to/monerod.conf

If your node runs as a background service, check which configuration file that service actually uses. Editing another file will have no effect. Restart the service after saving your changes; you do not need to download the blockchain again.

Choose the right peer option

These options serve different purposes:

  • --add-peer adds an address to your node’s peer list. It does not guarantee a permanent connection.
  • --add-priority-node tells your node to try to maintain a connection to that address. Automatic connections to other peers remain available.
  • --add-exclusive-node restricts outgoing peer connections to the specified nodes instead of the normal automatic selection.

For most home nodes, priority peers are the better choice when automatic discovery needs a helping hand. Avoid exclusive peers unless you deliberately want a restricted setup. If your chosen nodes go offline, your node may lose access to fresh blocks.

Priority does not mean “trusted.” Your node still checks the blocks it receives.

Check that the connection works

In an interactive monerod console, enter:

print_cn

This lists current connections. Use:

status

to check your node’s overall synchronization state.

If the peer does not appear, check its address, port, availability, and your outbound firewall rules. Adding a peer does not require opening an inbound port on your router.

Do not confuse P2P with RPC, the interface used by wallets and other software to request information from your node. Main-network RPC commonly uses port 18081; that is not the peer port. P2Pool’s own peer connections are separate, too.

The bottom line

Use --add-priority-node ADDRESS:PORT for a peer you want monerod to keep reconnecting to. Save it in the configuration file your node actually loads, restart, and check print_cn to confirm the connection.

All 1,000 questions

MyAiMiner.com

MyAiMiner.com — Monero mining blog. 1,000 questions. Clear answers.

Monero (XMR) Mining BLOG

Hashes0
Blocks accepted0
Blocks rejected0
Runtime00:00:00