Skip to content
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

blockstore: browser fallback to indexdb via bdb #757

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pinheadmz
Copy link
Member

This PR adds an index-browser.js file to blockstore/ that creates LevelBlockStore for chainDB, which is browser compatible.

@pinheadmz
Copy link
Member Author

This is currently working fine in my browser-app full node:
https://github.com/pinheadmz/mobilebcoin

@codecov-io
Copy link

Codecov Report

Merging #757 into master will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #757      +/-   ##
==========================================
- Coverage   56.64%   56.61%   -0.03%     
==========================================
  Files         112      112              
  Lines       28140    28140              
  Branches     4800     4800              
==========================================
- Hits        15939    15931       -8     
- Misses      12201    12209       +8
Impacted Files Coverage Δ
lib/mempool/fees.js 59.42% <0%> (-1.91%) ⬇️

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 d601b6a...ae65f28. Read the comment docs.

@braydonf
Copy link
Contributor

Another alternative is for the browser to use SPV, as it doesn't require a blockstore.

@braydonf
Copy link
Contributor

There are number of reasons why a full or pruned node (that requires a blockstore) in a browser (and without a fs) isn't practical:

  • It's going to be very slow, as far I know this hasn't been tested on mainnet.
  • Persistence issues and limits on storage.
  • Various security concerns, browser extensions, private key phishing and etc.
  • Can't connect to the network directly.

In the other cases, such as mobile applications with WebView, there will likely be filesystem support, and is for the most part without the above issues.

@tynes
Copy link
Member

tynes commented Apr 12, 2019

I don't think that we should deprecate browser support, especially because there is an easy fix to make it work in the browser again

@pinheadmz pinheadmz mentioned this pull request Jun 29, 2021
4 tasks
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.

4 participants