fix title print
This commit is contained in:
parent
c39749c58e
commit
ac1c98f8d4
@ -89,6 +89,7 @@ if (!fs.existsSync(db)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
version: version,
|
||||||
root: rootPath,
|
root: rootPath,
|
||||||
publicPath: process.env.INSIGHT_PUBLIC_PATH || false,
|
publicPath: process.env.INSIGHT_PUBLIC_PATH || false,
|
||||||
appName: 'Insight ' + env,
|
appName: 'Insight ' + env,
|
||||||
|
|||||||
46
insight.js
46
insight.js
@ -26,32 +26,32 @@ console.log(
|
|||||||
/___/_/ /_/____/_/\\__, /_/ /_/\\__/ /_/ |_/ .___/_/ \n\
|
/___/_/ /_/____/_/\\__, /_/ /_/\\__/ /_/ |_/ .___/_/ \n\
|
||||||
/____/ /_/ \n\
|
/____/ /_/ \n\
|
||||||
\n\t\t\t\t\t\tv%s\n\
|
\n\t\t\t\t\t\tv%s\n\
|
||||||
# Configuration:\n\
|
# Configuration:\n\
|
||||||
\t\tNetwork: %s\tINSIGHT_NETWORK\n\
|
\tINSIGHT_NETWORK (Network): %s\n\
|
||||||
\t\tDatabase Path: %s\tINSIGHT_DB\n\
|
\tINSIGHT_DB (Database Path): %s\n\
|
||||||
\t\tSafe Confirmations: %s\tINSIGHT_SAFE_CONFIRMATIONS\n\
|
\tINSIGHT_SAFE_CONFIRMATIONS (Safe Confirmations): %s\n\
|
||||||
\t\tIgnore Cache: %s\tINSIGHT_IGNORE_CACHE\n\
|
\tINSIGHT_IGNORE_CACHE (Ignore Cache): %s\n\
|
||||||
# Bicoind Connection configuration:\n\
|
# Bicoind Connection configuration:\n\
|
||||||
\t\tRPC Username: %s\tBITCOIND_USER\n\
|
\tRPC Username: %s\t\tBITCOIND_USER\n\
|
||||||
\t\tRPC Password: %s\tBITCOIND_PASS\n\
|
\tRPC Password: %s\tBITCOIND_PASS\n\
|
||||||
\t\tRPC Protocol: %s\tBITCOIND_PROTO\n\
|
\tRPC Protocol: %s\t\tBITCOIND_PROTO\n\
|
||||||
\t\tRPC Host: %s\tBITCOIND_HOST\n\
|
\tRPC Host: %s\t\tBITCOIND_HOST\n\
|
||||||
\t\tRPC Port: %s\tBITCOIND_PORT\n\
|
\tRPC Port: %s\t\t\tBITCOIND_PORT\n\
|
||||||
\t\tP2P Port: %s\tBITCOIND_P2P_PORT\n\
|
\tP2P Port: %s\t\t\tBITCOIND_P2P_PORT\n\
|
||||||
\t\tData Dir: %s\tBITCOIND_DATADIR\n\
|
\tBITCOIND_DATADIR: %s\n\
|
||||||
\t\t%s\n\
|
\t%s\n\
|
||||||
\nChange setting by assigning the enviroment variables in the last column. Example:\n\
|
\nChange setting by assigning the enviroment variables above. Example:\n\
|
||||||
$ INSIGHT_NETWORK="testnet" BITCOIND_HOST="123.123.123.123" ./insight.js\
|
$ INSIGHT_NETWORK="testnet" BITCOIND_HOST="123.123.123.123" ./insight.js\
|
||||||
\n\n',
|
\n\n',
|
||||||
version,
|
config.version,
|
||||||
network, home, safeConfirmations, ignoreCache ? 'yes' : 'no',
|
config.network, config.leveldb, config.safeConfirmations, config.ignoreCache ? 'yes' : 'no',
|
||||||
bitcoindConf.user,
|
config.bitcoind.user,
|
||||||
bitcoindConf.pass ? 'Yes(hidden)' : 'No',
|
config.bitcoind.pass ? 'Yes(hidden)' : 'No',
|
||||||
bitcoindConf.protocol,
|
config.bitcoind.protocol,
|
||||||
bitcoindConf.host,
|
config.bitcoind.host,
|
||||||
bitcoindConf.port,
|
config.bitcoind.port,
|
||||||
bitcoindConf.p2pPort,
|
config.bitcoind.p2pPort,
|
||||||
dataDir + (network === 'testnet' ? '*' : ''), (network === 'testnet' ? '* (/testnet3 is added automatically)' : '')
|
config.bitcoind.dataDir + (config.network === 'testnet' ? '*' : ''), (config.network === 'testnet' ? '* (/testnet3 is added automatically)' : '')
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -34,7 +34,7 @@ MessageDb.prototype.close = function(cb) {
|
|||||||
|
|
||||||
|
|
||||||
var messageKey = function(from, to, ts) {
|
var messageKey = function(from, to, ts) {
|
||||||
if (!ts) ts = Math.round(new Date().getTime() / 1000);
|
if (!ts) ts = Math.round(new Date().getTime());
|
||||||
return MESSAGE_PREFIX + from.toString() + '-' + to.toString() + '-' + ts;
|
return MESSAGE_PREFIX + from.toString() + '-' + to.toString() + '-' + ts;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,8 @@ var chai = require('chai');
|
|||||||
var should = chai.should;
|
var should = chai.should;
|
||||||
|
|
||||||
var MessageDb = require('../lib/MessageDb');
|
var MessageDb = require('../lib/MessageDb');
|
||||||
|
var bitcore = require('bitcore');
|
||||||
|
var SIN = bitcore.SIN;
|
||||||
|
|
||||||
describe('MessageDb', function() {
|
describe('MessageDb', function() {
|
||||||
it('should be able to create instance', function() {
|
it('should be able to create instance', function() {
|
||||||
@ -12,7 +14,10 @@ describe('MessageDb', function() {
|
|||||||
it('should receive events', function(done) {
|
it('should receive events', function(done) {
|
||||||
var mdb = new MessageDb();
|
var mdb = new MessageDb();
|
||||||
var message = {};
|
var message = {};
|
||||||
mdb.addMessage(message, 'from', 'to', function(err) {
|
var from = new SIN(new Buffer('dadbad00', 'hex'));
|
||||||
|
var to = new SIN(new Buffer('bacacafe', 'hex'));
|
||||||
|
console.log(to.toString());
|
||||||
|
mdb.addMessage(message, from, to, function(err) {
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user