createHiveChain() function creates a WAX instance with full blockchain connectivity. You can query accounts, fetch blocks, broadcast transactions, and access all Hive APIs.
When to use createHiveChain
UsecreateHiveChain() when you need:
- API access - Query blockchain data (accounts, blocks, witnesses, etc.)
- Transaction broadcasting - Send signed transactions to the network
- Automatic TaPoS - Create transactions with automatic reference block handling
- Online validation - Verify transactions against current chain state
- REST API calls - Access high-performance REST endpoints
createWaxFoundation() instead.
Creating a chain instance
Basic initialization:Interface reference
TheIHiveChainInterface extends IWaxBaseInterface with:
Creating transactions
Create transactions with automatic TaPoS:Broadcasting transactions
Send a signed transaction to the network:API access
Theapi property provides access to all Hive JSON-RPC APIs:
database_api
Query blockchain data:block_api
Fetch block data:network_broadcast_api
Broadcast transactions:rc_api
Query resource credits:account_by_key_api
Find accounts by public key:REST API access
TherestApi property provides high-performance REST endpoints:
Extending APIs
Extend JSON-RPC API
Add custom API methods:Extend REST API
Add custom REST endpoints:Request/response interception
Intercept API calls for logging or modification:Manabar calculations
Calculate manabar values with live chain data:Configuration management
Change endpoint URL
Update the API endpoint at runtime:Extend configuration
Create a new instance with modified settings:Error handling
Handle API errors gracefully:Complete example
A full workflow usingcreateHiveChain():
Next steps
Explore more capabilities:- Build complex transactions
- Learn about API calls in detail
- Integrate with frameworks
- Study working examples