btcd
NodeJS client for btcd WebSocket API. Written in CoffeeScript (and published to npm as compiled JavaScript).
Install
npm install btcd
Use
// Notice the "/ws" in the url.var btcd = 'wss://user:password@localhost:8334/ws' __dirname + '/rpc.cert'; // All the jsonrpc calls are available as methods:btcd; btcd // Calls with notifications emits additional events:btcd; btcd; // Close the connectionbtcd;
(TODO: document events)
Test
Running the tests requires setting up a local btcd and configuring the tests to connect to it.
# Install dev dependencies npm install # Run tests BTCD_URI=wss://user:pass@localhost:8334/ws \BTCD_CERT=./rpc.cert \npm test
Debug
Information about data being sent and received can be displayed using the
debug package.
To enable this, start the process with the environment variable DEBUG=btcd
.
License
MIT