This transaction body SHALL be considered a "privileged transaction".
- MUST be signed by the governing council. - MUST be signed by the `Key` assigned to the `admin_key` field. - The newly created node information SHALL be added to the network address book information in the network state. - The new entry SHALL be created in "state" but SHALL NOT participate in network consensus and SHALL NOT be present in network "configuration" until the next "upgrade" transaction (as noted below). - All new address book entries SHALL be added to the active network configuration during the next `freeze` transaction with the field `freeze_type` set to `PREPARE_UPGRADE`. ### Record Stream Effects Upon completion the newly assigned `node_id` SHALL be in the transaction receipt.
-
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.NodeCreateTransaction(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) NodeCreateTransactionBody.Builderbuild()Build the transaction body.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.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) A Node 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.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, freezeWith, 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
-
NodeCreateTransaction
public NodeCreateTransaction()Constructor. -
NodeCreateTransaction
NodeCreateTransaction(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
-
NodeCreateTransaction
NodeCreateTransaction(TransactionBody txBody) Constructor.- Parameters:
txBody- protobuf TransactionBody
-
-
Method Details
-
getAccountId
Extract the Account ID of the Node.- Returns:
- the Account ID of the Node.
-
setAccountId
A Node account identifier.This account identifier MUST be in the "account number" form.
This account identifier MUST NOT use the alias field.
If the identified account does not exist, this transaction SHALL fail.
Multiple nodes MAY share the same node account.
This field is REQUIRED.- 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.
This field is OPTIONAL.- Parameters:
description- The String to be set as the description of the node.- 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.These endpoints SHALL represent the published endpoints to which other consensus nodes may _gossip_ transactions.
These endpoints MUST specify a port.
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.
If the network configuration value `gossipFqdnRestricted` is set, then all endpoints in this list MUST supply only IP address.
If the network configuration value `gossipFqdnRestricted` is _not_ set, then endpoints in this list MAY supply either IP address or FQDN, but MUST NOT supply both values for the same endpoint.- Parameters:
gossipEndpoints- the list of service endpoints for gossip.- Returns:
this
-
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.These endpoints SHALL represent the published gRPC endpoints to which clients may submit transactions.
These endpoints MUST specify a port.
Endpoints in this list MAY supply either IP address or FQDN, but MUST NOT supply both values for the same endpoint.
This list MUST NOT be empty.
This list MUST NOT contain more than `8` entries.- Parameters:
serviceEndpoints- list of service endpoints for gRPC calls.- Returns:
this
-
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.
This field is REQUIRED and MUST NOT be empty.- Parameters:
gossipCaCertificate- the DER encoding of the certificate presented.- Returns:
this
-
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 an 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.
This field is OPTIONAL.- Parameters:
grpcCertificateHash- SHA-384 hash of the node gRPC TLS certificate.- Returns:
this
-
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 key MUST sign this transaction.
This key MUST sign each transaction to update this node.
This field MUST contain a valid `Key` value.
This field is REQUIRED and 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. If null, the default behavior is to accept rewards.- Returns:
- true if rewards are declined; false if accepted; null if unset.
-
setDeclineReward
Sets whether this node should decline rewards.- Parameters:
decline- true to decline rewards, false to accept.- 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
-
build
Build the transaction body.- Returns:
NodeCreateTransactionBody
-
initFromTransactionBody
void initFromTransactionBody()Initialize from the transaction body. -
validateChecksums
- Specified by:
validateChecksumsin classTransaction<NodeCreateTransaction>- 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<NodeCreateTransaction,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<NodeCreateTransaction>
-
onScheduled
Description copied from class:TransactionCalled inTransaction.schedule()when converting transaction into a scheduled version.- Specified by:
onScheduledin classTransaction<NodeCreateTransaction>
-