Show / Hide Table of Contents

Class UtilityExtensions

Extension methods providing general-purpose utility operations on the consensus client.

Inheritance
object
UtilityExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Hiero
Assembly: Hiero.dll
Syntax
public static class UtilityExtensions

Methods

| Edit this page View Source

CreateNewTransactionId(ConsensusClient, Action<IConsensusContext>?)

Creates a new Transaction ID within the given context.

Declaration
public static TransactionId CreateNewTransactionId(this ConsensusClient client, Action<IConsensusContext>? configure = null)
Parameters
Type Name Description
ConsensusClient client

The Consensus Node Client having the configuration necessary to properly generate the Transaction ID.

Action<IConsensusContext> configure

The callback method receiving the IConsensusContext object providing the configuration details of this particular method call invocation.

Returns
Type Description
TransactionId

A new Transaction ID that can be used to identify a transaction.

| Edit this page View Source

PingAsync(ConsensusClient, CancellationToken, Action<IConsensusContext>?)

Contacts the configured gateway with a COST_ASK request to exercise the communications pipeline from this process thru to the execution engine on the gossip node.

Declaration
public static Task<long> PingAsync(this ConsensusClient client, CancellationToken cancellationToken = default, Action<IConsensusContext>? configure = null)
Parameters
Type Name Description
ConsensusClient client

The Consensus Node Client performing the ping on the configured gRPC channel to the gossip node.

CancellationToken cancellationToken

Optional cancellation token.

Action<IConsensusContext> configure

Optional callback method providing an opportunity to modify the execution configuration for just this method call. It is executed prior to submitting the request to the network.

Returns
Type Description
Task<long>

The time it takes (in milliseconds) to receive a response from the remote gossip node.

Exceptions
Type Condition
PrecheckException

If the request failed or the gossip node was unreachable.

  • Edit this page
  • View Source
In this article
Back to top .NET Client Library for Hiero Network and Hedera Hashgraph