Push Model
Data flows to youData flows directly from hived to PostgreSQL via sql_serializer plugin. No polling, no rate limits, no missed blocks.
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.
-- Query the latest blocks from Hive blockchain
SELECT num, created_at, producer
FROM hive.blocks
ORDER BY num DESC
LIMIT 5; HAF syncs blocks to PostgreSQL, manages forks, and isolates app contexts — you write SQL.
Data flows directly from hived to PostgreSQL via sql_serializer plugin. No polling, no rate limits, no missed blocks.
HiveForkManager automatically rolls back application data during microforks. Your app stays consistent without any extra code.
Run multiple applications on a single HAF server. Each app gets its own context while sharing the same blockchain data.
Access blocks, transactions, and operations through standard PostgreSQL queries. Use any language or tool that speaks SQL.
Production-ready Docker Compose setup with pgAdmin and pgHero. Clone, configure, and start syncing in under 5 minutes.
Three sync modes — massive replay, P2P sync, and live sync — with indexes dropped during replay and rebuilt after.
HAF sits between the Hive node and your applications, transforming raw blockchain data into queryable PostgreSQL tables.
The sql_serializer plugin captures every block as it's produced and pushes it directly to PostgreSQL. No cron jobs, no polling intervals.
-- Blocks appear in real-time
SELECT num, created_at, hash
FROM hive.blocks
WHERE num > hive.app_get_irreversible_block(); When the blockchain forks, HAF automatically identifies affected blocks and rolls back your application's state. You write forward-only logic.
-- 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(); Multiple applications share a single HAF instance. Each registers its own context and processes blocks independently — no conflicts, no bottlenecks.
-- 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'); These apps run on HAF in production, serving the Hive network daily.
Social networking layer for Hive. Indexes posts, comments, votes, and follows for community applications.
Complete deployment solution for HAF with Docker Compose. Includes pgAdmin, pgHero, and monitoring.
REST API serving account history, transaction lookups, and block data from HAF’s PostgreSQL tables.
Real-time HIVE and HBD balance tracking with historical data. Tracks all transfer operations.
Tracks Hive account reputation scores by indexing vote operations and computing live reputation values.
Backend engine powering the Block Explorer. Serves blocks, transactions, and operations via API from HAF tables.
Get HAF running locally with Docker Compose.
git clone https://gitlab.syncad.com/hive/haf_api_node.git
cd haf_api_node # Copy example environment
cp .env.example .env
# Start HAF with Docker Compose
docker compose up -d -- Connect to PostgreSQL and start querying
psql -h localhost -U haf_admin -d haf_block_log
-- Check sync progress
SELECT MAX(num) as latest_block FROM hive.blocks;
-- Query recent transactions
SELECT * FROM hive.transactions
ORDER BY block_num DESC LIMIT 10;