-
Notifications
You must be signed in to change notification settings - Fork 196
Added get_ordered_blocks using bitcoind index #17
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
Conversation
|
Awesome |
|
In it's current state, I am finding that this implementation seems to corrupt the |
|
I tried this branch and some variant of it and both resulted in the corruption of the index. bitcoind's error message ( I tried using plyvel 1.0.4 which should have support for snappy, but I got the same error. A simple fix to this issue is to require to copy the index to a different directory than |
|
After @brannondorsey reported it, I tried to look into it. When I was working on this, my Bitcoin blockchain was offline. Since I didn't turn the daemon back on, I didn't face this issue. Thanks, @alecalve for looking into this. I was hoping shifting to a modern LevelDB library would have fixed this issue. Unfortunately, I have lost access to the bitcoin blockchain server I was using and currently don't possess the capability to set up one in near future. This makes me incapable of working on this issue. If anyone wants to continue this and find some fix in this or any other PR/fork, I will be glad. I hope this work doesn't get wasted. |
|
Perhaps this is related to this issue. They have the same problem with snappy compression corrupting the LevelDB chainstate. It seems that opening the LevelDB database without snappy compression worked for them. # Open the LevelDB
db = plyvel.DB(".bitcoin/chainstate", compression=None)@alecalve, when you ran your tests with Plyvel, did you try disabling snappy compression? |
|
I didn't, I ran it with the defaults args, which make use of snappy. |
|
Ok, I'm going to take another look at this. |
|
My sincere gratitude to @alecalve and @brannondorsey for their efforts in making this work! |
The LevelDB index of bitcoind contains details about the height of the block, file and offset of the block in the file. This can be used to extract the block ordered by height.
Fixes #13