Cleaned up Readme and moved json spaces to config

This commit is contained in:
tenthirtyone 2017-08-04 00:45:02 -04:00
parent 0bbf9119e2
commit 0c6868564f
3 changed files with 29 additions and 20 deletions

View File

@ -1,35 +1,42 @@
# Bcoin - Bitcore - Insight
# Bitcore - Bcoin - Insight
Rebuilt Bitcore with Bcoin engine and Insight API sitting on top of Mongo.
# Requirements
### Requirements
Mongodo running on your system.
PR has been submitted to Bcoin repo to fix a bug in their script library that is causing our sync process to crash when one of their checks to a tx script assesses if this is a pay to pubkey input. This is Bcoin-specific and should not affect syncing via DC Pool
A [PR has been submitted](https://github.com/bcoin-org/bcoin/pull/264) to Bcoin repo to fix a bug in their script library that is causing our sync process to crash when one of their checks to a tx script assesses if this is a pay to pubkey input. This is Bcoin-specific and should not affect syncing via DC Pool.
# Usage
### Usage
```
git clone
npm install
npm start
```
Logging is current defaulting to debug during dev. Bitcore logging is preceded by a timestamp. Bcoin logging with [info]
A Full Bcoin node will start. As blocks come in they will be stored in Mongo.
# Misc Gotchas / Needs Docs & clarity
### Configuration
Mongo will create the bitcore db and a blocks/transactions collection automatically. These colls have indexes. Bcoin also syncs to the prefix set in config. To reset/start over you need to drop both collections and delete the bcoin datadir.
A configuration object exists in /config/index.js that accepts a config for Bcoin, Mongo and the new insight-api. During dev this is included. As a best practice this should be part of the gitignore to prevent anyone from saving credentials to Github. However, credentials should be ENV VARS anyway.
# Nginx
### Misc Gotchas / Needs Docs & clarity
Mongo will create the bitcore db and a blocks/transactions collection automatically. These collectionss have indexes. Bcoin also syncs to the prefix set in config. To reset/start over you need to drop both collections and delete the bcoin datadir.
```
mongo
use bitcore
db.blocks.drop()
db.transactions.drop()
rm -rf ~/.bcoin/chain.ldb
```
### Nginx
The API is configured to run on port 3000 by default. Use the standard Nginx reverse proxy to flip http to https and handle ssl certs.
# Requirements
1. git clone
2. npm install
3. npm run start
4. Bitcore starts, Bcoin syncs and Insight starts automagically.
1, 2 & 3 are complete. 4 is also complete but insight still needs wired to mongo and the mongo data models are going to undergo more changes as we consolidate work and discover needs. The goal is still to go as far as possible with a stable framework and fill in the rest afterwards when work can be tasked/delegated.
# Priorities
### Priorities
1. Required Insight-UI
/addr/:addrStr/?noTxList=1
@ -53,4 +60,4 @@ Some data is stubbed. This is due to Bcoin primitives being different from Bitco
# ToDo
Reorg testing - Bcoin will handle this but we need to account for this in our mongo indexes.
JSDoc & Unit tests
JSDoc & Unit tests

View File

@ -16,6 +16,7 @@ const config = {
},
api: {
port: 3000,
json_spaces: 2,
},
};

View File

@ -1,8 +1,9 @@
const express = require('express');
const config = require('../../config');
const app = express();
app.set('json spaces', 2);
app.set('json spaces', config.json_spaces);
// Pass express to register the routes
const AddressAPI = require('./address')(app);