-
Notifications
You must be signed in to change notification settings - Fork 22
Use bsv node rest api #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
|
|
||
| _onAddTransaction (txid) { | ||
| this.logger.info('Added', txid) | ||
| this.logger.debug('Added', txid) |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
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.
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.