Run a Bitcoin Core full node from Node.js.
On install, this package downloads a prebuilt binary from the official Bitcoin Core releases, and checks it against a known SHA256 hash.
npm install bitcoind
let bitcoind =// start the full nodelet node =// returns handle to child processnodestdout// comes with initialized rpc clientnoderpc
Spawns a Bitcoin Core full node.
ChildProcess object representing the
bitcoind process. It has an
rpc property which is a client for the node's RPC server (from the bitcoin-core package).
opts may be an object containing options passed to bitcoind as CLI arguments (you may use any flag supported by bitcoind). To see all supported options, run
npx bitcoind --help.
Installing the package also exposes a
bitcoind command, so you can use this as an easy way to install bitcoin:
$ npm i -g bitcoind $ bitcoind -version