Class NodeAddress

java.lang.Object
com.hedera.hashgraph.sdk.NodeAddress
All Implemented Interfaces:
Cloneable

public class NodeAddress extends Object implements Cloneable
The metadata for a Node – including IP Address, and the crypto account associated with the Node. See Hedera Documentation
  • Field Details

    • publicKey

      @Nullable String publicKey
      The RSA public key of the node.
    • accountId

      @Nullable AccountId accountId
      The account to be paid for queries and transactions sent to this node.
    • nodeId

      long nodeId
      A non-sequential identifier for the node.
    • certHash

      @Nullable com.google.protobuf.ByteString certHash
      A hash of the X509 cert used for gRPC traffic to this node.
    • addresses

      List<Endpoint> addresses
      A node's service IP addresses and ports.
    • description

      @Nullable String description
      A description of the node, with UTF-8 encoding up to 100 bytes.
    • stake

      long stake
      The amount of tinybars staked to the node.
  • Constructor Details

    • NodeAddress

      NodeAddress()
      Constructor.
  • Method Details

    • fromProtobuf

      static NodeAddress fromProtobuf(NodeAddress nodeAddress)
      Create a node from a protobuf.
      Parameters:
      nodeAddress - the protobuf
      Returns:
      the new node
    • getPublicKey

      @Nullable public String getPublicKey()
      Extract the public key.
      Returns:
      the public key
    • setPublicKey

      public NodeAddress setPublicKey(String publicKey)
      Assign the public key.
      Parameters:
      publicKey - the public key
      Returns:
      this
    • getAccountId

      @Nullable public AccountId getAccountId()
      Extract the account id.
      Returns:
      the account id
    • setAccountId

      public NodeAddress setAccountId(AccountId accountId)
      Assign the account id.
      Parameters:
      accountId - the account id
      Returns:
      this
    • getNodeId

      public long getNodeId()
      Extract the node id.
      Returns:
      the node id
    • setNodeId

      public NodeAddress setNodeId(long nodeId)
      Assign the node id.
      Parameters:
      nodeId - the node id
      Returns:
      this
    • getCertHash

      @Nullable public com.google.protobuf.ByteString getCertHash()
      Extract the certificate hash.
      Returns:
      the certificate hash
    • setCertHash

      @Nullable public NodeAddress setCertHash(com.google.protobuf.ByteString certHash)
      Assign the certificate hash.
      Parameters:
      certHash - the certificate hash
      Returns:
      this
    • getAddresses

      public List<Endpoint> getAddresses()
      Extract the list of addresses.
      Returns:
      the list of addresses
    • setAddresses

      public NodeAddress setAddresses(List<Endpoint> addresses)
      Assign the list of addresses.
      Parameters:
      addresses - the list of addresses
      Returns:
      this
    • cloneEndpoints

      static List<Endpoint> cloneEndpoints(List<Endpoint> endpoints)
    • getDescription

      @Nullable public String getDescription()
      Extract the description.
      Returns:
      the description
    • setDescription

      public NodeAddress setDescription(String description)
      Assign the description.
      Parameters:
      description - the description
      Returns:
      this
    • getStake

      public long getStake()
      Extract the tiny stake.
      Returns:
      the tiny stake
    • setStake

      public NodeAddress setStake(long stake)
      Assign the tiny bar stake.
      Parameters:
      stake - the tiny bar stake
      Returns:
      this
    • toProtobuf

      NodeAddress toProtobuf()
      Convert the node address object into a protobuf.
      Returns:
      the protobuf representation.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • clone

      public NodeAddress clone()
      Overrides:
      clone in class Object