From a6da70cca2b15b5d38e7f8d48ba0b048bccdebcf Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Tue, 4 Aug 2015 14:17:04 -0400 Subject: [PATCH] Add start script for npm command. --- bin/start-libbitcoind.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 bin/start-libbitcoind.js diff --git a/bin/start-libbitcoind.js b/bin/start-libbitcoind.js new file mode 100644 index 00000000..23511601 --- /dev/null +++ b/bin/start-libbitcoind.js @@ -0,0 +1,28 @@ +#!/usr/bin/env node + +'use strict'; + +var chainlib = require('chainlib'); +var log = chainlib.log; + +process.title = 'libbitcoind'; + +/** + * daemon + */ +var daemon = require('../').daemon({ + datadir: process.env.BITCORENODE_DIR || '~/.bitcoin', + network: process.env.BITCORENODE_NETWORK || 'testnet' +}); + +daemon.on('ready', function() { + log.info('ready'); +}); + +daemon.on('error', function(err) { + log.info('error="%s"', err.message); +}); + +daemon.on('open', function(status) { + log.info('status="%s"', status); +});