-
Nested Class Summary
Nested classes/interfaces inherited from class com.hedera.hashgraph.sdk.Transaction
Transaction.SignableNodeTransactionBodyBytesNested classes/interfaces inherited from class com.hedera.hashgraph.sdk.Executable
Executable.GrpcRequest -
Field Summary
Fields inherited from class com.hedera.hashgraph.sdk.Transaction
customFeeLimits, DEFAULT_AUTO_RENEW_PERIOD, defaultMaxTransactionFee, DUMMY_ACCOUNT_ID, DUMMY_TRANSACTION_ID, frozenBodyBuilder, innerSignedTransactions, outerTransactions, publicKeys, regenerateTransactionId, signers, sigPairLists, sourceTransactionBody, transactionIdsFields inherited from class com.hedera.hashgraph.sdk.Executable
attemptedAllNodes, blockingUnaryCall, grpcDeadline, logger, maxAttempts, maxBackoff, minBackoff, nodeAccountIds, nodes, random, RST_STREAM -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.NodeUpdateTransaction(TransactionBody txBody) Constructor.Constructor. -
Method Summary
Modifier and TypeMethodDescriptionaddAssociatedRegisteredNode(long associatedRegisteredNode) Add a registered nodes operated by the same entity as this node.addGossipEndpoint(Endpoint gossipEndpoint) Add an endpoint for gossip to the list of service endpoints for gossip.addServiceEndpoint(Endpoint serviceEndpoint) Add an endpoint for gRPC calls to the list of service endpoints for gRPC calls.(package private) NodeUpdateTransactionBody.Builderbuild()Build the transaction body.Clear all registered nodes associated with this node.Remove the description contents.Delete the gRPC web proxy endpoint.freezeWith(Client client) Freeze this transaction with the given client.Extract the Account ID of the Node.Get an administrative key controlled by the node operator.Get a list of registered nodes operated by the same entity as this node.Gets whether this node declines rewards.Extract the description of the node.byte[]Extract the certificate used to sign gossip events.Extract the list of service endpoints for gossip.byte[]Extract the hash of the node gRPC TLS certificate.Get a web proxy for gRPC from non-gRPC clients.(package private) io.grpc.MethodDescriptor<Transaction, TransactionResponse> Called to direct the invocation of the query to the appropriate gRPC service.longExtract the consensus node identifier in the network state.Extract the list of service endpoints for gRPC calls.(package private) voidInitialize from the transaction body.(package private) voidonFreeze(TransactionBody.Builder bodyBuilder) Called inTransaction.freezeWith(Client)just before the transaction body is built.(package private) voidonScheduled(SchedulableTransactionBody.Builder scheduled) Called inTransaction.schedule()when converting transaction into a scheduled version.setAccountId(AccountId accountId) An account identifier.setAdminKey(Key adminKey) An administrative key controlled by the node operator.setAssociatedRegisteredNodes(List<Long> associatedRegisteredNodes) Set a list of registered nodes operated by the same entity as this node.
This value may contain a list of "registered nodes" (as described in HIP-1137) that are operated by the same entity that operates this consensus node.setDeclineReward(boolean decline) Sets whether this node should decline rewards.setDescription(String description) A short description of the node.setGossipCaCertificate(byte[] gossipCaCertificate) A certificate used to sign gossip events.setGossipEndpoints(List<Endpoint> gossipEndpoints) A list of service endpoints for gossip.setGrpcCertificateHash(byte[] grpcCertificateHash) A hash of the node gRPC TLS certificate.setGrpcWebProxyEndpoint(Endpoint grpcWebProxyEndpoint) A web proxy for gRPC from non-gRPC clients.setNodeId(long nodeId) A consensus node identifier in the network state.setServiceEndpoints(List<Endpoint> serviceEndpoints) A list of service endpoints for gRPC calls.(package private) voidvalidateChecksums(Client client) Methods inherited from class com.hedera.hashgraph.sdk.Transaction
addSignature, addSignature, batchify, buildAllTransactions, buildTransaction, doSchedule, estimateFee, freeze, fromBytes, fromScheduledTransaction, generateTransactionIds, getBatchKey, getDefaultMaxTransactionFee, getExecutionState, getHighVolume, getMaxTransactionFee, getRegenerateTransactionId, getRequiredChunks, getSignableNodeBodyBytesList, getSignatures, getSignaturesAtOffset, getTransactionBodySize, getTransactionHash, getTransactionHashPerNode, getTransactionId, getTransactionIdInternal, getTransactionMemo, getTransactionSize, getTransactionValidDuration, hash, isBatchedAndNotBatchTransaction, isFrozen, keyAlreadySigned, makeRequest, mapResponse, mapResponseStatus, onExecute, onExecuteAsync, regenerateTransactionId, requireNotFrozen, requireOneNodeAccountId, schedule, setBatchKey, setHighVolume, setMaxTransactionFee, setNodeAccountIds, setRegenerateTransactionId, setTransactionId, setTransactionMemo, setTransactionValidDuration, sign, signTransaction, signWith, signWithOperator, spawnBodyBuilder, toBytes, toString, wipeTransactionListsMethods inherited from class com.hedera.hashgraph.sdk.Executable
advanceRequest, checkNodeAccountIds, execute, execute, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, getGrpcRequest, getMaxAttempts, getMaxBackoff, getMaxRetry, getMinBackoff, getNodeAccountIds, getNodeForExecute, grpcDeadline, logTransaction, mergeFromClient, setGrpcDeadline, setLogger, setMaxAttempts, setMaxBackoff, setMaxRetry, setMinBackoff, setNodesFromNodeAccountIds, setRequestListener, setResponseListener, shouldRetryExceptionally
-
Constructor Details
-
NodeUpdateTransaction
public NodeUpdateTransaction()Constructor. -
NodeUpdateTransaction
NodeUpdateTransaction(LinkedHashMap<TransactionId, LinkedHashMap<AccountId, throws com.google.protobuf.InvalidProtocolBufferExceptionTransaction>> txs) Constructor.- Parameters:
txs- Compound list of transaction id's list of (AccountId, Transaction) records- Throws:
com.google.protobuf.InvalidProtocolBufferException- when there is an issue with the protobuf
-
NodeUpdateTransaction
NodeUpdateTransaction(TransactionBody txBody) Constructor.- Parameters:
txBody- protobuf TransactionBody
-
-
Method Details
-
getNodeId
public long getNodeId()Extract the consensus node identifier in the network state.- Returns:
- the consensus node identifier in the network state.
- Throws:
IllegalStateException- when node is not being set
-
setNodeId
A consensus node identifier in the network state.The node identified MUST exist in the network address book.
The node identified MUST NOT be deleted.
This value is REQUIRED.- Parameters:
nodeId- the consensus node identifier in the network state.- Returns:
this- Throws:
IllegalArgumentException- if nodeId is negative
-
getAccountId
Extract the Account ID of the Node.- Returns:
- the Account ID of the Node.
-
setAccountId
An account identifier.If set, this SHALL replace the node account identifier.
If set, this transaction MUST be signed by the active `key` for _both_ the current node account _and_ the identified new node account.- Parameters:
accountId- the Account ID of the Node.- Returns:
this
-
getDescription
Extract the description of the node.- Returns:
- the node's description.
-
setDescription
A short description of the node.This value, if set, MUST NOT exceed 100 bytes when encoded as UTF-8.
If set, this value SHALL replace the previous value.- Parameters:
description- The String to be set as the description of the node.- Returns:
this- Throws:
IllegalArgumentException- if description exceeds 100 bytes when encoded as UTF-8
-
clearDescription
Remove the description contents.- Returns:
this
-
getGossipEndpoints
Extract the list of service endpoints for gossip.- Returns:
- the list of service endpoints for gossip.
-
setGossipEndpoints
A list of service endpoints for gossip.If set, this list MUST meet the following requirements.
These endpoints SHALL represent the published endpoints to which other consensus nodes may _gossip_ transactions.
These endpoints SHOULD NOT specify both address and DNS name.
This list MUST NOT be empty.
This list MUST NOT contain more than `10` entries.
The first two entries in this list SHALL be the endpoints published to all consensus nodes.
All other entries SHALL be reserved for future use.Each network may have additional requirements for these endpoints. A client MUST check network-specific documentation for those details.
Example
Hedera Mainnet _requires_ that address be specified, and does not permit DNS name (FQDN) to be specified.
Mainnet also requires that the first entry be an "internal" IP address and the second entry be an "external" IP address.Solo, however, _requires_ DNS name (FQDN) but also permits address.
If set, the new list SHALL replace the existing list.
- Parameters:
gossipEndpoints- the list of service endpoints for gossip.- Returns:
this- Throws:
IllegalArgumentException- if the list is empty or contains more than 10 endpoints
-
addGossipEndpoint
Add an endpoint for gossip to the list of service endpoints for gossip.- Parameters:
gossipEndpoint- endpoints for gossip to add.- Returns:
this
-
getServiceEndpoints
Extract the list of service endpoints for gRPC calls.- Returns:
- the list of service endpoints for gRPC calls.
-
setServiceEndpoints
A list of service endpoints for gRPC calls.If set, this list MUST meet the following requirements.
These endpoints SHALL represent the published endpoints to which clients may submit transactions.
These endpoints SHOULD specify address and port.
These endpoints MAY specify a DNS name.
These endpoints SHOULD NOT specify both address and DNS name.
This list MUST NOT be empty.
This list MUST NOT contain more than `8` entries.Each network may have additional requirements for these endpoints. A client MUST check network-specific documentation for those details.
If set, the new list SHALL replace the existing list.
- Parameters:
serviceEndpoints- list of service endpoints for gRPC calls.- Returns:
this- Throws:
IllegalArgumentException- if the list is empty or contains more than 8 endpoints
-
addServiceEndpoint
Add an endpoint for gRPC calls to the list of service endpoints for gRPC calls.- Parameters:
serviceEndpoint- endpoints for gRPC calls to add.- Returns:
this
-
getGossipCaCertificate
@Nullable public byte[] getGossipCaCertificate()Extract the certificate used to sign gossip events.- Returns:
- the DER encoding of the certificate presented.
-
setGossipCaCertificate
A certificate used to sign gossip events.This value MUST be a certificate of a type permitted for gossip signatures.
This value MUST be the DER encoding of the certificate presented.If set, the new value SHALL replace the existing bytes value.
- Parameters:
gossipCaCertificate- the DER encoding of the certificate presented.- Returns:
this- Throws:
IllegalArgumentException- if gossipCaCertificate is null or empty
-
getGrpcCertificateHash
@Nullable public byte[] getGrpcCertificateHash()Extract the hash of the node gRPC TLS certificate.- Returns:
- SHA-384 hash of the node gRPC TLS certificate.
-
setGrpcCertificateHash
A hash of the node gRPC TLS certificate.This value MAY be used to verify the certificate presented by the node during TLS negotiation for gRPC.
This value MUST be a SHA-384 hash.
The TLS certificate to be hashed MUST first be in PEM format and MUST be encoded with UTF-8 NFKD encoding to a stream of bytes provided to the hash algorithm.
If set, the new value SHALL replace the existing hash value.
- Parameters:
grpcCertificateHash- SHA-384 hash of the node gRPC TLS certificate.- Returns:
this- Throws:
IllegalArgumentException- if grpcCertificateHash is not 48 bytes (SHA-384 size) when non-empty
-
getAdminKey
Get an administrative key controlled by the node operator.- Returns:
- an administrative key controlled by the node operator.
-
setAdminKey
An administrative key controlled by the node operator.This field is OPTIONAL.
If set, this key MUST sign this transaction.
If set, this key MUST sign each subsequent transaction to update this node.
If set, this field MUST contain a valid `Key` value.
If set, this field MUST NOT be set to an empty `KeyList`.- Parameters:
adminKey- an administrative key to be set.- Returns:
this
-
getDeclineReward
Gets whether this node declines rewards.- Returns:
- true if the node declines rewards; false if it accepts rewards.
-
setDeclineReward
Sets whether this node should decline rewards.- Parameters:
decline- true to decline rewards; false to accept them. If left null no change will be made.- Returns:
this
-
getGrpcWebProxyEndpoint
Get a web proxy for gRPC from non-gRPC clients. -
setGrpcWebProxyEndpoint
A web proxy for gRPC from non-gRPC clients.This endpoint SHALL be a Fully Qualified Domain Name (FQDN) using the HTTPS protocol, and SHALL support gRPC-Web for use by browser-based clients.
This endpoint MUST be signed by a trusted certificate authority.
This endpoint MUST use a valid port and SHALL be reachable over TLS.
This field MAY be omitted if the node does not support gRPC-Web access.
This field MUST be updated if the gRPC-Web endpoint changes.
This field SHALL enable frontend clients to avoid hard-coded proxy endpoints. -
getAssociatedRegisteredNodes
Get a list of registered nodes operated by the same entity as this node.- Returns:
List<Long>the list of associated registered node.
-
setAssociatedRegisteredNodes
Set a list of registered nodes operated by the same entity as this node.
This value may contain a list of "registered nodes" (as described in HIP-1137) that are operated by the same entity that operates this consensus node.This field is OPTIONAL and MAY be empty.
This field MUST NOT contain more than twenty(20) entries.
Every entry in this list MUST be a valid `registered_node_id` for a current registered node.- Parameters:
associatedRegisteredNodes- list of associated registered node.- Returns:
this
-
addAssociatedRegisteredNode
Add a registered nodes operated by the same entity as this node.- Parameters:
associatedRegisteredNode- the associated registered node.- Returns:
this
-
clearAssociatedRegisteredNodes
Clear all registered nodes associated with this node.- Returns:
this
-
build
Build the transaction body.- Returns:
NodeUpdateTransactionBody
-
initFromTransactionBody
void initFromTransactionBody()Initialize from the transaction body. -
validateChecksums
- Specified by:
validateChecksumsin classTransaction<NodeUpdateTransaction>- Throws:
BadEntityIdException
-
getMethodDescriptor
io.grpc.MethodDescriptor<Transaction,TransactionResponse> getMethodDescriptor()Description copied from class:ExecutableCalled to direct the invocation of the query to the appropriate gRPC service.- Specified by:
getMethodDescriptorin classExecutable<NodeUpdateTransaction,Transaction, TransactionResponse, TransactionResponse>
-
onFreeze
Description copied from class:TransactionCalled inTransaction.freezeWith(Client)just before the transaction body is built. The intent is for the derived class to assign their data variant to the transaction body.- Specified by:
onFreezein classTransaction<NodeUpdateTransaction>
-
onScheduled
Description copied from class:TransactionCalled inTransaction.schedule()when converting transaction into a scheduled version.- Specified by:
onScheduledin classTransaction<NodeUpdateTransaction>
-
freezeWith
Freeze this transaction with the given client.- Overrides:
freezeWithin classTransaction<NodeUpdateTransaction>- Parameters:
client- the client to freeze with- Returns:
- this transaction
- Throws:
IllegalStateException- if nodeId is not set
-
deleteGrpcWebProxyEndpoint
Delete the gRPC web proxy endpoint.This method clears the gRPC web proxy endpoint by setting it to an empty Endpoint, which will effectively delete it in the mirror node.
- Returns:
this
-