You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nodes that connect through proxies, with the -proxy command line argument, do not bind p2p, meaning, there is no 8333 port binding on loopback. This means that, by definition, electrs will not work on them, since it depends primarily on port p2p receive blocks.
This PR fixes this issue. It uses a combination of ZMQ, for new block notifications, and rest calls to the node to get blocks. The performance is comparable to p2p.
This was done by creating an abstraction layer, a trait, BlockSource, that abstracts both p2p and zmq/rest communication with the node.
To use this branch, make sure to:
Run your node with:rest=1 and zmqpubhashblock=tcp://127.0.0.1:28332 (config or command line args)
Run this branch of electrs with --daemon-zmq-addr 'tcp://127.0.0.1:28332'
I've been testing this for a while and it seems to be working. Would appreciate more testing.
Many thanks for the contribution!
Please consider retargeting this PR to https://github.com/romanz/bindex - electrs will migrate to use bindex soon: #1252
Happy to do it, but there are multiple issues in my mind
From reading the referenced issue, seems like it requires core 31, but I'm using this branch. Consider it extra testing. I'm on Bitcoin Knots 29.3. So if I rebase, it'll break it.
I have problems with core 30+ as they're pushing nodes to hold more arbitrary data and spam with bad mempool policy with bad configurability. Recently I stopped using them, and until something like BIP-110 happens to limit that, I'm not touching core with a long stick. I'm not trying to push any agenda here, but if that branch is specifically for core 31, then I'm never gonna be able to use it or even test it.
Not sure how to reconcile all this. I didn't imagine I'd fall into such a conflict. 😅... I'm sorry!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nodes that connect through proxies, with the
-proxycommand line argument, do not bind p2p, meaning, there is no 8333 port binding on loopback. This means that, by definition, electrs will not work on them, since it depends primarily on port p2p receive blocks.This PR fixes this issue. It uses a combination of ZMQ, for new block notifications, and rest calls to the node to get blocks. The performance is comparable to p2p.
This was done by creating an abstraction layer, a trait,
BlockSource, that abstracts both p2p and zmq/rest communication with the node.To use this branch, make sure to:
rest=1andzmqpubhashblock=tcp://127.0.0.1:28332(config or command line args)--daemon-zmq-addr 'tcp://127.0.0.1:28332'I've been testing this for a while and it seems to be working. Would appreciate more testing.
Fixes #901