Add proxy and onion support for ckb-network#4733
Merged
zhangsoledad merged 24 commits intonervosnetwork:developfrom Nov 20, 2025
Merged
Add proxy and onion support for ckb-network#4733zhangsoledad merged 24 commits intonervosnetwork:developfrom
proxy and onion support for ckb-network#4733zhangsoledad merged 24 commits intonervosnetwork:developfrom
Conversation
fe5d648 to
e55f631
Compare
Collaborator
Author
de239fd to
f9f0733
Compare
587e905 to
865759d
Compare
260c2fe to
c0f57bb
Compare
6169766 to
12e27f6
Compare
Add onion service configuration options to network configuration and update ckb.toml template.
Signed-off-by: Eval EXEC <execvy@gmail.com>
Signed-off-by: Eval EXEC <execvy@gmail.com>
Collaborator
Author
|
I removed the struct NetworkAddresses because it was unnecessary. Then I rebased onto develop branch. Invite @driftluo @quake @zhangsoledad @doitian @chenyukang review again. |
Collaborator
Author
quake
reviewed
Nov 17, 2025
Collaborator
Author
chenyukang
reviewed
Nov 18, 2025
| listen_addrs.push(Multiaddr::try_from(addr.bytes().raw_data().to_vec()).ok()?) | ||
| match Multiaddr::try_from(addr.bytes().raw_data().to_vec()) { | ||
| Ok(multi_addr) => { | ||
| listen_addrs.push(multi_addr); |
Collaborator
There was a problem hiding this comment.
any specific reason for ignore this error?
Collaborator
Author
There was a problem hiding this comment.
because reader.listen_addrs() have many addresses. In reader.listen_addrs().iter(), if we only parsed a addressed failed, there maybe others addresses are ok.
@driftluo what's your opinion?
chenyukang
reviewed
Nov 18, 2025
chenyukang
reviewed
Nov 18, 2025
chenyukang
reviewed
Nov 18, 2025
|
|
||
| # [network.proxy] | ||
| ### The proxy_url is user-specified SOCKS5 address, like: socks5://127.0.0.1:7891 | ||
| # proxy_url = "socks5://127.0.0.1:9050" |
Collaborator
There was a problem hiding this comment.
this option will be ignored if user already set onion_server?
Collaborator
Author
There was a problem hiding this comment.
No, proxy_url will proxy all traffic. onion_server is used to dial onion address.
chenyukang
reviewed
Nov 18, 2025
quake
previously approved these changes
Nov 18, 2025
quake
previously approved these changes
Nov 19, 2025
zhangsoledad
previously approved these changes
Nov 19, 2025
chenyukang
previously approved these changes
Nov 20, 2025
Signed-off-by: Eval EXEC <execvy@gmail.com>
zhangsoledad
approved these changes
Nov 20, 2025
Closed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What problem does this PR solve?
This PR want to add socks5 proxy and onion support for ckb.
Add
network.proxyandnetwork.onionconfig:Start a tor server:
tor --SocksPort 9050 --ControlPort 9051, finaly, start the ckb node, ifnetwork.onion.listen_on_onionis true, it will auto connect to the tor server, and use tor control port to create onion service.Related changes
ProxyConfigandOnionConfigto network configsocks5://<username>:<password>@server_host:portonionckb node, and listen on the onion hidden networkckb-onion[network.proxy]via a normalsocks5proxyckb-onionrelated configuration's documentation inckb.tomlNote:
Need to setup promethues for tor process: https://gitlab.torproject.org/tpo/onion-services/onionprobe
Check List
Tests
Side effects
Release note