Search in sources :

Example 41 with Client

use of com.hedera.hashgraph.sdk.Client in project hedera-mirror-node by hashgraph.

the class SDKClient method getBootstrapClient.

private Client getBootstrapClient(AcceptanceTestProperties.HederaNetwork network, Set<NodeProperties> customNodes) {
    if (!CollectionUtils.isEmpty(customNodes)) {
        log.debug("Creating SDK client for {} network with nodes: {}", network, customNodes);
        return Client.forNetwork(getNetworkMap(customNodes));
    }
    Client client;
    switch(network) {
        case MAINNET:
            log.debug("Creating SDK client for MainNet");
            client = Client.forMainnet();
            break;
        case PREVIEWNET:
            log.debug("Creating SDK client for PreviewNet");
            client = Client.forPreviewnet();
            break;
        case TESTNET:
            log.debug("Creating SDK client for TestNet");
            client = Client.forTestnet();
            break;
        default:
            throw new IllegalStateException("Unsupported network specified!");
    }
    return client;
}
Also used : Client(com.hedera.hashgraph.sdk.Client)

Aggregations

Client (com.hedera.hashgraph.sdk.Client)41 Hbar (com.hedera.hashgraph.sdk.Hbar)23 AccountId (com.hedera.hashgraph.sdk.AccountId)20 TransactionResponse (com.hedera.hashgraph.sdk.TransactionResponse)20 PrivateKey (com.hedera.hashgraph.sdk.PrivateKey)16 TransactionReceipt (com.hedera.hashgraph.sdk.TransactionReceipt)16 TransferTransaction (com.hedera.hashgraph.sdk.TransferTransaction)13 AccountCreateTransaction (com.hedera.hashgraph.sdk.AccountCreateTransaction)12 AccountBalanceQuery (com.hedera.hashgraph.sdk.AccountBalanceQuery)9 Var (com.google.errorprone.annotations.Var)6 FileCreateTransaction (com.hedera.hashgraph.sdk.FileCreateTransaction)6 FileId (com.hedera.hashgraph.sdk.FileId)6 KeyList (com.hedera.hashgraph.sdk.KeyList)6 PublicKey (com.hedera.hashgraph.sdk.PublicKey)6 TimeoutException (java.util.concurrent.TimeoutException)6 AccountDeleteTransaction (com.hedera.hashgraph.sdk.AccountDeleteTransaction)5 ByteString (com.google.protobuf.ByteString)4 AccountBalance (com.hedera.hashgraph.sdk.AccountBalance)4 ScheduleId (com.hedera.hashgraph.sdk.ScheduleId)4 ScheduleInfoQuery (com.hedera.hashgraph.sdk.ScheduleInfoQuery)4