Class UpdateConsensusNodeExtensions
Extension methods for updating consensus nodes in the network address book.
Inherited Members
Namespace: Hiero
Assembly: Hiero.dll
Syntax
public static class UpdateConsensusNodeExtensions
Methods
| Edit this page View SourceUpdateConsensusNodeAsync(ConsensusClient, UpdateConsensusNodeParams, Action<IConsensusContext>?)
Updates an existing consensus node in the network address book.
Declaration
public static Task<TransactionReceipt> UpdateConsensusNodeAsync(this ConsensusClient client, UpdateConsensusNodeParams updateParams, Action<IConsensusContext>? configure = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ConsensusClient | client | The Consensus Node Client orchestrating the request. |
| UpdateConsensusNodeParams | updateParams | The parameters specifying the node to update and the properties to change. |
| 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<TransactionReceipt> | A transaction receipt indicating a successful operation. |
Remarks
Only the properties set on updateParams will be changed.
This transaction must be signed by the node's current admin key.
Changes take effect at the next network upgrade.
Examples
// Update mutable fields on an existing consensus node. Null fields
// are preserved. The node's AdminKey (set at add time) must sign.
// Note: the target is identified by NodeId (ulong), not EntityId.
var receipt = await client.UpdateConsensusNodeAsync(new UpdateConsensusNodeParams
{
NodeId = nodeId,
Description = "Renamed operator",
DeclineReward = true
});
Console.WriteLine($"Update status: {receipt.Status}");
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | If required arguments are missing. |
| InvalidOperationException | If required context configuration is missing. |
| PrecheckException | If the gateway node rejected the request upon submission. |
| ConsensusException | If the network was unable to come to consensus before the duration of the transaction expired. |
| TransactionException | If the network rejected the request as invalid or had missing data. |