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

docs: Update Examples with Blockstore #832

Closed
wants to merge 1 commit into from

Conversation

pinheadmz
Copy link
Member

Chain requires Blockstore!

All scripts in docs/Examples updated and tested.

@codecov-io
Copy link

codecov-io commented Sep 5, 2019

Codecov Report

Merging #832 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #832   +/-   ##
=======================================
  Coverage   62.09%   62.09%           
=======================================
  Files         147      147           
  Lines       25392    25392           
=======================================
  Hits        15766    15766           
  Misses       9626     9626

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 7572246...bdb2e80. Read the comment docs.

@pinheadmz pinheadmz added docs UI isn't clear or documented guidance needed quick Can be fixed quickly, code change less than 10 lines labels Sep 5, 2019
@braydonf
Copy link
Contributor

braydonf commented Sep 5, 2019

I don't think examples should recommend to use LevelBlockStore, as this wouldn't be a realistic use case. I could eventually see it being deprecated, see the charts on the PR #703.

Also these examples are highly likely to break without there being tests for them. I don't think it makes sense, or time efficient, to manually run each of these every time to verify they are working, so maintenance of them is problematic.

@pinheadmz
Copy link
Member Author

@braydonf I couldnt figure out how to get a in-memory blockstore without directly calling LevelBlockStore. Because there's nothing like new Blockstore({memory: true})

Even Blockstore.create({memory: true}) will throw if location isn't specified... which is kinda the point of memory: true

@braydonf
Copy link
Contributor

braydonf commented Sep 5, 2019

I think the recommended usage would actually be to save to disk. If you're writing an application, you'll be doing that.

@tynes
Copy link
Member

tynes commented Sep 5, 2019

I think the recommended usage would actually be to save to disk. If you're writing an application, you'll be doing that.

I don't think this is true in all cases. This is assuming you are syncing all of the blocks. SPV can work fully in memory. You can also have application logic that keeps a rolling buffer of blocks - as new ones come in, delete old ones.

Edit: SPV is not relevant here, as the headers are stored in the chaindb and not blockstore

@pinheadmz
Copy link
Member Author

All of the examples so far run in memory, I was just aiming for consistency. Personally I don't like little demos like this leaving files around my computer.

@pinheadmz
Copy link
Member Author

Also worth linking to this recent issue. Although this PR is not the solution, that's why I ran these!

@pinheadmz
Copy link
Member Author

Closed by #846

@pinheadmz pinheadmz closed this Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs UI isn't clear or documented guidance needed quick Can be fixed quickly, code change less than 10 lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants