Skip to main content

Quickstart

BlockDB exposes only gRPC services. This quickstart drives them directly with grpcurl and JSON — no SDK required. gRPC reflection is enabled, so grpcurl discovers the schema itself.

0. Prerequisites

  • A running BlockDB instance (default service address localhost:19002).
  • grpcurl installed.
Verify the connection and list the services:
You should see blockdb.v1.TableReadService, blockdb.v1.BlockReadService, and the other services.

Step 1 — Write to a regular table

Use TableWriteService/UpsertRows. Every Value is a JSON object holding the one field you set (stringValue, intValue, doubleValue, boolValue).
A successful write returns a job ID:
Writes are asynchronous. The returned jobId does not mean the data is already committed.

Step 2 — Read a row

You get back a schema plus a positional array:

Step 3 — Write to a Block State Table

For on-chain state, use BlockWriteService/UpsertBlock with a block anchor (the example table token.token.eth is a Block State table):

Step 4 — Read state at a block height

Anchor the read with currentBlock; BlockDB injects height ≤ target height:

Step 5 — Subscribe to block write events

BlockSubscribeService/Subscribe is a server-streaming call. It stays open and streams an event per block write:
Each event looks like:

Next steps