Class DeleteConsensusNodeExtensions
Extension methods for deleting consensus nodes from the network address book.
Inherited Members
Namespace: Hiero
Assembly: Hiero.dll
Syntax
public static class DeleteConsensusNodeExtensions
Methods
| Edit this page View SourceDeleteConsensusNodeAsync(ConsensusClient, DeleteConsensusNodeParams, Action<IConsensusContext>?)
Deletes a consensus node from the network address book.
Declaration
public static Task<TransactionReceipt> DeleteConsensusNodeAsync(this ConsensusClient client, DeleteConsensusNodeParams deleteParams, Action<IConsensusContext>? configure = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ConsensusClient | client | The Consensus Node Client orchestrating the request. |
| DeleteConsensusNodeParams | deleteParams | The deletion parameters containing the node identifier to delete. |
| 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. |
Examples
// Delete a node from the address book. Effective at the next network
// stake-weight rebalance. The node's AdminKey must sign.
var receipt = await client.DeleteConsensusNodeAsync(nodeId);
Console.WriteLine($"Delete status: {receipt.Status}");
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | If required arguments are missing or invalid. |
| InvalidOperationException | If required context configuration is missing. |
| PrecheckException | If the gateway node refused the transaction. Only a code about the transaction itself proves it did not execute; any other code leaves the outcome unknown, so settle it by its transaction id on a mirror node rather than resubmitting it (see PrecheckException). |
| ConsensusException | If the outcome could not be confirmed: the transaction may have executed, so settle it by its transaction id on a mirror node rather than resubmitting it. |
| TransactionException | If the network rejected the request as invalid or had missing data. |
DeleteConsensusNodeAsync(ConsensusClient, ulong, Action<IConsensusContext>?)
Deletes a consensus node from the network address book.
Declaration
public static Task<TransactionReceipt> DeleteConsensusNodeAsync(this ConsensusClient client, ulong nodeId, Action<IConsensusContext>? configure = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ConsensusClient | client | The Consensus Node Client orchestrating the request. |
| ulong | nodeId | The identifier of the node to delete. |
| 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
This is a privileged transaction: it must be signed by the node's admin key or by the treasury (0.0.2), system admin (0.0.50) or address book admin (0.0.55) key. The node is fully removed from the network at the next upgrade.
Examples
// Delete a node from the address book. Effective at the next network
// stake-weight rebalance. The node's AdminKey must sign.
var receipt = await client.DeleteConsensusNodeAsync(nodeId);
Console.WriteLine($"Delete status: {receipt.Status}");
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | If required arguments are missing or invalid. |
| InvalidOperationException | If required context configuration is missing. |
| PrecheckException | If the gateway node refused the transaction. Only a code about the transaction itself proves it did not execute; any other code leaves the outcome unknown, so settle it by its transaction id on a mirror node rather than resubmitting it (see PrecheckException). |
| ConsensusException | If the outcome could not be confirmed: the transaction may have executed, so settle it by its transaction id on a mirror node rather than resubmitting it. |
| TransactionException | If the network rejected the request as invalid or had missing data. |