An Admin API Client. AdminApiClient
Assign an API endpoint an alias, a different endpoint for the API. The original endpoint will still work. This change only affects this node.
Give a blockchain an alias, a different name that can be used any place the blockchain's ID is used. Note: The alias is set for each chain on each node individually.
import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
await client.admin.aliasChain({
chain: "sV6o671RtkGBcno1FiaDbVcFv2sG5aVXMZYzKdP4VQAWmJQnM",
alias: "myBlockchainAlias"
})
Returns the aliases of the chain.
import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const aliases = await client.admin.getChainAliases({
chain: "sV6o671RtkGBcno1FiaDbVcFv2sG5aVXMZYzKdP4VQAWmJQnM"
})
Returns log and display levels of loggers.
Dynamically loads any virtual machines installed on the node as plugins.
Writes a profile of mutex statistics to lock.profile
.
Writes a memory profile of the node to mem.profile
.
Sets log and display levels of loggers.
import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
await client.admin.setLoggerLevel({
loggerName: "C",
logLevel: "DEBUG",
displayLevel: "INFO"
})
Start profiling the CPU utilization of the node.
To stop, call stopCPUProfiler
. On stop, writes the profile to cpu.profile
.
Stop the CPU profile that was previously started.
import { createAdminApiClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAdminApiClient({
chain: avalanche,
transport: {
type: "http",
url: "https://api.avax.network/ext/admin",
},
})
// Set endpoint alias
const alias = await client.alias({ endpoint: "bc/X", alias: "myAlias" })
Creates an Admin API Client with a given transport configured for a Chain.