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

bitcoind does not retrieve blocks with conf argument #372

Closed
timstackblock opened this issue Aug 8, 2023 · 3 comments
Closed

bitcoind does not retrieve blocks with conf argument #372

timstackblock opened this issue Aug 8, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@timstackblock
Copy link
Contributor

timstackblock commented Aug 8, 2023

Describe the bug

Launching bitcoind with the command given in the documents:
bitcoind -conf=<path-to-bitcoin.config>/bitcoin.conf

For some reason chainhooks can't read the rpcuser=root rpcpassword=root in the file. This results in no blocks being found, when the predicate is ran the user gets this error message

Aug 08 21:48:23.238 INFO Starting predicate evaluation on Bitcoin blocks
Aug 08 21:48:30.268 WARN unable to retrieve block hash #777534: will retry in a few seconds (attempt #4).
Screenshot 2023-08-08 at 5 40 22 PM

Launching bitcoind with this command allows the predicate to be run as it can find the blocks

Aug 08 21:51:13.577 INFO Starting predicate evaluation on Bitcoin blocks
Aug 08 21:51:15.481 INFO 7 blocks scanned, 0 actions triggered

./bitcoind -rpcuser=root -rpcpassword=root

Screenshot 2023-08-08 at 5 51 25 PM

Has anyone else run into this?

@github-project-automation github-project-automation bot moved this to 🆕 New in DevTools Aug 8, 2023
@timstackblock timstackblock added the bug Something isn't working label Aug 8, 2023
@timstackblock timstackblock changed the title bitcoind -conf=/Users/path/chainhook/automate/Chainhook.toml CAUSES ERROR WARN unable to retrieve block ./bitcoind -conf=<path-to-bitcoin.config>/bitcoin.conf CAUSES ERROR WARN unable to retrieve block Aug 8, 2023
@smcclellan smcclellan changed the title ./bitcoind -conf=<path-to-bitcoin.config>/bitcoin.conf CAUSES ERROR WARN unable to retrieve block bitcoind does not retrieve blocks with conf argument Aug 8, 2023
@timstackblock
Copy link
Contributor Author

Bitcoin.conf file for your review

datadir=/opt/homebrew/Cellar/bitcoin/25.0/bin/
server=1
rpcuser=root
rpcpassword=root
rpcport=8332
rpcallowip=0.0.0.0/0
rpcallowip=::/0
txindex=1
listen=1
discover=0
dns=0
dnsseed=0
listenonion=0
rpcserialversion=1
disablewallet=0
fallbackfee=0.00001
rpcthreads=8
blocksonly=1
dbcache=4096

# Start zeromq
zmqpubhashblock=tcp://0.0.0.0:18543

@MicaiahReid
Copy link
Contributor

@timstackblock and I were able to figure this one out.

It looks like the bitcoin node just hadn't synced yet, so the predicate was trying to check blocks that did not yet exist on the chain. The bitcoin node was returning an RPC error stating that the requested block was out of range, but the user never sees that error. I've opened #375 to fix how we display errors here.

But it looks like everything works fine with a bitcoin node, and our documentation on how to set one up is sufficient.

On a side note, when Tim started bitcoind without a config, only passing in terminal arguments, the scan would work. This was confusing for a while. It turns out that the bitcoin.conf specified a different data directory than the default termnial startup conditions, so while the default location did have all blocks synced, the location specified by the config did not. This resulted in the confusing behavior where one worked and the other didn't.

@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in DevTools Aug 10, 2023
@timstackblock
Copy link
Contributor Author

Thanks for the screenshare and help @MicaiahReid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

3 participants