own-bitcoin-rpc
v1.1.3
Published
nodejs json-rpc for bitcoin
Downloads
4
Readme
node-bitcoin-rpc
nodejs json-rpc for bitcoin
Instructions:
require()
it- call
.init()
with host, port, username, password as args - call
.call()
with the method, param and callback (the callback takes (err, result))
- optional: call
.setTimeout()
with the number of milliseconds to wait if 500 isn't enough
Example:
var bitcoin_rpc = require('node-bitcoin-rpc')
bitcoin_rpc.init('host', port, 'rpc_username', rpc_pass)
bitcoin_rpc.call('getbalance', [], function (err, res) {
if (err !== null) {
console.log('I have an error :( ' + err + ' ' + res.error)
} else {
console.log('Yay! I need to do whatevere now with ' + res.result)
}
})
Defaults:
- host; localhost
- port: 8332
- rpc_username: bitcoinrpc
- rpc_password: foo
- connection timeout: 500 ms