A client library to connect to Bitcoin Core RPC in JavaScript.
bitcoind-rpc.js runs on node, and can be installed via npm:
npm install bitcoind-rpc
Some examples are provided at the examples path. Here are some snippets:
var run = function() {
var RpcClient = require('bitcoind-rpc');
var hash = '0000000000b6288775bbd326bedf324ca8717a15191da58391535408205aada4';
var config = {
protocol: 'http',
user: 'user',
pass: 'pass',
host: '127.0.0.1',
port: '18332',
};
var rpc = new RpcClient(config);
rpc.getBlock(hash, function(err, ret) {
if (err) {
console.error('An error occured fetching block', hash);
console.error(err);
return;
}
console.log(ret);
});
};
Code released under the MIT license.
Copyright 2013-2014 BitPay, Inc.