Add Your Gateway as a Trusted Peer to Your Execution Layer Client

To ensure your gateway and your node stay connected, you must add the gateway to your node's list of trusted peers.

Adding your gateway enode to your node's console

The bloXroute Gateway connects to your blockchain node as a peer. In some situations, your node might reach the limit of peers it can connect to. At this point, the node will start rejecting certain connections. To ensure the connection to the gateway is not rejected, you should set the gateway as a trusted peer by suppling the gateway enode to the node.

In order to persist your enode it is recommended to specify private key using the --private-key gateway startup argument.

You have few options:

  1. Call http JSON-RPC. curl -H 'Content-Type: application/json' -d '{"method": "admin_addTrustedPeer", "params": ["enode://GATEWAY_PUBLIC_KEY"]}' http://localhost:8545. This does not persist after a node restart.

  2. Using geth JavaScript console to call JSON-RPC. Run geth attach and then type admin.addTrustedPeer("enode://GATEWAY_PUBLIC_KEY"). This does not persist after a node restart.

  3. Recommended: edit the geth config file and add the gateway to TrustedNodes in the [Node.P2P] section. You can generate a config file that matches your current configuration by running geth dumpconfig.

[Node.P2P]
...
TrustedNodes=["YOUR_ENODE"]

Troubleshooting

I do not have my gateway's public key. What should I do?

We highly recommend starting off the gateway setup process by generating a public and private key pair as not doing so might cause problems whenever you restart the gateway. More information can be found in the Requirements page.

However, if needed, you can use the enode generated automatically by the Gateway. Grep for the word β€œenode” in the gateway log file that was generated during the startup process. Below is an example of the log reporting the enode:

"Started P2P networking                   self=enode://08141a65c2b5fa0e9d1e562bd732743c07a1d2a2e921b0fe209a74b59dca2d0cbbc4bc3ea21138e405f6e77ba804c996e9b2ae2d20bab30bd6b58b2d041a85f5@127.0.0.1:0"

A new Gatewayenode will be generated every time the gateway is restarted or updated, which means you will need to add the Gateway enode as a trusted peer in geth again. For an immutable enode Gateway ID, please use the process at the top of the page.

Last updated