FiberGuard
On the consensus layer (eth2) network, we offer direct peering connections to our nodes. As a result, your connected beacon node will receive blocks over the P2P connection as soon as our network sees them. This can result in a significant latency decrease compared to the standard P2P network: anywhere from 500ms to 2 seconds. For more information about FiberGuard, check out this section in the use cases.
Requirements
We assume that you've signed up for the FiberGuard plan and we have your ENR registered in our system.
To get this information about your node, you can query the following endpoint: http://<beacon_node_api>/eth/v1/node/identity
.
Fiber Multiaddress
Once you've signed up for the plan, you will have received the multiaddress of
one of our nodes based on your location. A multiaddress looks like this: /ip4/151.150.191.80/tcp/9000/p2p/16Ui...aXRz
. This
multiaddress encodes the network information (IP address and TCP port), as well as the P2P peer ID (16Ui...aXRz
).
Static Peer ID
Ideally, you have configured your node with a static peer ID so we don't have to go through the process of registering your information every time you restart your beacon node. Instructions on how to do that for the major consensus clients can be found below:
- Lighthouse
- Prysm
- Teku
- Nimbus
Enabled by default.
Add the following CLI option to the startup command:
--p2p-static-id
Enabled by default.
Specify a file that contains a private key using the following option:
--netkey-file <path/to/file.json>
Setting Up
For ensuring the most reliable connection, your beacon node should add the Fiber peer as a static and trusted peer. Static means the connection will always be retried on failure. Trusted means the peer is safe from any peer scoring systems or pruning routines. Below we outline how to do this for the different consensus clients:
- Lighthouse
- Prysm
- Teku
- Nimbus
Lighthouse requires 2 options to be set. Static multiaddress:
--libp2p-addresses <MULTIADDR>
Trusted peer:
--trusted-peers <PEER_ID>
With Prysm, you can add a trusted, static peer with the following flag:
--peer <MULTIADDR>
Teku provides multiple ways to add a static, trusted peer: https://docs.teku.consensys.net/development/reference/cli#p2p-static-peers.
The easiest way is to add the following CLI flag to the startup command:
--p2p-static-peers=<MULTIADDR>
With Nimbus, you can add a trusted, static peer with the following flag:
--direct-peer <MULTIADDR>
Checking the Connection
If everything went well, your beacon node should now be connected to our Fiber node. You can check the connection status by querying the beacon API (usually on port 5052).
For example:
curl localhost:5052/eth/v1/node/peers/<PEER_ID>
where <PEER_ID>
is the peer ID of the Fiber node.
The response should indicate a connected
state like in the example response below:
{
"data": {
"peer_id": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N",
"enr": "enr:-IS4QHCYrYZbAKWCBRlAy5zzaDZXJBGkcnh4MHcBFZntXNFrdvJjX04jRzjzCBOonrkTfj499SZuOh8R33Ls8RRcy5wBgmlkgnY0gmlwhH8AAAGJc2VjcDI1NmsxoQPKY0yuDUmstAHYpMa2_oxVtw0RW_QAdpzBQA8yWM0xOIN1ZHCCdl8",
"last_seen_p2p_address": "/ip4/7.7.7.7/tcp/4242/p2p/QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N",
"state": "connected",
"direction": "outbound"
}
}