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

generate a static tor onion address persistent unique to the node id #3155

Conversation

@Saibato
Copy link
Contributor

Saibato commented Oct 13, 2019

We now can generate a V3 tor service address from a blob

--addr=statictor:127.0.0.1:9051[/torblob=[blob]]

Or generate a unique static tor address bound to our node id /pub key

--addr=statictor:127.0.0.1:9051

TODO:

  • Documentation

  • Write some simple py-tests

EDIT: With this you are able to keep your public known or group known tor address static
and independent of torrc file or the tor instance ( if multiple ), in case you have to
move your node to an other PC or system/phone, as long as there is a tor service
your node will be reachable even if ip, NAT, firewall have changed by that static V3 address.

EDIT: related issues #2476 #3085

EDIT_2:

With this PR we can now also select the extern tor port we assign our local port to

--addr=statictor:127.0.0.1:9051[/torblob=[blob]][/torport=EXTERNPORT]

Or generate a unique static tor address bound to our node id /pub key

--addr=statictor:127.0.0.1:9051[/torport=EXTERNPORT]

@Saibato Saibato force-pushed the Saibato:generate-a-static-tor-onion-for-node-id branch 2 times, most recently from 10e2779 to 80c6316 Oct 13, 2019
@Saibato Saibato marked this pull request as ready for review Oct 13, 2019
@Saibato Saibato requested a review from cdecker as a code owner Oct 14, 2019
@cdecker cdecker self-assigned this Oct 14, 2019
@cdecker cdecker added this to the 0.7.4 milestone Oct 14, 2019
@Saibato Saibato force-pushed the Saibato:generate-a-static-tor-onion-for-node-id branch from 20141dc to ea68f2d Oct 14, 2019
@Saibato

This comment has been minimized.

Copy link
Contributor Author

Saibato commented Oct 14, 2019

@cdecker rebased and ready to rumble ... 👍

@Saibato Saibato force-pushed the Saibato:generate-a-static-tor-onion-for-node-id branch from 3afbb39 to cf2643c Oct 14, 2019
@Saibato Saibato changed the title generate a static tor onion address unique to the node id generate a static tor onion address persistent unique to the node id Oct 14, 2019
@Saibato Saibato force-pushed the Saibato:generate-a-static-tor-onion-for-node-id branch 15 times, most recently from 9417bcf to 9233e15 Oct 14, 2019
@Saibato Saibato force-pushed the Saibato:generate-a-static-tor-onion-for-node-id branch 4 times, most recently from 0d87016 to 478b541 Nov 15, 2019
Copy link
Contributor Author

Saibato left a comment

addressed the most/all points of your review. Thanks. 👍
Please review again

Its now rebased, bisectable and structured in 3 parts.

@Saibato Saibato force-pushed the Saibato:generate-a-static-tor-onion-for-node-id branch 5 times, most recently from 1cb6281 to 5942998 Nov 15, 2019
@Saibato Saibato requested review from cdecker and rustyrussell Nov 18, 2019
@Saibato Saibato force-pushed the Saibato:generate-a-static-tor-onion-for-node-id branch 3 times, most recently from c0c4197 to c11566c Nov 25, 2019
@Saibato

This comment has been minimized.

Copy link
Contributor Author

Saibato commented Nov 25, 2019

A bit of side show, but almost all PR not only this, fail the Travis lottery on first or second push with random errors unrelated to the changes.
@rustyrussell @cdecker #3286 solved all ? Travis failed https://travis-ci.org/ElementsProject/lightning/builds/616642255?utm_source=github_status&utm_medium=notification
I will now force push the same PR again and again 🤦‍♀ until I win the Travis check lottery 🎲 🎲 🎲 take two won ...

@cdecker

This comment has been minimized.

Copy link
Member

cdecker commented Nov 25, 2019

A bit of side show, but almost all PR not only this, fail the Travis lottery on first or second push with random errors unrelated to the changes.
@rustyrussell @cdecker #3286 solved all ? Travis failed https://travis-ci.org/ElementsProject/lightning/builds/616642255?utm_source=github_status&utm_medium=notification
I will now force push the same PR again and again until I win the Travis check lottery take two won ...

I'm restarting failed tests and keeping track of which tests were flaky, so you don't need to push just to get Travis to like your PR 😉

Pushing the same PR just to retry Travis just makes tracking changes rather hard: http://46.101.246.115:8888/ElementsProject/lightning/pull/3155

@Saibato Saibato force-pushed the Saibato:generate-a-static-tor-onion-for-node-id branch 3 times, most recently from d4d1563 to 2d23a62 Nov 30, 2019
Saibato added 3 commits Nov 15, 2019
We  want to have a static Tor service created from a blob bound to
our node on cmdline

Changelog-added: persistent Tor address support
Changelog-added: allow the Tor inbound service port differ from 9735

Signed-off-by: Saibato <saibato.naga@pm.me>

Add base64 encode/decode to common

We need this to encode the blob for the tor service

Signed-off-by: Saibato <saibato.naga@pm.me>
Signed-off-by: Saibato <saibato.naga@pm.me>
Signed-off-by: Saibato <saibato.naga@pm.me>
@Saibato Saibato force-pushed the Saibato:generate-a-static-tor-onion-for-node-id branch from 2d23a62 to 14882ec Nov 30, 2019
@cdecker
cdecker approved these changes Dec 3, 2019
@cdecker

This comment has been minimized.

Copy link
Member

cdecker commented Dec 3, 2019

Excellent changes @Saibato, sorry for the delay in reviewing it 👍

ACK 14882ec

@cdecker cdecker merged commit 2c16b41 into ElementsProject:master Dec 3, 2019
4 checks passed
4 checks passed
bitcoin-bot/acks Acks by cdecker
bitcoin-bot/changelog This PR has at least one changelog entry
bitcoin-bot/fixups PR does not contain unsquashed fixups
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jb55

This comment has been minimized.

Copy link
Collaborator

jb55 commented Dec 11, 2019

very cool, thanks @Saibato !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.