update readme, config defaults

This commit is contained in:
tenthirtyone 2017-08-10 00:00:02 -04:00
parent 83a9388e99
commit 8d70c017ed
4 changed files with 12 additions and 7 deletions

View File

@ -39,7 +39,7 @@ db.transactions.drop()
Ctrl+D out of mongo Ctrl+D out of mongo
rm -rf ~/.bcoin/chain.ldb rm -rf ${bcoin-prefix-in-config}/chain.ldb
``` ```
### Nginx ### Nginx

View File

@ -1,14 +1,15 @@
const config = { const config = {
full_node: true, start_node: true,
logging: 'debug', logging: 'debug',
bcoin: { bcoin: {
network: 'main', network: 'main',
db: 'leveldb', db: 'leveldb',
prefix: '.',
checkpoints: true, checkpoints: true,
workers: true, workers: true,
logLevel: 'info', logLevel: 'info',
'max-inbound': 100, 'max-inbound': 10,
'max-outbound': 100, 'max-outbound': 10,
}, },
mongodb: { mongodb: {
uri: 'mongodb://localhost/bitcore', uri: 'mongodb://localhost/bitcore',
@ -19,6 +20,8 @@ const config = {
api: { api: {
port: 3000, port: 3000,
json_spaces: 2, json_spaces: 2,
currency_refresh: 60,
ticker_url: 'https://www.bitstamp.net/api/ticker/',
}, },
}; };

View File

@ -10,6 +10,7 @@ logger.log('debug',
db.connect(config.mongodb.uri, config.mongodb.options); db.connect(config.mongodb.uri, config.mongodb.options);
db.connection.once('open', () => { db.connection.once('open', () => {
if (config.start_node) Bcoin.start(); if (config.start_node) Bcoin.start();
Api.listen(config.api.port, () => { Api.listen(config.api.port, () => {

View File

@ -10,9 +10,10 @@ const node = new FullNode(config.bcoin);
function start() { function start() {
node.open() node.open()
.then(() => { .then(() => {
node.connect().then(() => { node.connect()
node.startSync(); .then(() => {
}); node.startSync();
});
}); });
node.chain.on('connect', (entry, block) => { node.chain.on('connect', (entry, block) => {