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)
Retrieves a list of Hedera gRPC nodes known to the mirror node that respond to a ping query within the given timeout value. This can be used to create a list of working gRPC nodes for submitting transactions.
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)
Retrieves the list of known Hedera Gossip Nodes.
Declaration
public static IAsyncEnumerable<ConsensusNodeData> GetConsensusNodesAsync(this MirrorRestClient client)
Parameters
| Type | Name | Description |
|---|---|---|
| MirrorRestClient | client | Mirror Rest Client to use for the request. |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<ConsensusNodeData> | The list of known Hedera Gossip Nodes. |