BlockRazor provides a gRPC interface for BNB Smart Chain transaction submission as a high-performance alternative to the JSON-RPC endpoint. gRPC uses HTTP/2 as its transport layer, which enables multiplexed streams, header compression, and binary Protocol Buffer encoding — all of which reduce per-request overhead compared to traditional JSON-over-HTTP/1.1 connections. For latency-sensitive applications such as trading bots, arbitrage searchers, and high-frequency transaction pipelines, the gRPC interface can meaningfully improve throughput and reduce round-trip time.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/BlockRazorinc/docs_en/llms.txt
Use this file to discover all available pages before exploring further.
Why gRPC?
gRPC offers several advantages over JSON-RPC for high-performance transaction submission:
- Lower overhead — Binary Protocol Buffer serialization is significantly more compact than JSON text encoding, reducing payload size and parse time.
- Streaming support — HTTP/2 multiplexing allows multiple concurrent RPC calls over a single connection without head-of-line blocking.
- Strongly typed contracts — Proto definitions enforce request and response schemas at compile time, eliminating a class of runtime errors.
- Persistent connections — Long-lived HTTP/2 connections avoid TCP and TLS handshake overhead on every request.
Endpoint
Authentication
Authentication is performed via gRPC metadata rather than HTTP headers. Attach the following key-value pair to the outgoing context of every RPC call:| Metadata Key | Value |
|---|---|
authorization | Bearer YOUR_AUTH_TOKEN |
The metadata key must be lowercase (
authorization), as gRPC metadata keys are case-insensitive but lowercase is the conventional form. Obtain your YOUR_AUTH_TOKEN from the BlockRazor dashboard.Connection Parameters
gRPC server host. Use
grpc.blockrazor.io.Server port. Always
443 (TLS required).TLS credentials for the connection. Pass
nil to use the system’s default TLS configuration, which is sufficient for most environments.Metadata Fields
gRPC metadata key carrying your BlockRazor API token. Value format:
Bearer YOUR_AUTH_TOKEN.Response
The 32-byte transaction hash (
0x-prefixed hex string) for the submitted transaction. Use this hash with eth_getTransactionReceipt (via the JSON-RPC endpoint) to poll for on-chain confirmation.Present when the RPC call fails. Returned as a gRPC status error on the client side; inspect the status code and message for details.
Example: Connecting and Submitting a Transaction (Go)
The following example demonstrates how to establish a TLS-secured gRPC connection to BlockRazor and attach authentication metadata to the outgoing context. Use the generated protobuf client for your specific service to callSendRawTransaction or equivalent methods.
Dependency Installation (Go)
Add the required gRPC dependencies to your Go module:Comparison: gRPC vs JSON-RPC
| Feature | gRPC (grpc.blockrazor.io:443) | JSON-RPC (rpc.blockrazor.io/bsc) |
|---|---|---|
| Encoding | Binary (Protocol Buffers) | Text (JSON) |
| Transport | HTTP/2 | HTTP/1.1 |
| Multiplexing | Yes | No |
| Streaming | Bidirectional | Not supported |
| Schema enforcement | Compile-time (proto) | Runtime |
| MEV protection | Yes | Yes |
| Auth mechanism | gRPC metadata | HTTP Authorization header |
Both gRPC and JSON-RPC endpoints share the same BlockRazor backend infrastructure and MEV protection guarantees. Choose gRPC when minimizing latency and maximizing throughput is the primary concern; choose JSON-RPC for maximum ecosystem compatibility with existing Ethereum tooling.