flocore-node/example/index.js
Christopher Jeffrey 49acbfc113 process title.
2014-09-12 18:56:31 -07:00

22 lines
454 B
JavaScript
Executable File

#!/usr/bin/env node
process.title = 'bitcoind.js';
var bitcoind = require('../')();
bitcoind.start(function(err) {
bitcoind.on('error', function(err) {
console.log('bitcoind: error="%s"', err.message);
});
bitcoind.on('open', function(status) {
console.log('bitcoind: status="%s"', status);
});
});
process.on('SIGINT', function() {
return bitcoind.stop(function(err) {
if (err) throw err;
return process.exit(0);
});
});