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

### **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.

{% hint style="info" %}
In order to persist your enode it is recommended to specify private key using the `--private-key` gateway startup argument.
{% endhint %}

{% tabs %}
{% tab title="geth" %}
You have few options:

1. Call http [JSON-RPC](https://geth.ethereum.org/docs/interacting-with-geth/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](https://geth.ethereum.org/docs/interacting-with-geth/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"]
```

{% endtab %}

{% tab title="reth" %}
You have few options:

1. Call http [JSON-RPC](https://geth.ethereum.org/docs/interacting-with-geth/rpc). `curl -H 'Content-Type: application/json' -d '{"method": "admin_addTrustedPeer", "params": ["YOUR_ENODE"]}' http://localhost:8545` . This does not persist after a node restart.
2. Adding `--trusted-peers` argument.
3. **Recommended**: edit the reth config file and add the gateway to trusted\_nodes in the `[peers]` section. You can generate a config file that matches your current configuration by running `reth config`.

```
[peers]
...
trusted_nodes=["YOUR_ENODE"]
```

{% endtab %}
{% endtabs %}

### 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](broken://pages/-MIUROwuDwgYVZ-pFtNr).

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:

{% tabs %}
{% tab title="grep example" %}

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

```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
A new Gateway`enode` 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.
{% endhint %}

\ <br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bloxroute.com/resources/guides/evm-blockchain-distribution-network-bdn/gateway/adding-the-gateway-as-a-trusted-peer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
