The client to use. AvalancheCoreClient
The endpoint and alias. AliasParameters
Promise that resolves when the alias is set
import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { alias } from '@avalanche-sdk/client/methods/admin'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
});
await alias(client, {
endpoint: "bc/X",
alias: "myAlias"
});
Assign an API endpoint an alias, a different endpoint for the API. The original endpoint will still work. This change only affects this node.