Use
Configuration
The config object sets nodes, timeouts, chain id, and the address prefix.
import { config } from 'hive-tx'
config.nodes = [
'https://api.hive.blog',
'https://api.deathwing.me',
'https://api.openhive.network',
'https://rpc.mahdiyari.info',
'https://techcoderx.com',
'https://hiveapi.actifit.io',
'https://api.c0ff33a.uk'
]
config.restNodes = [
'https://api.hive.blog',
'https://rpc.mahdiyari.info',
'https://techcoderx.com',
'https://hiveapi.actifit.io',
'https://api.c0ff33a.uk'
]
config.timeout = 10_000
config.retry = 8
config.address_prefix = 'STM'
config.chain_id = 'beeab0de00000000000000000000000000000000000000000000000000000000'
| Field | Unit | Default |
|---|---|---|
nodes | URL array | Public JSON-RPC nodes |
restNodes | URL array with no trailing slash | Public REST nodes |
timeout | milliseconds | 10000 |
retry | count | 8 |
address_prefix | string | STM |
chain_id | 64 hex characters | Hive mainnet chain id |
Caution
config is global for the process. Concurrent tasks that change config.nodes can select the wrong node. Set the node list once at start.
Timeout and expiration values are in milliseconds in v7. In v6 those values were in seconds.