fcoin/bin/spvnode
Christopher Jeffrey 9a5f1c556d
strict mode.
2016-06-13 01:06:01 -07:00

32 lines
655 B
JavaScript
Executable File

#!/usr/bin/env node
'use strict';
var bcoin = require('../').set({ debug: true, debugFile: true });
var utils = bcoin.utils;
var assert = utils.assert;
var node = bcoin.spvnode({
// passphrase: 'node',
preload: process.argv.indexOf('--preload') !== -1,
useCheckpoints: process.argv.indexOf('--checkpoints') !== -1
});
node.on('error', function(err) {
bcoin.debug(err.stack + '');
});
node.open(function(err) {
if (err)
throw err;
if (process.argv.indexOf('--test') !== -1) {
node.pool.watchAddress('1VayNert3x1KzbpzMGt2qdqrAThiRovi8');
node.on('tx', function(tx) {
utils.print(tx);
});
}
node.startSync();
});