> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neynar.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Metadata API

> gRPC API for retrieving node metadata and synchronization information

These APIs are used to retrieve node metadata and for synchronization between nodes. Some methods are not meant for use by external applications.

## API

| Method Name             | Request Type            | Response Type            | Description                               |
| ----------------------- | ----------------------- | ------------------------ | ----------------------------------------- |
| GetInfo                 | GetInfoRequest          | GetInfoResponse          | Returns metadata about the node's state   |
| GetTrieMetadataByPrefix | TrieNodeMetadataRequest | TrieNodeMetadataResponse | Get trie metadata for a particular prefix |

## GetInfoRequest

Empty request, no parameters needed.

## GetInfoResponse

| Field        | Type                | Label    | Description                  |
| ------------ | ------------------- | -------- | ---------------------------- |
| db\_stats    | [DbStats](#DbStats) |          | Database statistics          |
| num\_shards  | uint32              |          | Number of shards in the node |
| shard\_infos | ShardInfo           | repeated | Information about each shard |

## DbStats

| Field                   | Type   | Label | Description                               |
| ----------------------- | ------ | ----- | ----------------------------------------- |
| num\_messages           | uint64 |       | Total number of messages in the node      |
| num\_fid\_registrations | uint64 |       | Number of FID registrations in the node   |
| approx\_size            | uint64 |       | Approximate size of the database in bytes |

## ShardInfo

| Field                   | Type   | Label | Description                              |
| ----------------------- | ------ | ----- | ---------------------------------------- |
| shard\_id               | uint32 |       | Shard identifier                         |
| max\_height             | uint64 |       | Maximum block height in the shard        |
| num\_messages           | uint64 |       | Number of messages in the shard          |
| num\_fid\_registrations | uint64 |       | Number of FID registrations in the shard |
| approx\_size            | uint64 |       | Approximate size of the shard in bytes   |
| block\_delay            | uint64 |       | Block delay in the shard                 |
| mempool\_size           | uint64 |       | Size of the mempool for this shard       |

## TrieNodeMetadataRequest

| Field     | Type   | Label | Description                  |
| --------- | ------ | ----- | ---------------------------- |
| shard\_id | uint32 |       | Shard ID to get metadata for |
| prefix    | bytes  |       | Prefix to get metadata for   |

## TrieNodeMetadataResponse

| Field         | Type                     | Label    | Description                          |
| ------------- | ------------------------ | -------- | ------------------------------------ |
| prefix        | bytes                    |          | Prefix of the trie node              |
| num\_messages | uint64                   |          | Number of messages under this prefix |
| hash          | string                   |          | Hash of the trie node                |
| children      | TrieNodeMetadataResponse | repeated | Child nodes of this trie node        |
