Rebuilt Bitcore with Bcoin engine and Insight API sitting on top of Mongo.
Mongodo running on your system.
A 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.
git clone
npm install
npm start
A Full Bcoin node will start. As blocks come in they will be stored in Mongo.
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.
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
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.
- Required Insight-UI
-
/addr/:addrStr/?noTxList=1
-
/block/:blockhash
-
/blocks
-
/block-index/:blockHeight
-
/currency
-
/version
-
/status
-
/sync
-
/peer
-
/tx/:txId
-
/txs
-
/txs
-
sockets
- Mongo Models : Bcoin primitives. A Bcoin block does not present all of bitcore's data.
- Reorg testing - Bcoin will handle this but we need to account for this in our mongo indexes.
- JSDoc & Unit tests
- Rate Limiting
- Helmet
- Rate Limiting