Add start script for npm command.
This commit is contained in:
parent
9147350942
commit
a6da70cca2
28
bin/start-libbitcoind.js
Normal file
28
bin/start-libbitcoind.js
Normal file
@ -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);
|
||||||
|
});
|
||||||
Loading…
Reference in New Issue
Block a user