> For the complete documentation index, see [llms.txt](https://docs.bloxroute.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bloxroute.com/core-solutions/accessing-the-bdn/gateway-api.md).

# Gateway API

The **Gateway API** connects your local blockchain node to the bloXroute BDN via a bloXroute Gateway. This setup offers the **lowest-latency** access to the network and is ideal for latency-sensitive applications such as trading bots or validator nodes.

#### **Why Use the Gateway API?**

* **Private connection** to the BDN
* **Fastest propagation** of blocks and transactions
* **Full control** over node and Gateway placement

#### **How It Works**

* The Gateway sits alongside your full node (e.g., Geth, Erigon, BSC node).
* It peers with the node using the native protocol (e.g., Ethereum's devp2p).
* The Gateway connects to bloXroute’s global Relay network for fast propagation.
* You send and receive data through the Gateway’s local WebSocket interface.

#### **Recommended: gRPC Streaming**

To ensure high performance, use **gRPC** for subscriptions:

* Supported on Gateways with `--grpc` flag.
* TLS is required for secure connections.

**Enable TLS in Go**

```go
creds := credentials.NewClientTLSFromCert(nil, "")
conn, err := grpc.Dial(url, grpc.WithTransportCredentials(creds))
```

**Using the bloXroute SDK**

```go
creds := credentials.NewClientTLSFromCert(nil, "")

config := &sdk.Config{
    AuthHeader: "<header>",
    GRPCGatewayURL: "virginia.eth.blxrbdn.com:5005",
    GRPCDialOptions: []grpc.DialOption{grpc.WithTransportCredentials(creds)},
}

c, err := sdk.NewClient(context.Background(), config)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.bloxroute.com/core-solutions/accessing-the-bdn/gateway-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
