- NodeJS
- Bitcoin Full Node + Index
- Bitcoin RPC
- MongoDB
Enable -txindex
. For example, .bitcoin/bitcoin.conf
:
rpcauth=<username>:<hashed_password>
server=1
txindex=1
Set the following
# Set the environment to proper values
$ cp dotenv .env
# Install dependencies
$ npm install
Perform all commands below from the root directory of the program
# Start
$ npm run indexer
# From a specific block height
$ echo 2590 > data/block_n && node bin/index.js
# Re-index
$ rm data/block_n
$ npm run indexer
Continue updating cache transactions
# Start
$ npm run repeater
# Balance
$ node bin/index.js balance <address>
# Transactions
$ node bin/index.js transactions <address>
# Unconfirmed Transactions
$ node bin/index.js unconfirmed_transactions <address>
# Unspents
$ node bin/index.js unspents <address>
# Transaction
$ node bin/index.js transaction <txid>
# Unconfirmed Transaction
$ node bin/index.js unconfirmed_transaction <wtxid>
# Relay Transaction
$ node bin/index.js relay <hex>
# Mempool Information
$ node bin/index.js mempool_info true
# Ord Inscriptions
$ node bin/index.js inscriptions <outpoint>
# Is Ord indexing
$ node bin/index.js indexing
# Watch the index
$ watch -n 1 cat data/block_n