Hive Application Framework

Build Blockchain Apps with SQL

HAF transforms Hive blockchain data into a PostgreSQL database. Query blocks, transactions, and operations with standard SQL — no custom protocols, no complex APIs.

Running on HAF in production

  • Hivemind Social Indexer
  • HiveSQL Data Analytics
  • HAF API Node Deployment
  • Balance Tracker Account Balances
  • HAfAH API Framework

Blockchain data, SQL access, fork safety

HAF syncs blocks to PostgreSQL, manages forks, and isolates app contexts — you write SQL.

Push Model

Data flows to you

Data flows directly from hived to PostgreSQL via sql_serializer plugin. No polling, no rate limits, no missed blocks.

Automatic Fork Handling

The bridge holds during storms

HiveForkManager automatically rolls back application data during microforks. Your app stays consistent without any extra code.

Multi-App Architecture

One bridge, many travelers

Run multiple applications on a single HAF server. Each app gets its own context while sharing the same blockchain data.

SQL Interface

Access blocks, transactions, and operations through standard PostgreSQL queries. Use any language or tool that speaks SQL.

Docker Deployment

Production-ready Docker Compose setup with pgAdmin and pgHero. Clone, configure, and start syncing in under 5 minutes.

Staged Sync

Three sync modes — massive replay, P2P sync, and live sync — with indexes dropped during replay and rebuilt after.

From blockchain to SQL in real-time

HAF sits between the Hive node and your applications, transforming raw blockchain data into queryable PostgreSQL tables.

Every block, pushed automatically

The sql_serializer plugin captures every block as it's produced and pushes it directly to PostgreSQL. No cron jobs, no polling intervals.

query.sql
-- Blocks appear in real-time
SELECT num, created_at, hash
FROM hive.blocks
WHERE num > hive.app_get_irreversible_block();

Fork-safe by default

When the blockchain forks, HAF automatically identifies affected blocks and rolls back your application's state. You write forward-only logic.

fork-safe.sql
-- HAF tracks reversible vs irreversible blocks
SELECT * FROM hive.transactions
WHERE block_num BETWEEN
  hive.app_get_irreversible_block()
  AND hive.app_get_current_block_num();

One server, many apps

Multiple applications share a single HAF instance. Each registers its own context and processes blocks independently — no conflicts, no bottlenecks.

multi-app.sql
-- Register your app context
SELECT hive.app_create_context(
  'my_app', 'my_schema'
);
-- Start processing from block 1
SELECT hive.app_context_detach('my_app');

What awaits across the bridge

These apps run on HAF in production, serving the Hive network daily.

Hivemind

Social networking layer for Hive. Indexes posts, comments, votes, and follows for community applications.

HAF API Node

Complete deployment solution for HAF with Docker Compose. Includes pgAdmin, pgHero, and monitoring.

Reputation Tracker

Tracks Hive account reputation scores by indexing vote operations and computing live reputation values.

Cross the bridge in 3 steps

Get HAF running locally with Docker Compose.

01

Clone the repository

02

Configure and start

03

Query blockchain data