flocore-node/example/index.js
Braydon Fuller 49587b7e2d Process tx messages
- Check for tx command when processing messages
- Emit tx events from the daemon
- Start the txmon when the daemon starts
2015-07-30 20:26:08 -04:00

33 lines
502 B
JavaScript
Executable File

#!/usr/bin/env node
'use strict';
/**
* bitcoind.js example
*/
process.title = 'bitcoind.js';
/**
* daemon
*/
var daemon = require('../').daemon({
datadir: process.env.BITCOINDJS_DIR || '~/.bitcoin',
});
daemon.on('ready', function() {
console.log('ready');
});
daemon.on('tx', function(txid) {
console.log('txid', txid);
});
daemon.on('error', function(err) {
daemon.log('error="%s"', err.message);
});
daemon.on('open', function(status) {
daemon.log('status="%s"', status);
});