SDK Client Configuration
Prerequisites
1. Configure Your Network Connection
import { Client, AccountId } from "@hashgraph/sdk";
const nodes = {
"xxx.xxx.xxx.xxx:50211": new AccountId(3),
"yyy.yyy.yyy.yyy:50211": new AccountId(4),
};
const client = Client.forNetwork(nodes);import com.hedera.hashgraph.sdk.Client;
import com.hedera.hashgraph.sdk.AccountId;
import java.util.Map;
import java.util.HashMap;
Map<String, AccountId> nodes = new HashMap<>();
nodes.put("xxx.xxx.xxx.xxx:50211", AccountId.fromString("0.0.3"));
nodes.put("yyy.yyy.yyy.yyy:50211", AccountId.fromString("0.0.4"));
Client client = Client.forNetwork(nodes);import (
"github.com/hashgraph/hedera-sdk-go/v2"
)
nodes := map[string]hedera.AccountID{
"xxx.xxx.xxx.xxx:50211": hedera.AccountID{Account: 3},
"yyy.yyy.yyy.yyy:50211": hedera.AccountID{Account: 4},
}
client := hedera.ClientForNetwork(nodes)2. Define the Operator
Using a .env file
.env fileClient Configuration API Reference
Method
Description
Last updated

