HiveProvider
Connects your app to the Hive blockchain with automatic endpoint fallback and health monitoring.
Usage
<script lang="ts">
import { HiveProvider, useHive } from "@hiveio/honeycomb-svelte";
const hive = useHive();
</script>
<HiveProvider
apiEndpoints={[
"https://api.hive.blog",
"https://api.openhive.network",
"https://api.syncad.com",
]}
timeout={5000}
healthCheckInterval={30000}
>
{#if hive.is_loading}
<p>Loading...</p>
{:else if hive.error}
<p>Error: {hive.error}</p>
{:else}
<p>Connected!</p>
{/if}
</HiveProvider>Props
| Prop | Type | Default | Description |
|---|---|---|---|
apiEndpoints | string[] | DEFAULT_API_ENDPOINTS | API endpoints in priority order |
timeout | number | 5000 | Request timeout in ms |
healthCheckInterval | number | 30000 | Health check interval in ms (0 = disabled) |
onEndpointChange | (endpoint: string) => void | undefined | Called when active endpoint changes |
Default Endpoints
When no apiEndpoints prop is provided, these endpoints are used (in priority order):
https://api.hive.blog
https://api.openhive.network
https://api.syncad.com
Public Nodes
| Node | Provider | Default |
|---|---|---|
api.hive.blog | @blocktrades | Yes |
api.openhive.network | @gtg | Yes |
api.syncad.com | @gtg | Yes |
anyx.io | @anyx | |
rpc.ausbit.dev | @ausbitbank | |
hive-api.arcange.eu | @arcange | |
api.deathwing.me | @deathwing | |
rpc.mahdiyari.info | @mahdiyari | |
techcoderx.com | @techcoderx | |
hive.roelandp.nl | @roelandp |
Automatic Selection
HiveProvider automatically tests all endpoints and connects to the fastest responding node.
Running Your Own Node
For production apps with high traffic, consider running your own node. See the Hive Developer Portal for instructions.
Custom Nodes
You can provide your own list of API endpoints:
import { HiveProvider } from "@hiveio/honeycomb-react";
<HiveProvider
apiEndpoints={[
"https://api.syncad.com",
"https://api.openhive.network",
"https://anyx.io",
"https://rpc.ausbit.dev",
]}
>
{children}
</HiveProvider>