Class ConsensusNodeDataExtensions
Extension methods for querying consensus node data from the mirror node.
Inherited Members
Namespace: Hiero.Mirror
Assembly: Hiero.dll
Syntax
public static class ConsensusNodeDataExtensions
Methods
| Edit this page View SourceGetActiveConsensusNodesAsync(MirrorRestClient, int)
Client-side wrapper over GetConsensusNodesAsync(MirrorRestClient, params IMirrorQueryParameter[])
that pings each gRPC endpoint returned from
/api/v1/network/nodes and returns only the nodes that
respond within maxTimeoutInMilliseconds.
Useful for building a dynamic gateway list for
ConsensusClient transaction submission.
Declaration
public static Task<IReadOnlyDictionary<ConsensusNodeEndpoint, long>> GetActiveConsensusNodesAsync(this MirrorRestClient client, int maxTimeoutInMilliseconds)
Parameters
| Type | Name | Description |
|---|---|---|
| MirrorRestClient | client | Mirror Rest Client to use for the request. |
| int | maxTimeoutInMilliseconds | The time value threshold, that if exceeded, will result in the node not being considered active and included on this list. |
Returns
| Type | Description |
|---|---|
| Task<IReadOnlyDictionary<ConsensusNodeEndpoint, long>> | A dictionary of gateways and the corresponding response time (in milliseconds). |
GetConsensusNodesAsync(MirrorRestClient, params IMirrorQueryParameter[])
Enumerates the consensus (gossip) nodes published by the
network's address book, reading from
/api/v1/network/nodes. Use FileFilter to
narrow to a specific address-book file (0.0.101 or
0.0.102) or NodeFilter to narrow by node id.
Declaration
public static IAsyncEnumerable<ConsensusNodeData> GetConsensusNodesAsync(this MirrorRestClient client, params IMirrorQueryParameter[] filters)
Parameters
| Type | Name | Description |
|---|---|---|
| MirrorRestClient | client | Mirror Rest Client to use for the request. |
| IMirrorQueryParameter[] | filters | Additional query parameters. The endpoint supports FileFilter, NodeFilter, PageLimit, and OrderBy. |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<ConsensusNodeData> | An async enumerable of consensus-node records. |