Skip to content

Hive Application Framework Account History

Pure SQL. Zero Middleware. Production-Grade.

Deploy a full Hive account history node in minutes. Two APIs (JSON-RPC + REST), one deployment, no replay required.

Built for Production

Everything you need to run a Hive account history node

Pure SQL

Business logic lives entirely in PostgreSQL functions using PL/pgSQL. No middleware layer, no ORM overhead — just direct SQL execution.

Zero Replay

Deploy in minutes, not hours. HAFAh reads directly from HAF’s shared base tables, eliminating the need for costly data replay.

Dual API

JSON-RPC 2.0 and REST endpoints served from a single deployment. One codebase, two protocols, zero duplication.

Smart Caching

Irreversible blocks are cached for up to a year. Reversible data refreshes every 2 seconds. Smart headers let proxies and CDNs do the heavy lifting.

How It Works

Data flows from the Hive blockchain to your application

HAF Database Hive blockchain data
SQL Functions PL/pgSQL business logic
PostgREST HTTP ↔ SQL translation
HTTP API REST + JSON-RPC endpoints
Your App Any HTTP client

API Reference

21 endpoints, two protocols, one deployment

Get Block

Full block with transactions and operations

Request:
curl http://localhost:3000/hafah-api/blocks/1
Response:
{
  "block_num": 1,
  "previous": "0000000000000000000000000000000000000000",
  "timestamp": "2016-03-24T16:05:00",
  "witness": "initminer",
  "transactions": [...]
}

Up and Running in Minutes

Three steps to deploy your own Hive account history API

Pull the Docker image

docker pull registry.gitlab.syncad.com/hive/hafah:latest

Install the database schema

docker run --rm \
  --env HAF_DB_URL=postgresql://<user>:<password>@<host>:5432/haf \
  registry.gitlab.syncad.com/hive/hafah:latest \
  install_app

Start the API server

docker run -d \
  --env HAF_DB_URL=postgresql://<user>:<password>@<host>:5432/haf \
  -p 3000:3000 \
  registry.gitlab.syncad.com/hive/hafah:latest
Requires a running HAF database Learn more about HAF →