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

Use Tor to get pruned node blockchain data and connect to remote Core node #383

Merged
merged 7 commits into from Sep 15, 2020

Conversation

ben-kaufman
Copy link
Contributor

@ben-kaufman ben-kaufman commented Sep 12, 2020

Fix #363

Notes:

  • Not tested yet, should work in theory though (if Tor is running) and should anyway not break anything if Tor couldn't be connected to. But needs to first be tested (I'll try to check connecting to remote Tor node, @stepansnigirev can you try maybe the rescan UTXO on a pruned node, can set explorer to Blockstream's http://explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion/)
  • I made connecting to remote Bitcoin Core node use Tor by default, since Tor will cause calls to be significantly slower, it might make more sense to add this as an option in settings? Or only for .onions?

Edit:

Tested connecting to myNode Bitcoin Core over Tor, works.

src/cryptoadvance/specter/rpc.py Outdated Show resolved Hide resolved
src/cryptoadvance/specter/rpc.py Outdated Show resolved Hide resolved
if '.onion' in url:
try:
requests_session = requests.Session()
requests_session.proxies = {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is requests_session.proxies = {} needed?

Session object already initialize the attribute proxies to {}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, that's redundant, removed. Thanks for the review!

if explorer is not None:
try:
requests_session = requests.Session()
requests_session.proxies = {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

@stepansnigirev stepansnigirev merged commit 8c6d0f3 into cryptoadvance:master Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for connecting to a remote node over Tor
3 participants