How does a stellar-core node discover its peers?

I mean both on startup and on the go.

1 Answer 1


After startup, your node should have established connection with your indicated peers. On the go, there's not much to do with after startup. The nodes just exchange data and run consensus algorithm.

In stellar-core.config, there are several fields related to peers discovery (refer to example config here).

  1. NETWORK_PASSPHRASE="Public Global Stellar Network ; September 2015"

No one can join a network without knowing the "NETWORK_PASSPHRASE". This is like the name of the organization/network that you would like to join.

If you want to set up a private network, you will keep your NETWORK_PASSPHRASE as a secret. Without knowing this secret, random guys cannot discover your private network.

  1. KNOWN_PEERS=[www.myIP.com]

Suppose you are not in the network yet. You need some existing, running peers to pull you into the organization/network. Put an IP at "KNOWN_PEERS".

The IP/web address of the intended peer is like the location of your friend, which allows you to find him.

If you are already in the network and wants to pull somebody else in, let them add your IP under KNOWN_PEERS.

  1. PEER_PORT=11625

An IP address has many ports, just like a park can have many entrance gates. So, you also need to know which gate your friend is at.

11625 is the default value for peer port. If your peer changed its peer port, you will need to suggest a value for this field.

Without matching both the IP and peer port number, a peer cannot be discovered.

The above are the most basic ones for startup. For simplicity, complicated settings were not mentioned.

  • So the list of peers is a manually maintained list?
    – Murukan
    Jul 6, 2018 at 12:40
  • yes... and the node holder can decide on which nodes to trust... but you may change it when the node is running
    – cesarm
    Jul 8, 2018 at 15:26
  • Isn't PEER_PORT for your code node? This says The port other instances of stellar-core can connect to you on. Sep 26, 2018 at 8:32
  • no, the list is not manually maintained: KNOWN_PEERS is to bootstrap the list of known peers, after that more peers are received when connecting to other peers. stellar.stackexchange.com/questions/231/… gives an idea of how it works. Oct 4, 2018 at 22:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.