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

[WIP] Add proxy and onion support for ckb-network #4733

Open
wants to merge 23 commits into
base: develop
Choose a base branch
from

Conversation

eval-exec
Copy link
Collaborator

@eval-exec eval-exec commented Dec 2, 2024

What problem does this PR solve?

Add network.proxy and network.onion config:

# [network.proxy]
# proxy_url = "socks5://127.0.0.1:7891"

# [network.onion]
# listen_on_onion = false
# onion_service_target = "127.0.0.1:8115"
# onion_server = "127.0.0.1:9050"
# tor_controller = "127.0.0.1:9051"
# tor_password = ""

Then, start a tor server: tor --SocksPort 9050 --ControlPort 9051, finaly, start the ckb node, if network.onion.listen_on_onion is true, it will auto connect to the tor server, and use tor control port to create onion service.

Related changes

  • Add ProxyConfig and OnionConfig to network config
  • Support socks5 authentication like: socks5://<username>:<password>@server_host:port
  • Support connect to onion ckb node, and listen on the onion hidden network
  • [WIP] Integration test for ckb-onion
    • node1(onion) can succesfully connect node2(node2) in the onion network
    • noode1(onion) can succesfully connect to node2(non-onion)
    • node1(onion) connect node0(onion), node2(onion) connect to node0, expect node1 and node2 can reach each other
    • node1(non-onion) can use [network.proxy] via a normal socks5 proxy
  • ckb-onion related configuration's documentation in ckb.toml

Note:
Need to setup promethues for tor process: https://gitlab.torproject.org/tpo/onion-services/onionprobe

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code ci-runs-only: [ quick_checks,linters ]

Side effects

  • None

Release note

Title Only: Include only the PR title in the release note.

@eval-exec eval-exec force-pushed the exec/proxy branch 5 times, most recently from fe5d648 to e55f631 Compare December 5, 2024 03:37
@eval-exec
Copy link
Collaborator Author

@eval-exec eval-exec force-pushed the exec/proxy branch 10 times, most recently from de239fd to f9f0733 Compare December 24, 2024 06:15
@eval-exec eval-exec force-pushed the exec/proxy branch 3 times, most recently from 587e905 to 865759d Compare December 31, 2024 08:49
@eval-exec eval-exec force-pushed the exec/proxy branch 3 times, most recently from 260c2fe to c0f57bb Compare January 21, 2025 10:45
@eval-exec eval-exec force-pushed the exec/proxy branch 5 times, most recently from 6169766 to 12e27f6 Compare January 24, 2025 06:29
@eval-exec eval-exec force-pushed the exec/proxy branch 3 times, most recently from ce5cfef to ed5710a Compare February 22, 2025 09:26
@eval-exec eval-exec force-pushed the exec/proxy branch 2 times, most recently from 679721f to b6e564b Compare February 24, 2025 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

1 participant