TronWeb currently interacts with full nodes primarily over HTTP/JSON endpoints. I’d like to request first-class, optional gRPC support in TronWeb (e.g., a GrpcProvider / GrpcClient transport), so applications can choose gRPC when it’s a better fit.
The Benefits of gRPC:
-
Lower latency & better throughput
- gRPC uses HTTP/2 with efficient binary serialization (Protobuf), which can reduce payload size and improve performance for high-frequency calls (block/event polling, account queries, contract calls).
-
Streaming support (real-time updates)
- gRPC enables server-side streaming patterns that are awkward/inefficient over plain HTTP polling.
- This is useful for near-real-time consumption of new blocks, events/logs, or transaction status updates.
-
More reliable connections vs repeated polling
- Long-lived HTTP/2 connections can reduce overhead from repeated HTTPS requests, improving stability under load (especially for backend services).
-
Typed API contracts
- Protobuf schemas provide strongly-typed request/response structures, improving correctness and developer experience (especially in TS projects), and helping prevent subtle “shape changed” bugs.
-
Better fit for backend/microservice environments
- Many production stacks already use gRPC internally; having TronWeb support it natively would simplify integration and reduce custom glue code.
Proposed scope (suggestion)
- Add a transport abstraction so TronWeb can support multiple providers:
HttpProvider (existing)
GrpcProvider (new)
- Support key read/query operations first (e.g., get account, get block, get transaction, trigger constant contract).
- Support streaming APIs where available (blocks/events), with a TS interfaces (AsyncIterator / EventEmitter).
TronWeb currently interacts with full nodes primarily over HTTP/JSON endpoints. I’d like to request first-class, optional gRPC support in TronWeb (e.g., a
GrpcProvider/GrpcClienttransport), so applications can choose gRPC when it’s a better fit.The Benefits of gRPC:
Lower latency & better throughput
Streaming support (real-time updates)
More reliable connections vs repeated polling
Typed API contracts
Better fit for backend/microservice environments
Proposed scope (suggestion)
HttpProvider(existing)GrpcProvider(new)