The IOTA network is a distributed network. It uses a gossip protocol to broadcast data among nodes. To participate in a network, each node has to establish a secure connection to other nodes in the network (to its peer neighbors), and mutually exchange messages.
Each node can be uniquely identified by a
Peer identity (also called
PeerId) is represented by a public
and private key pair.
PeerId is a cryptographic hash of a peer's public key, the
PeerId represents a verifiable link between the given peer and its public key.
It enables individual peers to establish a secure communication channel as the hash can be used to verify an identity of the peer.
When HORNET is started for the first time, it will automatically generate a
PeerId and save the identity's private key in the
HORNET will keep the generated identity between subsequent restarts.
Each time HORNET starts, the
PeerId is written to stdout:
2022-07-19T13:27:18+02:00 INFO P2P peer configured, ID: 12D3KooWF4B2jdZbSZFX1Z9PPKp2YQs58Hh2WfnoMKYx7yuzVx53
PeerId is an essential part of your
multiaddr used to configure neighbors. For example,
12D3KooWHiPg9gzmy1cbTFAUekyLHQKQKvsKmhzB7NJ5xnhK4WKq corresponds to your
PeerId is also visible on the start page of the dashboard.
You can find more information on the
PeerId in the libp2p docs page.
Addressing Peer Neighbors
To communicate to your peer neighborsDirectly connected network nodes that can exchange messages without intermediary nodes., you will need an address to reach them. For that, HORNET uses the
MultiAddresses format (also known as
multiaddr is a convention on how to encode multiple layers of addressing information into a single path structure that is future-proof.
multiaddr combines several pieces of information in a single human-readable and machine-optimized string, including network protocol and
For example, a node is reachable using IPv4
TCP on port
15600 and its
multiaddr encoding of this information would look like this:
ip4 is used. A common mistake is to use
If a node is reachable using a DNS name (for example
node01.iota.org), then the given
multiaddr would be:
You will need to find out your own
multiaddr to give to your peers for neighboring. To do so, combine the
peerId you received
from the stdout when the HORNET node started up, and your configured
/dns/<hostname> segments with the actual information.
You can find more information about
multiaddr at the libp2p docs page.
Adding Node Peers
Once you know your node's own
multiaddr, it can be exchanged with other node owners to establish a mutual peer connection.
We recommended several peer neighbors between 4-6 to get some degree of redundancy.
You can join the official IOTA Discord server and the
There, you will be able to describe your node location (Europe, Asia, etc.), with your allocated high watermark resources and ask for neighbors.
Do not publicly disclose your node
multiaddr to all readers but wait for an individual direct chat.
You can add peers using the HORNET dashboard.
To do so, go to Peers and click on Add Peer. You can also add peers on the
peering.json example, with
HORNET also supports automatic discovery of peers through the autopeeringA mechanism enabling nodes to select their neighbors automatically, without the node operator's manual intervention. module. To minimize service distribution in case your autopeered peers are flaky, we recommend you only use autopeering if you have at least four static peers.
Autopeering is disabled by default. If you want to enable it, set the
"p2p.autopeering.enabled" value to
See the configuration reference for more information.
The autopeering plugin will disclose your public IP address to possibly all nodes and entry points. Do not enable this plugin if you do not want this to happen!
Your node will use the specified entry nodes under
p2p.autopeering.entryNodes to find new peers.
entryNodes are also encoded as
/autopeering portion defines the base58 encoded Ed25519 public key.
By default, HORNET will peer up to four autopeered peers and initiate a gossip protocol with them.
If you want to run your own node as an autopeering entry node, you should enable
The base58 encoded public key is in the output of the
p2pidentity-gen HORNET tool.
Alternatively, if you already have an identity in a
p2pstore, you can use the
p2pidentity-extract HORNET tool to extract it.
p2p.connectionManager.lowWatermark configuration options define "watermark" points.
Watermark points can be considered like a filling basin where if the
highWatermark is reached, water will be drained until it reaches the
Similarly, the connection manager within HORNET will start trimming away connections to peers if
highWatermark peers are connected until it reaches
lowWatermark count of peers.
These watermarks exist for a certain buffer number of peers to be connected, which will not necessarily be targeted by the gossip protocol.