-
Notifications
You must be signed in to change notification settings - Fork 30
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
Error: JSON-RPC error: JSON decode error: invalid type: map, expected a sequence #8
Comments
I've tried digging through the source to find the source of this error. The backtrace isn't helpful either. The error doesn't print out which definition in rust-bitcoincore-rpc/json/src/lib.rs failed, nor the text it was trying to deserialize, so I'm quite at a loss. |
I downgraded to bitcoin-core 0.18 and it appears to be running. |
@jkugler did you find out how to fix this? |
@j1warren I did not fix this. I assume the structure of the JSON reply changed between versions and the indexer has not been updated to use that. |
RPC communication is handled by |
That would mean main |
I've rebased everything and pushed |
Seems to be working. |
@j1warren Not a problem. You will have to pay it back. Let me know after a while if everything went OK. Then I'll land it to |
@dpc
So I guess block 630547H was the Height when the indexer started, so after it downloaded it, it changed the DB mode from bulk to normal and postgres started indexing.
And here it has completed indexing, probably saw that there are new blocks already and started to process them in normal mode now. A couple of questions:
|
Yes, initial building indices on my machine was taking ~5 hours, after indexing itself which only took 4 hours. :) The initial indexing is optimized for performance, after that the performance is not as important anymore. Inserting data alone is cheap, updating all the indices is much more costly. Though on my box indexing afterwards is still quite snappy. 5tx/s looks really low. I was getting such numbers only when I was testing with the db stored on my SMR HDD. I suspect the SMR part was causing it since it causes huge write-amplification on small writes (like b-tree node updates). And afaik most modern consumer HDDs are SMRs, which really sucks for this type of applications. So if you're trying it on HDD - it might not fly. On a non-SMR HDD, I hope updates will be fast enough to keep up with the chain as it grows. But I never tried. You could try disabling some indices, which would give some linear speedup, but that will make a lot of useful queries impractical. You can restart indexer with no fear. Everything is using db transactions, so db takes care of consistency. When runninig indexer will always be trying to catch up.
|
I've tried to use views, restarted indexer, etc (didn't try mempool scrubber), it works. My HDD despite being non-SMR (and trying to enhance shared_memory and other values in psql settings) still gives only 4-8 tx/s, so for every 1 new block it processes 2 blocks, slowly catching up. @dpc how do you think, with current schema is it feasible to search the addresses by their "value"? |
@j1warren Thanks for all that info. So it's an interesting data-point. On my SMR-HDD I remember that it took about 2 blocks (20 minutes) to index one block, so I gave up completely at this point. There is a lot of file-system level and db-level tuning that you could potentially do, especially if you're OK with just rebuilding everything if it ever crashes. Some examples:
Right now indexer does not store balances - only UTXO events. Which is fast if you ask about one address, but requires quite a bit of work if you want to do it on many addresses. I did big aggregated queries on whole UTXO set and after about an hour I'd get an answer (that's on fast SSDs, though!). If you're thinking about doing many such queries, you could build an index to speed this up, or some form of a cache, or modify the indexer itself, or write an additional application that follows events produced by indexer and recalculates things and keeps them in additional table(s). |
I'm closing since there's nothing to do, but feel free to ask questions / post comments. |
Howdy! Just found your project. Looking forward to using it.
I set up bitcoind, and it's running. The following curl command works:
My .env looks like this:
But when I run
cargo run --release --bin bitcoin-indexer
it fails with:Any suggestions?
I am using bitcoin-core 0.19.0.1. What version was used with this project? I'm really looking forward to using this...just trying to get it up and running.
The text was updated successfully, but these errors were encountered: