- Provides an API for making custom JSON-RPC requests to a Bitcoin node.
- Combines Bitcoin RPCs under the hood.
- Node >= v12.18.1
- Bitcoin Core Daemon (bitcoind)
- Run
npm install
in the project folder - Make a copy of the
.env.example
file and rename it as.env
- Edit the
.env
file:- The application listens to incoming requests described in ./src/api.ts on a port that is assigned to the
PORT
variable. BITCOIND_RPC_HOST
andBITCOIND_RPC_PORT
refer to the address and port, respectively, of the Bitcoin node.BITCOIND_RPC_USER
andBITCOIND_RPC_PASSWORD
are related to the value ofrpcauth
in the node'sbitcoin.conf
file. For generating authentication credentials, see https://github.com/bitcoin/bitcoin/tree/master/share/rpcauth.
- The application listens to incoming requests described in ./src/api.ts on a port that is assigned to the
npm run start
ornpm run dev
in development mode
npm run test
ornpm run test:watch
- from the command line using curl
curl http://localhost:3000/api/getlastblock
- if you have jq installed:
curl http://localhost:3000/api/getlastblock | jq