The client to use. AvalancheCoreClient
The network ID. GetNetworkIDReturnType
import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getNetworkID } from '@avalanche-sdk/client/methods/info'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const networkID = await getNetworkID(client)
Get the ID of the network this node is participating in. Network ID of 1 = Mainnet, Network ID of 5 = Fuji (testnet).