Skip to content

Commit 16cc5ed

Browse files
committed
docs: clarify that gRPC is disabled by default and runs alongside JSON-RPC, not as a replacement, requiring explicit --grpc flag to enable low-latency trading APIs
1 parent 2683994 commit 16cc5ed

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

api/grpc/README.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@ Low-latency binary API for high-frequency trading and MEV operations on Mandarin
44

55
## Overview
66

7-
This package provides a Protocol Buffer-based gRPC API that replaces slow JSON-RPC for performance-critical operations. Key features:
7+
This package provides a Protocol Buffer-based gRPC API that **runs alongside JSON-RPC** for performance-critical operations. Key features:
88

99
- **Binary protocol**: 10x performance improvement over JSON-RPC
1010
- **Bundle operations**: Submit and simulate transaction bundles with profit calculation
1111
- **Batch operations**: Read multiple storage slots in a single call
1212
- **Low latency**: Direct integration with miner and state database
1313
- **Type safety**: Strongly-typed interfaces via Protocol Buffers
14+
- **Additive**: JSON-RPC continues to work for all standard operations
15+
16+
**Note:** gRPC is **disabled by default** and must be explicitly enabled.
1417

1518
## Architecture
1619

@@ -22,7 +25,20 @@ This package provides a Protocol Buffer-based gRPC API that replaces slow JSON-R
2225

2326
## Configuration
2427

25-
Enable gRPC in your node configuration:
28+
**Important:** gRPC is **disabled by default**. You must explicitly enable it to use these high-performance trading APIs.
29+
30+
### Via Command-Line Flags (Recommended)
31+
32+
```bash
33+
# Enable gRPC alongside standard JSON-RPC
34+
geth --http --http.port 8545 \
35+
--grpc --grpc.addr localhost --grpc.port 9090
36+
37+
# JSON-RPC will run on port 8545 (standard Ethereum API)
38+
# gRPC will run on port 9090 (low-latency trading API)
39+
```
40+
41+
### Via Configuration File
2642

2743
```toml
2844
[Eth]
@@ -31,11 +47,12 @@ GRPCHost = "localhost"
3147
GRPCPort = 9090
3248
```
3349

34-
Or via command-line flags:
50+
### What This Enables
3551

36-
```bash
37-
geth --grpc --grpc.addr localhost --grpc.port 9090
38-
```
52+
When you add the `--grpc` flag:
53+
-**JSON-RPC continues to work** on port 8545 (eth_*, debug_*, etc.)
54+
-**gRPC becomes available** on port 9090 (bundle, batch operations)
55+
-**Both run simultaneously** - use each for its strengths
3956

4057
## Usage Example
4158

@@ -192,9 +209,4 @@ go test -bench=. -benchtime=10s ./api/grpc/...
192209
4. **State deltas**: Export compact state diffs instead of full state
193210
5. **Shared memory**: Zero-copy data sharing for co-located bots
194211
6. **Authentication**: mTLS, JWT, or API key support
195-
7. **Metrics**: Prometheus integration for latency and throughput monitoring
196-
197-
## License
198-
199-
LGPL-3.0-or-later (same as go-ethereum)
200-
212+
7. **Metrics**: Prometheus integration for latency and throughput monitoring

0 commit comments

Comments
 (0)