Skip to content

HAF-based Alive Protocol streams indexer and API server

License

Notifications You must be signed in to change notification settings

aliveprotocol/halive

Repository files navigation

HAlive

HAF-based Alive Protocol streams indexer and API server. Indexes Hive from a starting block number for Alive-related custom_json operations using the HAF app sync algorithm.

Required Dependencies

  • nodejs and npm (Latest LTS, v18 minimum supported)
  • Synced HAF node
  • AliveDB node

A locally-running IPFS daemon is recommended for faster chunk fetching.

Setup

PostgreSQL Roles

CREATE ROLE halive_app WITH LOGIN PASSWORD 'halivepass' CREATEROLE INHERIT IN ROLE hive_applications_group;
CREATE ROLE halive_user WITH LOGIN INHERIT IN ROLE hive_applications_group;
GRANT CREATE ON DATABASE block_log_testnet TO halive_app;
GRANT halive_user TO halive_app;

PostgREST Installation

./scripts/postgrest_install.sh

PostgREST API methods

psql -f src/sql/create_apis.sql block_log

Installation

git clone https://github.com/aliveprotocol/halive
cd halive
npm i

Compile

npm run compile

Sync

npm start

Start PostgREST server

./scripts/postgrest_start.sh postgres://halive_app:<halive_app_password>@localhost:5432/block_log <server_port>

Start Express server

npm run server

About

HAF-based Alive Protocol streams indexer and API server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published