Skip to content

Conversation

@calvogenerico
Copy link
Contributor

By using bsv's rest api we avoid all the issues related to block size and json/string/js limits becase we can directly interpret everything as a buffer.

@codecov
Copy link

codecov bot commented Aug 9, 2021

Codecov Report

Merging #16 (10b8701) into master (ace1afb) will decrease coverage by 1.10%.
The diff coverage is 70.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #16      +/-   ##
==========================================
- Coverage   84.90%   83.80%   -1.11%     
==========================================
  Files           9        9              
  Lines         921      926       +5     
==========================================
- Hits          782      776       -6     
- Misses        139      150      +11     
Impacted Files Coverage Δ
src/bitcoin-node-connection.js 72.91% <66.66%> (-22.44%) ⬇️
src/indexer.js 91.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ace1afb...10b8701. Read the comment docs.


_onAddTransaction (txid) {
this.logger.info('Added', txid)
this.logger.debug('Added', txid)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logs are impossible to interprete with the wall of "Added txid". I believe this should be considered debug information. If an specifc txid has to be requested it's easier just do a query.


async getRawBlockByHash (targetHash) {
const response = await fetch(`${this.baseUrl}/rest/block/${targetHash}.bin`)
return Buffer.from(await response.arrayBuffer())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this blocks are always just a buffer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants