doc/tor-guide: Clean up and formatting

This commit is contained in:
x
2026-01-05 09:13:53 +00:00
parent a9e1f04a9f
commit 3ab39ece15
2 changed files with 50 additions and 48 deletions

View File

@@ -1,44 +1,44 @@
# Set-up a Tor-enabled node
# Set up a Tor-enabled node
_To connect to Tor, we use [Arti](https://gitlab.torproject.org/tpo/core/arti).
Arti is an experimental project with incomplete security features. See Arti's
[roadmap](https://gitlab.torproject.org/tpo/core/arti#roadmap) for more
information._
Arti is an experimental project with incomplete security features.
See Arti's [roadmap](https://gitlab.torproject.org/tpo/core/arti#roadmap)
for more information._
<u><b>Note</b></u>: This page is a general guide for `tor` nodes in the DarkFi
ecosystem and is applicable to other apps such as `taud` and `darkfid`. We use
`darkirc` as our main example throughout this guide. Commands such as `./darkirc`
and configuration filenames need to be adjusted if using different apps.
If you're using another app, the network configurations remain the same except
for the seed nodes you connect to.
<u><b>Note</b></u>: This page is a general guide for `tor` nodes in the
DarkFi ecosystem and is applicable to other apps such as `taud` and
`darkfid`. We use `darkirc` as our main example throughout this guide.
If you're using another app, the network configurations remain the same
except for the seed nodes (ports) you connect to.
## Generating configuration files
After compiling, you can start the application so it can spawn its configuration
file. We use `darkirc` as the application example going forward.
After compiling, you can start the application so it can spawn its
configuration file.
```shell
% ./darkirc
```
`darkirc` creates a configuration file `darkirc_config.toml` by default in
`~/.config/darkfi/`. You will review and edit this configuration file for your
preferred network settings.
`darkirc` creates a configuration file `darkirc_config.toml` by default
in `~/.config/darkfi/`. You will review and edit this configuration file
for your preferred network settings.
## Configure network settings
Modify the network settings located in the `~/.config/darkfi` directory. This
configuration allows your node to send and receive traffic only via Tor.
Modify the network settings located in the `~/.config/darkfi` directory.
This configuration allows your node to send and receive traffic only
via Tor.
<u><b>Note</b></u>: As you modify the file, if you notice some settings are missing,
simply add them. Some settings may be commented-out by default. In the example
configurations below, you will find the a placeholder `youraddress.onion` which
indicates you should replace them with your onion address.
<u><b>Note</b></u>: As you modify the file, if you notice some settings
are missing, simply add them. Some settings may be commented-out by
default.
### Outbound node settings
These outbound node settings for your `tor` node configuration is only for
connecting to the network. You will not advertise an external address.
These outbound node settings for your `tor` node configuration is only
for connecting to the network. You will not advertise an external
address.
```toml
## connection settings
@@ -56,23 +56,24 @@ mixed_profiles = []
[net.profiles."tor"]
## Seed nodes to connect to
seeds = [
"tor://g7fxelebievvpr27w7gt24lflptpw3jeeuvafovgliq5utdst6xyruyd.onion:25552",
"tor://yvklzjnfmwxhyodhrkpomawjcdvcaushsj6torjz2gyd7e25f3gfunyd.onion:25552",
"tor://g7fxelebievvpr27w7gt24lflptpw3jeeuvafovgliq5utdst6xyruyd.onion:9601",
"tor://yvklzjnfmwxhyodhrkpomawjcdvcaushsj6torjz2gyd7e25f3gfunyd.onion:9601",
]
```
#### Socks5 proxy node settings
If we want to route all our connections through the `socks5` proxy provided by Tor,
we can add the `socks5` and `socks5+tls` profiles to `active_profiles` and enable
transport mixing by adding `tor` and `tcp+tls` to `mixed_profiles`. Enabling
transport mixing helps us to connect to `tor` and `tcp+tls` endpoints through
our socks5 proxy.
#### SOCKS5 proxy node settings
If we want to route all our connections through the `SOCKS5` proxy
provided by Tor, we can add the `socks5` and `socks5+tls` profiles
to `active_profiles` and enable transport mixing by adding `tor` and
`tcp+tls` to `mixed_profiles`. Enabling transport mixing helps us
connect to `tor` and `tcp+tls` endpoints through our SOCKS5 proxy.
When using `Whonix`, this configuration helps prevent the `Tor over Tor` issue.
Ensure that the `tor_socks5_proxy` field is correctly set.
When using `Whonix`, this configuration helps prevent the `Tor over
Tor` issue. Ensure that the `tor_socks5_proxy` field is correctly set.
<u><b>Note</b></u>: With this setup, our node will connect to both Tor
and clearnet nodes through the Socks5 proxy.
<u><b>Note</b></u>: With this setup, our node will connect to both Tor and clearnet
nodes through the Socks5 proxy.
```toml
## Whitelisted transports for outbound connections
active_profiles = ["socks5", "socks5+tls", "tcp+tls", "tor"]
@@ -81,7 +82,10 @@ mixed_profiles = ["tor", "tcp+tls"]
## Tor Socks5 proxy
tor_socks5_proxy = "socks5://127.0.0.1:9050"
```
If you prefer to connect only to `tor` nodes, modify the above config like below.
If you prefer to connect only to `tor` nodes, modify the above config
like below:
```toml
## Whitelisted transports for outbound connections
active_profiles = ["socks5", "tor"]
@@ -109,13 +113,13 @@ will receive Inbound connections on. Set this in your config file with
a port number of your choice:
```
inbound = ["tor://127.0.0.1:25551"]
inbound = ["tor://127.0.0.1:9601"]
```
On running your node, you should get a message like this:
```
[INFO] [P2P] Starting Inbound session #0 on tor://127.0.0.1:25551/
[INFO] [P2P] Starting Inbound session #0 on tor://127.0.0.1:9601/
```
This means your ephemeral onion is active and awaiting connections.
@@ -125,8 +129,9 @@ This means your ephemeral onion is active and awaiting connections.
Alternatively, we can set up a static Tor daemon and create a hidden
service. The following instructions should work on any Linux system.
First, you must install [Tor](https://www.torproject.org/). It can usually be
installed with your package manager. For example on an `apt` based system we can run:
First, you must install [Tor](https://www.torproject.org/). It can
usually be installed with your package manager. For example on an `apt`
based system we can run:
```
% apt install tor
@@ -138,7 +143,7 @@ lines in the file:
```
HiddenServiceDir /var/lib/tor/darkfi_darkirc
HiddenServicePort 25551 127.0.0.1:25551
HiddenServicePort 9601 127.0.0.1:9601
```
Then restart Tor:
@@ -162,10 +167,10 @@ inbound_connections = 64
[net.profiles."tor"]
## Addresses we want to advertise to peers
external_addrs = ["tor://youraddress.onion:25551"]
external_addrs = ["tor://youraddress.onion:9601"]
## P2P accept addresses
inbound = ["tcp://127.0.0.1:25551"]
inbound = ["tcp://127.0.0.1:9601"]
```
## Connect and test your node
@@ -175,7 +180,8 @@ Run `./darkirc`. Welcome to the dark forest.
You can test if your node is configured properly on the network. Use
[Dnet](../../learn/dchat/network-tools/using-dnet.md) and the
[ping-tool](../network-troubleshooting.md#ping-tool) to test your node
connections. You can view if your node is making inbound and outbound connections.
connections. You can view if your node is making inbound and outbound
connections.
## Troubleshooting

View File

@@ -126,10 +126,6 @@ file.
For detailed instructions and configuration options on how to do this,
follow the [Tor Guide](../misc/nodes/tor-guide.md#configure-network-settings).
The guide is using `darkirc` port `25552` for seeds and `25551` for
`torrc` configuration, so in your actual configuration replace them
with `darkfid` ones, where seeds use port `8343` and `torrc` should
use port `8342`.
### Wallet initialization