Closed ironng closed 3 years ago
From experimentation, I cd'd into this repo and then ran:
npm install -g ./bitcoind-wallet
notably,
npm install -g bitcoind-wallet
did not work!
Marking this ready to merge now. @beaushinkle did we have to change/add anything for you to use this successfully? If not, we can merge as-is. If yes, feel free to take this PR over.
yeah, we had to add a flag somewhere, but i don't remember where :scream:
beaushinkle@Beaus-MBP ~/local (bitcoind-cli-helper)> npm install -g ./bitcoind-wallet
added 1 package, and audited 3 packages in 351ms
found 0 vulnerabilities
beaushinkle@Beaus-MBP ~/local (bitcoind-cli-helper)> bitcoind-wallet getNewAddress
(node:81881) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
bcrt1qqc3gj54q5rdd9rl0zm9qxv9rj9vtzd0m4hgq9s
should be good to go!
This creates a small package that exposes the
sendToAddress
andgetNewAddress
from bitcoind-rpc to the command line so we can interact with the local bitcoin node. It automatically creates anBitcoinRPC
instance using the same config from the e2e tests. In fact, it just wraps logic taken originally from the e2e test script. :)To use, simply run
npm install -g <path-to-this-package>
. (Requires node version > 12.0)Send:
Get address:
Alternatively, we can just use the package bitcoin-cli, which exposes all methods from bitcoind-rpc, and pass in all the config options via flags. We can update the readme with whatever one we choose.