Sync API
These APIs are used by Hubs to synchronize their state with other Hubs. Not meant for use by external applications.
API
| Method Name | Request Type | Response Type | Description |
|---|---|---|---|
| GetInfo | HubInfoRequest | HubInfoResponse | Returns metadata about the hub's state. |
| GetSyncStatus | SyncStatusRequest | SyncStatusResponse | Returns the hub's sync status. |
| GetAllSyncIdsByPrefix | TrieNodePrefix | SyncIds | Get all the SyncIds for a particular prefix |
| GetAllMessagesBySyncIds | SyncIds | MessagesResponse | Get all messages given corresponding sync ids |
| GetSyncMetadataByPrefix | TrieNodePrefix | TrieNodeMetadataResponse | Get Sync metadata for a particular prefix |
| GetSyncSnapshotByPrefix | TrieNodePrefix | TrieNodeSnapshotResponse | Get sync snapshot for a particular prefix |
HubInfoRequest
| Field | Type | Label | Description |
|---|---|---|---|
| db_stats | bool |
HubInfoResponse
Response Types for the Sync RPC Methods
| Field | Type | Label | Description |
|---|---|---|---|
| version | string | ||
| is_syncing | bool | ||
| nickname | string | ||
| root_hash | string | ||
| db_stats | DbStats |
SyncStatusRequest
| Field | Type | Label | Description |
|---|---|---|---|
| peerId | string | optional |
SyncStatusResponse
| Field | Type | Label | Description |
|---|---|---|---|
| is_syncing | bool | ||
| sync_status | SyncStatus | repeated |
SyncStatus
| Field | Type | Label | Description |
|---|---|---|---|
| peerId | string | ||
| inSync | string | ||
| shouldSync | bool | ||
| divergencePrefix | string | ||
| divergenceSecondsAgo | int32 | ||
| theirMessages | uint64 | ||
| ourMessages | uint64 | ||
| lastBadSync | int64 |
TrieNodePrefix
| Field | Type | Label | Description |
|---|---|---|---|
| prefix | bytes |
SyncIds
| Field | Type | Label | Description |
|---|---|---|---|
| sync_ids | bytes | repeated |
TrieNodeMetadataResponse
| Field | Type | Label | Description |
|---|---|---|---|
| prefix | bytes | ||
| num_messages | uint64 | ||
| hash | string | ||
| children | TrieNodeMetadataResponse | repeated |
TrieNodeSnapshotResponse
| Field | Type | Label | Description |
|---|---|---|---|
| prefix | bytes | ||
| excluded_hashes | string | repeated | |
| num_messages | uint64 | ||
| root_hash | string |
DbStats
| Field | Type | Label | Description |
|---|---|---|---|
| num_messages | uint64 | ||
| num_fid_events | uint64 | ||
| num_fname_events | uint64 |