Honeycomb

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

PropTypeDefaultDescription
apiEndpointsstring[]DEFAULT_API_ENDPOINTSAPI endpoints in priority order
timeoutnumber5000Request timeout in ms
healthCheckIntervalnumber30000Health check interval in ms (0 = disabled)
onEndpointChange(endpoint: string) => voidundefinedCalled 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

NodeProviderDefault
api.hive.blog@blocktradesYes
api.openhive.network@gtgYes
api.syncad.com@gtgYes
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>
InstallationHooks