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:
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.Using geth JavaScript console to call JSON-RPC. Run
geth attach
and then typeadmin.addTrustedPeer("enode://GATEWAY_PUBLIC_KEY")
. This does not persist after a node restart.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 runninggeth dumpconfig
.
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:
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