Settla · Blockchain Infrastructure

What Is gRPC?

gRPC is a framework for calling methods on a remote service as if they were local functions. Services and messages are commonly defined with Protocol Buffers.

It is useful for typed service-to-service APIs and streaming blockchain data, where compact messages and explicit contracts matter.

How the gRPC protocol works

A .proto file defines services, methods and message types. Tooling generates client and server code, while data is commonly serialized as Protobuf and transported over HTTP/2. gRPC supports unary, server-streaming, client-streaming and bidirectional calls.

gRPC vs REST

Criterion gRPC REST/JSON
Contract Strict .proto schema OpenAPI is optional
Payload Usually binary Protobuf Usually readable JSON
Streaming Built into call models Requires additional patterns
Browser use gRPC-Web or gateway Native fetch support

gRPC in blockchain infrastructure

Some blockchain clients expose native gRPC services for blocks, state and subscriptions. Indexers can consume streams, but still need reconnect logic, backpressure, gap detection, reorg handling and catch-up queries.

Benefits and limitations

Benefits

Typed contracts, generated SDKs, compact payloads and streaming.

Limitations

Harder manual inspection, browser adapters and schema-compatibility work.

Choose gRPC

For controlled clients, service-to-service traffic and event streams.

Choose REST

For simple public web APIs and broad browser compatibility.

gRPC FAQ

Is gRPC a protocol?

More precisely, it is an RPC framework and conventions over HTTP/2, commonly using Protocol Buffers.

What is a .proto file?

A schema describing services, methods and message fields.

Why can gRPC be efficient?

Compact binary payloads and HTTP/2 multiplexing can reduce overhead.

Does gRPC work in browsers?

Usually through gRPC-Web or an HTTP/JSON gateway.

Why use gRPC for blockchain?

For native node APIs, internal services and streams of blocks, transactions or events.

We will answer your questions

Write in messengers