Interface IBlockNodeContext
A BlockNodeClient instance’s configuration.
Namespace: Hiero
Assembly: Hiero.dll
Syntax
[Experimental("HIERO001", UrlFormat = "https://github.com/bugbytesinc/Hiero/blob/main/docs/blocknode-client-plan.md")]
public interface IBlockNodeContext
Remarks
This interface exposes the current configuration context for a BlockNodeClient instance. When accessed through a Configure(Action<IBlockNodeContext>), Clone(Action<IBlockNodeContext>?) or one of the network request methods, calling code can interrogate the object for configuration details and update as necessary. Typically, the bare minimum that must be configured in a context in order to access a block node is the URL of the block node server Uri. The other default values are typically suitable for most interactions with block nodes.
Properties
| Edit this page View SourceOnSendingRequest
Called by the library just before the protobuf request is sent to the Block Node. This is the only exposure the library provides to the underlying protobuf implementation (although they are publicly available in the library). This method can be useful for logging and tracking purposes. It could also be used in advanced scenarios to modify the protobuf message just before sending.
Declaration
Action<IMessage>? OnSendingRequest { get; set; }
Property Value
| Type | Description |
|---|---|
| Action<IMessage> |
RetryCount
The number of times the client software should retry recoverable communication failures; this includes unary call retries when the block node is temporarily unavailable and automatic block stream re-subscription after a stream gap or transport drop.
Declaration
int RetryCount { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
RetryDelay
The timespan to wait between retry attempts. Each retry attempt adds the same additional amount of delay between retries. The second attempt will wait twice the delay, the third attempt will wait three times the delay and so on.
Declaration
TimeSpan RetryDelay { get; set; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
StatusUri
gRPC URI of the block node's status API (the node service's
server status and server status detail calls), for block nodes
that serve it on a different endpoint than <xref href="Hiero.IBlockNodeContext.Uri" data-throw-if-not-resolved="false"></xref>.
When unset (or
null
), status calls go to Uri.
Declaration
Uri? StatusUri { get; set; }
Property Value
| Type | Description |
|---|---|
| Uri |
Remarks
Block node operators may publish each Block Node API on its own
port; the HIP-1137 registry advertises a separate endpoint per
API (
STATUS
,
SUBSCRIBE_STREAM
,
<pre><code class="lang-csharp">PUBLISH</code></pre>
, …). Block stream subscription calls the status API internally to choose and check its starting block, so subscribing to such a node requires Uri to be its subscribe endpoint and this property to be its status endpoint.
Uri
gRPC URI identifying a block node providing access to the Hiero Block Node services (default port 40840).
Declaration
Uri Uri { get; set; }
Property Value
| Type | Description |
|---|---|
| Uri |
Methods
| Edit this page View SourceReset(string)
Clears a property on the context. This is the only way to clear
a property value on the context so that a parent value can be
used instead. Setting a value to
null
does not clear the value, it sets it to
null
for the current context and child contexts.
Declaration
void Reset(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
. We suggest using the
operator to ensure type safety. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException |
is provided. |