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.
- Install Node.js which includes Node Package Manager
- Install BitcoinCore which includes bitcoind
- Install PostgreSQL
- Install Redis
npm install
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 |
node server.js
or
npm start
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.
- The original author of the project is Himanshu Bansal
BITCOIN Arbitrary Data Caching
project is open-sourced software licensed under the MIT license by Himanshu Bansal.