diff --git a/server/README.md b/server/README.md index 9e344d9..e1b8a56 100644 --- a/server/README.md +++ b/server/README.md @@ -33,3 +33,9 @@ Ctrl+D out of mongo rm -rf ${bcoin-prefix-in-config.js}/chain.ldb ``` + +### Contributing + +1. Fork +2. Branch +3. Send a PR \ No newline at end of file diff --git a/server/lib/api/address.js b/server/lib/api/address.js index 6ed7087..2b77eeb 100644 --- a/server/lib/api/address.js +++ b/server/lib/api/address.js @@ -1,4 +1,9 @@ -module.exports = function addressrouter(router) { +const Block = require('../../models/block.js'); +const logger = require('../logger'); + +const MAX_BLOCKS = 200; + +module.exports = function AddressAPI(router) { router.get('/addr/:addr', (req, res) => { res.send(req.params.addr); }); diff --git a/server/lib/api/index.js b/server/lib/api/index.js index 382a20e..f97e539 100644 --- a/server/lib/api/index.js +++ b/server/lib/api/index.js @@ -3,9 +3,9 @@ const config = require('../../config'); const app = express(); const api = express.Router(); -const CORS = require('./CORS'); +const cors = require('./cors'); -app.use(CORS); +app.use(cors); // Serve insight ui front end from root dir public folder app.use('/', express.static('./public')); diff --git a/server/lib/api/socket.js b/server/lib/api/socket.js index dfc4557..a0e02ea 100644 --- a/server/lib/api/socket.js +++ b/server/lib/api/socket.js @@ -1,23 +1,15 @@ module.exports = function addressrouter(io) { io.on('connection', (socket) => { socket.on('subscribe', (data) => { - console.log('subscribe message'); - console.log(data); }); socket.on('message', (data) => { - console.log('unsubscribe message'); - console.log(data); }); socket.on('unsubscribe', (data) => { - console.log('unsubscribe message'); - console.log(data); }); socket.on('disconnect', (data) => { - console.log('unsubscribe message'); - console.log(data); }); }); }; diff --git a/server/lib/node/index.js b/server/lib/node/index.js index e55a1ab..533262d 100644 --- a/server/lib/node/index.js +++ b/server/lib/node/index.js @@ -39,7 +39,7 @@ function start() { }); node.pool.on('peer', (peer) => { - // console.log(peer); + }); node.on('error', (err) => { @@ -48,7 +48,7 @@ function start() { }); node.mempool.on('tx', (tx) => { - console.log(tx) + }); } diff --git a/server/lib/parser/address.js b/server/lib/parser/address.js index 0c3616a..8d4955e 100644 --- a/server/lib/parser/address.js +++ b/server/lib/parser/address.js @@ -11,7 +11,7 @@ function parse(entry, txs) { tx.outputs.forEach((output) => { const outputJSON = output.toJSON(); - //console.log(outputJSON); + /* return new OutputModel({ address: outputJSON.address, @@ -22,7 +22,7 @@ function parse(entry, txs) { tx.inputs.forEach((input) => { const inputJSON = input.toJSON(); - //console.log(inputJSON); + /* return new InputModel({ prevout: inputJSON.prevout, script: inputJSON.script, diff --git a/server/lib/parser/transaction.js b/server/lib/parser/transaction.js index 557e4d0..9bb4fa3 100644 --- a/server/lib/parser/transaction.js +++ b/server/lib/parser/transaction.js @@ -24,8 +24,6 @@ function parse(entry, txs) { const valB = (tx.value || tx.valueOut.value || 0) / 1e8; - console.log(valB) - return sum + valB; }, 0), });