#!/usr/bin/env node 'use strict'; process.title = 'bcoin'; var bcoin = require('../'); var utils = bcoin.utils; var assert = utils.assert; var options = bcoin.config({ config: true, arg: true, env: true, logLevel: 'debug', logFile: true, db: 'leveldb' }); bcoin.set(options); var node = bcoin.spvnode(options); node.on('error', function(err) { ; }); node.open(function(err) { if (err) throw err; if (process.argv.indexOf('--test') !== -1) { node.pool.watchAddress('1VayNert3x1KzbpzMGt2qdqrAThiRovi8'); node.pool.watch(bcoin.outpoint().toRaw()); node.on('block', function(block) { assert(block.txs.length >= 1); if (block.txs.length > 1) utils.log(block.txs[1]); }); } node.startSync(); });