#
Init general
#
Constructing a Wax interface
The root Wax interface can be constructed using either default or custom configuration options. Custom options allow selecting a specific blockchain network (e.g. mainnet, testnet, or mirrornet), a specific Hive API endpoint (e.g. api.hive.blog) and also a custom REST API endpoint. It also provides settings to optimize for performance , network latency , or other custom needs.
#
Default Wax initialization
Test it yourself: src/typescript/config/init-general/chain.ts
import { createHiveChain } from '@hiveio/wax';
// Initialize Hive Chain using default options
await createHiveChain();
#
Initializing Wax interface with custom options
Test it yourself: src/typescript/config/init-general/chain-with-config.ts
import { createHiveChain, IWaxOptionsChain } from '@hiveio/wax';
// Define custom options
const customOptions: IWaxOptionsChain = {
chainId: 'f875a0b000000000000000000000000000000000000000000000000000000000', // Example custom chain ID
apiEndpoint: 'https://hive.custom.endpoint', // Example custom API endpoint
restApiEndpoint: 'https://rest.api.custom.endpoint' // Example custom REST API endpoint
};
// Initialize Hive Chain with custom options
await createHiveChain(customOptions);