Sync Module
Intro

Sync Module

The Sync module provides an interface for synchronizing chain data, fetching blocks, and tracking the tip of the blockchain.

Operations

Important: All byte fields in grpcurl examples (like hashes, addresses, assets) must be base64 encoded. For more details and installation of grpcurl, refer to the grpcurl guide.

The following code samples assume that the UTxORPC node is running locally on localhost:50051. If your node is hosted remotely or on a different server, replace "http://localhost:50051" with the appropriate server URL and port for your environment.

For more details on configuring your node, refer to the UTxORPC Ecosystem Servers Documentation.

FetchBlock

Fetch blocks by their references with optional field masking.

grpcurl -d '{ "ref": [{ "index": 64270876, "hash": "Rmuje+QbnY6ARsca2HxoxeDvWCXEjOlIp3jcnKuhXPA=" }] }' \
  localhost:50051 \
  utxorpc.v1alpha.sync.SyncService.FetchBlock

DumpHistory

Dump a segment of block history from a specified point.

grpcurl -plaintext \
-d '{ 
    "start_token": { 
      "index": 64270876, 
      "hash": "Rmuje+QbnY6ARsca2HxoxeDvWCXEjOlIp3jcnKuhXPA=" 
    },
    "max_items": 100
  }' \
  localhost:50051 \
  utxorpc.v1alpha.sync.SyncService.DumpHistory

FollowTip

Follow the blockchain tip with streaming updates.

grpcurl -plaintext \
  -d '{ "intersect": [{ "index": 64270876, "hash": "Rmuje+QbnY6ARsca2HxoxeDvWCXEjOlIp3jcnKuhXPA=" }] }' \
  localhost:50051 \
  utxorpc.v1alpha.sync.SyncService.FollowTip

ReadTip

Get the current blockchain tip information.

⚠️

This operation is yet to be implemented in Dolos and is still getting worked on.

grpcurl -plaintext \
  -d '{}' \
  localhost:50051 \
  utxorpc.v1alpha.sync.SyncService.ReadTip

The schema details can be found in the spec reference.

Sequence Example