forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
, bitcoin#24555, bitcoin#24663, bitcoin#24205, bitcoin#24687, bitcoin#25173, bitcoin#24991, partial bitcoin#24468 (cjdns support) 32f8fda merge bitcoin#24991: allow startup with -onlynet=onion -listenonion=1 (Kittywhiskers Van Gogh) e67ed92 merge bitcoin#25173: add coverage for unknown network in -onlynet (Kittywhiskers Van Gogh) 77efd36 merge bitcoin#24687: Check an invalid -i2psam will raise an init error (Kittywhiskers Van Gogh) fb1416f merge bitcoin#24205: improve network reachability test coverage and safety (Kittywhiskers Van Gogh) 7cb7479 merge bitcoin#24663: add links to doc/cjdns.md (Kittywhiskers Van Gogh) c736ebf merge bitcoin#24555: create initial doc/cjdns.md for CJDNS how-to documentation (Kittywhiskers Van Gogh) 554bd24 partial bitcoin#24468: improve -onlynet help and related tor/i2p documentation (Kittywhiskers Van Gogh) 5436b6a merge bitcoin#24165: extend inbound eviction protection by network to CJDNS peers (Kittywhiskers Van Gogh) d52724d merge bitcoin#22834: respect -onlynet= when making outbound connections (Kittywhiskers Van Gogh) f9d1a9a merge bitcoin#23077: Full CJDNS support (Kittywhiskers Van Gogh) Pull request description: ## Additional Information * Depends on #6034 * Depends on #6035 * If `-proxy=` is given together with `-noonion` then the provided proxy will not be set as a proxy for reaching the Tor network. So it will not be possible to open manual connections to the Tor network for example with the `addnode` RPC. To mimic the old behavior use `-proxy=` together with `-onlynet=` listing all relevant networks except `onion`. * [bitcoin#24165](bitcoin#24165) has been backported _before_ [bitcoin#23758](bitcoin#23758) and to account for this, minor changes were made in `src/test/net_peer_eviction_tests.cpp` (using `nTimeConnected` instead of `m_connected`). When backporting [bitcoin#23758](bitcoin#23758), these changes will have to be reversed as they won't be covered by the cherry-pick diff. * CJDNS support has been labelled as being introduced in Dash Core 21.0, in line with the milestone designation of the PR. Should `develop` be used for a new minor/patch release, `doc/cjdns.md` will have to be modified to reflect the correct version number. ## Breaking changes No expected protocol or consensus changes. ## Checklist: - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)** - [x] I have added or updated relevant unit/integration/functional/e2e tests - [x] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: PastaPastaPasta: utACK 32f8fda Tree-SHA512: e23b22ca5edbe4c4abeab0bc07780303e68e7c4cc46b7697300b0837c5acd3a98649b6b03bd07a23c827bd85f64210173027b0b0eea31872c031fa4ed04eeb0c
- Loading branch information
Showing
25 changed files
with
546 additions
and
115 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# CJDNS support in Dash Core | ||
|
||
It is possible to run Dash Core over CJDNS, an encrypted IPv6 network that | ||
uses public-key cryptography for address allocation and a distributed hash table | ||
for routing. | ||
|
||
## What is CJDNS? | ||
|
||
CJDNS is like a distributed, shared VPN with multiple entry points where every | ||
participant can reach any other participant. All participants use addresses from | ||
the `fc00::/8` network (reserved IPv6 range). Installation and configuration is | ||
done outside of Dash Core, similarly to a VPN (either in the host/OS or on | ||
the network router). | ||
|
||
Compared to IPv4/IPv6, CJDNS provides end-to-end encryption and protects nodes | ||
from traffic analysis and filtering. | ||
|
||
Used with Tor and I2P, CJDNS is a complementary option that can enhance network | ||
redundancy and robustness for both the Dash network and individual nodes. | ||
|
||
Each network has different characteristics. For instance, Tor is widely used but | ||
somewhat centralized. I2P connections have a source address and I2P is slow. | ||
CJDNS is fast but does not hide the sender and the recipient from intermediate | ||
routers. | ||
|
||
## Installing CJDNS and connecting to the network | ||
|
||
To install and set up CJDNS, follow the instructions at | ||
https://github.com/cjdelisle/cjdns#cjdns. | ||
|
||
Don't skip steps | ||
["2. Find a friend"](https://github.com/cjdelisle/cjdns#2-find-a-friend) and | ||
["3. Connect your node to your friend's | ||
node"](https://github.com/cjdelisle/cjdns#3-connect-your-node-to-your-friends-node). | ||
You need to be connected to the CJDNS network before it will work with your | ||
Dash Core node. | ||
|
||
Typically, CJDNS might be launched from its directory with | ||
`sudo ./cjdroute < cjdroute.conf` and it sheds permissions after setting up the | ||
[TUN](https://en.wikipedia.org/wiki/TUN/TAP) interface. You may also [launch it as an | ||
unprivileged user](https://github.com/cjdelisle/cjdns/blob/master/doc/non-root-user.md) | ||
with some additional setup. | ||
|
||
The network connection can be checked by running `./tools/peerStats` from the | ||
CJDNS directory. | ||
|
||
## Run Dash Core with CJDNS | ||
|
||
Once you are connected to the CJDNS network, the following Dash Core | ||
configuration option makes CJDNS peers automatically reachable: | ||
|
||
``` | ||
-cjdnsreachable | ||
``` | ||
|
||
When enabled, this option tells Dash Core that it is running in an | ||
environment where a connection to an `fc00::/8` address will be to the CJDNS | ||
network instead of to an [RFC4193](https://datatracker.ietf.org/doc/html/rfc4193) | ||
IPv6 local network. This helps Dash Core perform better address management: | ||
- Your node can consider incoming `fc00::/8` connections to be from the CJDNS | ||
network rather than from an IPv6 private one. | ||
- If one of your node's local addresses is `fc00::/8`, then it can choose to | ||
gossip that address to peers. | ||
|
||
## Additional configuration options related to CJDNS | ||
|
||
``` | ||
-onlynet=cjdns | ||
``` | ||
|
||
Make automatic outbound connections only to CJDNS addresses. Inbound and manual | ||
connections are not affected by this option. It can be specified multiple times | ||
to allow multiple networks, e.g. onlynet=cjdns, onlynet=i2p, onlynet=onion. | ||
|
||
CJDNS support was added to Dash Core in version 21.0 and there may be fewer | ||
CJDNS peers than Tor or IP ones. You can use `dash-cli -addrinfo` to see the | ||
number of CJDNS addresses known to your node. | ||
|
||
In general, a node can be run with both an onion service and CJDNS (or any/all | ||
of IPv4/IPv6/onion/I2P/CJDNS), which can provide a potential fallback if one of | ||
the networks has issues. There are a number of ways to configure this; see | ||
[doc/tor.md](https://github.com/dashpay/dash/blob/master/doc/tor.md) for | ||
details. | ||
|
||
## CJDNS-related information in Dash Core | ||
|
||
There are several ways to see your CJDNS address in Dash Core: | ||
- in the "Local addresses" output of CLI `-netinfo` | ||
- in the "localaddresses" output of RPC `getnetworkinfo` | ||
|
||
To see which CJDNS peers your node is connected to, use `dash-cli -netinfo 4` | ||
or the `getpeerinfo` RPC (i.e. `dash-cli getpeerinfo`). | ||
|
||
To see which CJDNS addresses your node knows, use the `getnodeaddresses 0 cjdns` | ||
RPC. |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Updated settings | ||
---------------- | ||
|
||
- If `-proxy=` is given together with `-noonion` then the provided proxy will | ||
not be set as a proxy for reaching the Tor network. So it will not be | ||
possible to open manual connections to the Tor network for example with the | ||
`addnode` RPC. To mimic the old behavior use `-proxy=` together with | ||
`-onlynet=` listing all relevant networks except `onion`. |
This file contains 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
This file contains 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
Oops, something went wrong.