Skip to content

Sync API

These APIs are used by Hubs to synchronize their state with other Hubs. Not meant for use by external applications.

API

Method NameRequest TypeResponse TypeDescription
GetInfoHubInfoRequestHubInfoResponseReturns metadata about the hub's state.
GetSyncStatusSyncStatusRequestSyncStatusResponseReturns the hub's sync status.
GetAllSyncIdsByPrefixTrieNodePrefixSyncIdsGet all the SyncIds for a particular prefix
GetAllMessagesBySyncIdsSyncIdsMessagesResponseGet all messages given corresponding sync ids
GetSyncMetadataByPrefixTrieNodePrefixTrieNodeMetadataResponseGet Sync metadata for a particular prefix
GetSyncSnapshotByPrefixTrieNodePrefixTrieNodeSnapshotResponseGet sync snapshot for a particular prefix

HubInfoRequest

FieldTypeLabelDescription
db_statsbool

HubInfoResponse

Response Types for the Sync RPC Methods

FieldTypeLabelDescription
versionstring
is_syncingbool
nicknamestring
root_hashstring
db_statsDbStats

SyncStatusRequest

FieldTypeLabelDescription
peerIdstringoptional

SyncStatusResponse

FieldTypeLabelDescription
is_syncingbool
sync_statusSyncStatusrepeated

SyncStatus

FieldTypeLabelDescription
peerIdstring
inSyncstring
shouldSyncbool
divergencePrefixstring
divergenceSecondsAgoint32
theirMessagesuint64
ourMessagesuint64
lastBadSyncint64

TrieNodePrefix

FieldTypeLabelDescription
prefixbytes

SyncIds

FieldTypeLabelDescription
sync_idsbytesrepeated

TrieNodeMetadataResponse

FieldTypeLabelDescription
prefixbytes
num_messagesuint64
hashstring
childrenTrieNodeMetadataResponserepeated

TrieNodeSnapshotResponse

FieldTypeLabelDescription
prefixbytes
excluded_hashesstringrepeated
num_messagesuint64
root_hashstring

DbStats

FieldTypeLabelDescription
num_messagesuint64
num_fid_eventsuint64
num_fname_eventsuint64