Internal utility class.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) Map<AccountId, NodeAddress> The protobuf address book converted into a map of node account IDs to NodeAddress This variable is package private so tests can use itFields inherited from class com.hedera.hashgraph.sdk.BaseNetwork
closeTimeout, DEFAULT_MAX_NODE_ATTEMPTS, earliestReadmitTime, executor, hasShutDownNow, healthyNodes, maxNodeAttempts, maxNodeBackoff, maxNodeReadmitTime, minNodeBackoff, minNodeReadmitTime, network, nodes, random, transportSecurity -
Method Summary
Modifier and TypeMethodDescriptionaddressBookToNetwork(Collection<NodeAddress> addressBook) protected Node(package private) static NetworkforMainnet(ExecutorService executor) Create a mainnet network.(package private) static NetworkforNetwork(ExecutorService executor, Map<String, AccountId> network) Create a network.(package private) static NetworkforPreviewnet(ExecutorService executor) Create a previewnet network.(package private) static NetworkforTestnet(ExecutorService executor) Create a testnet network.Extract the of network records.Pick 1/3 of the nodes sorted by health and expected delay from the network.(package private) intExtract the number of nodes for each request.(package private) booleanAre certificates being verified?(package private) static Map<AccountId, NodeAddress> readAddressBookResource(String fileName) Import an address book.(package private) voidsetAddressBook(NodeAddressBook addressBook) (package private) NetworksetLedgerId(LedgerId ledgerId) Set the new LedgerId for this network.(package private) NetworksetMaxNodesPerRequest(int maxNodesPerRequest) Assign the maximum nodes to be returned for each request.(package private) NetworksetTransportSecurity(boolean transportSecurity) Enable or disable transport security (TLS).(package private) NetworksetVerifyCertificates(boolean verifyCertificates) Assign the desired verify certificate status.Methods inherited from class com.hedera.hashgraph.sdk.BaseNetwork
awaitClose, beginClose, decreaseBackoff, getCloseTimeout, getLedgerId, getMaxNodeAttempts, getMaxNodeBackoff, getMaxNodeReadmitTime, getMinNodeBackoff, getMinNodeReadmitTime, getNodeProxies, getNodesToRemove, getNumberOfMostHealthyNodes, getRandomNode, increaseBackoff, isTransportSecurity, readmitNodes, removeDeadNodes, setCloseTimeout, setMaxNodeAttempts, setMaxNodeBackoff, setMaxNodeReadmitTime, setMinNodeBackoff, setMinNodeReadmitTime, setNetwork
-
Field Details
-
addressBook
The protobuf address book converted into a map of node account IDs to NodeAddress This variable is package private so tests can use it
-
-
Method Details
-
forNetwork
Create a network.- Parameters:
executor- the executor servicenetwork- the network records- Returns:
- the new network
-
forMainnet
Create a mainnet network.- Parameters:
executor- the executor service- Returns:
- the new mainnet network
-
forTestnet
Create a testnet network.- Parameters:
executor- the executor service- Returns:
- the new testnet network
-
forPreviewnet
Create a previewnet network.- Parameters:
executor- the executor service- Returns:
- the new previewnet network
-
isVerifyCertificates
boolean isVerifyCertificates()Are certificates being verified?- Returns:
- are certificates being verified
-
setVerifyCertificates
Assign the desired verify certificate status.- Parameters:
verifyCertificates- the desired status- Returns:
this
-
setLedgerId
Description copied from class:BaseNetworkSet the new LedgerId for this network. LedgerIds are used for TLS certificate checking and entity ID checksum validation.- Overrides:
setLedgerIdin classBaseNetwork<Network,AccountId, Node> - Parameters:
ledgerId- the ledger id- Returns:
this
-
setAddressBook
-
addressBookToNetwork
-
readAddressBookResource
Import an address book.- Parameters:
fileName- the file name- Returns:
- the list of address book records
-
getNetwork
Extract the of network records.- Returns:
- list of network records
-
createNodeFromNetworkEntry
- Specified by:
createNodeFromNetworkEntryin classBaseNetwork<Network,AccountId, Node>
-
getNodeAccountIdsForExecute
Pick 1/3 of the nodes sorted by health and expected delay from the network. This is used by Query and Transaction for selecting node AccountId's.- Returns:
List<AccountId>- Throws:
InterruptedException
-
setMaxNodesPerRequest
Assign the maximum nodes to be returned for each request.- Parameters:
maxNodesPerRequest- the desired number of nodes- Returns:
this
-
getNumberOfNodesForRequest
int getNumberOfNodesForRequest()Extract the number of nodes for each request.- Returns:
- the number of nodes for each request
-
setTransportSecurity
Enable or disable transport security (TLS).- Parameters:
transportSecurity- should transport security be enabled- Returns:
this- Throws:
InterruptedException- when a thread is interrupted while it's waiting, sleeping, or otherwise occupied
-