UNPKG

@owstack/wallet-service

Version:

A service for multisignature HD wallets

34 lines (25 loc) 836 B
#!/usr/bin/env node const baseConfig = require('config'); const log = require('npmlog'); log.debug = log.verbose; class Service { constructor(context, config) { // Context defines the coin network and is set by the implementing service in // order to instance this base service; e.g., btc-service. context.inject(this); this.config = config || baseConfig; this.blockchainmonitor = new this.ctx.BlockchainMonitor(this.config); } } Service.prototype.start = function () { this.blockchainmonitor.start(null, function (err) { if (err) { throw err; } console.log('Blockchain monitor started'); }); }; if (require.main === module) { throw 'The base blockchain monitor cannot be started from the command line'; } module.exports = Service;