Connection Pooling
Reuse gRPC channels and connections instead of creating new ones for each request
The Thru gRPC API provides high-performance, strongly-typed remote procedure calls for interacting with the blockchain. Built on Protocol Buffers and HTTP/2, gRPC offers efficient binary serialization and bidirectional streaming.
For browser-based applications, gRPC-Web provides a JavaScript-compatible version of the gRPC protocol that works in web browsers without requiring plugins or proxies.
| Network | Endpoint | Protocol | Description |
|---|---|---|---|
| Alphanet | grpc.alphanet.thruput.org:443 | gRPC over HTTP/2 with TLS | Native gRPC endpoint for all platforms |
| Alphanet | https://grpc-web.alphanet.thruput.org | gRPC-Web | Browser-compatible gRPC endpoint |
All gRPC services use Protocol Buffers (proto3) for serialization. Proto definitions are available in the GitHub repository.
gRPC uses Protocol Buffers for efficient binary serialization, resulting in payloads 2-10x smaller than JSON.
The StreamingService supports bidirectional streaming for real-time updates:
# Subscribe to account updatesrequest = SubscribeAccountRequest(address=account_address)for update in client.SubscribeAccount(request): print(f"Account updated: {update}")gRPC uses status codes for error handling:
OK (0) - SuccessNOT_FOUND (5) - Resource not foundINVALID_ARGUMENT (3) - Invalid request parametersINTERNAL (13) - Internal server errorUNAVAILABLE (14) - Service unavailableTypical performance characteristics:
Connection Pooling
Reuse gRPC channels and connections instead of creating new ones for each request
Timeouts
Set appropriate deadlines for requests to prevent hanging operations
Retry Logic
Implement exponential backoff for retries on transient failures
Health Checks
Monitor service health using gRPC health check protocol