/bitcoin-arbitrary-data-caching

The purpose of this project is to store and index Bitcoin arbitrary data for all transactions that occur after a given block. This data will subsequently be served on an HTTP endpoint as a JSON payload.

Primary LanguageJavaScriptMIT LicenseMIT

BITCOIN Arbitrary Data Caching

The purpose of this project is to store and index Bitcoin arbitrary data for all transactions that occur after a given block. This data will subsequently be served on an HTTP endpoint as a JSON payload.

Development Setup

Prerequisites

Install Modules

npm install 

Environmental Variables

For reference, .env.sample is added to the project. Rename .env.sample to .env.

# .env
USER=
PASS=
PORT=
dbuser=
database=
dbpassword=
dbhost=
dbport=
REDIS_HOST=
REDIS_PORT=
REDIS_PASSWORD=
REDIS_TTL=
Variable Details Required
USER Bitcoind RPC username YES
PASS Bitcoind RPC password YES
PORT Express port NO
dbuser PostgreSQL database username YES
database PostgreSQL database name YES
dbpassword PostgreSQL database password YES
dbhost PostgreSQL database host YES
dbport PostgreSQL database port YES
REDIS_HOST Redis Host YES
REDIS_PORT Redis Port YES
REDIS_PASSWORD Redis Password NO
REDIS_TTL Redis TTL for cache NO

Running Application

node server.js 

or

npm start

Application Structure

  • server.js     - The entry point to our application. This file defines our express server.
  • connection/ - This folder contains configuration for database and bitcoin core RPC.
  • routes/        - This folder contains the route definitions for our API.
  • db/               - This folder contains the PostgreSQL queries.

People

License