Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions en/FAQ/many-nodes-same-machine.md

This file was deleted.

4 changes: 2 additions & 2 deletions en/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
* [Type-I and II censorship resistance](wiki/type-i-and-ii-censorship-resistance.md)
* [Network architecture](wiki/architecture.md)
* [Protocols](wiki/protocols/README.md)
* [N2R (node-to-relay) protocol](wiki/protocols/n2r-protocol.md)
* [Mixnet protocol](wiki/protocols/mix-protocol.md)
* [GlobalRPC](wiki/protocols/globalrpc.md)
* [Haven protocol](wiki/protocols/haven-protocol.md)
* [Link protocol](wiki/protocols/link-protocol.md)
* ["LowNet" transport protocol](wiki/protocols/lownet-protocol.md)
* [Stream protocol](wiki/protocols/stream-protocol.md)
* [WIP: Debt accounting](wiki/protocols/debt-accounting.md)
* [Onion packet format](wiki/onion-packet-format/README.md)
Expand Down
23 changes: 22 additions & 1 deletion en/faq/1+-nodes-on-1-machine.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,23 @@
# 1+ nodes on 1 machine
# Running 1+ nodes on 1 machine

Running more than 1 Earendil node on the same machine is quite easy:

1. Create a separate config file for each node. Be sure to add the following 3 fields, with different values, to each config file:

```yaml
# where to store this Earendil daemon's database.
# make sure the Earendil daemon can access this location
db_path: /your/path/node1.db

# listen port for this daemon's control protocol
control_listen: 127.0.0.1:<node1_control_port>

# listen port for socks5 proxy
socks5:
listen: 127.0.0.1:<node1_socks5_port>
fallback: pass_through
```

Manually specifying these fields is necessary when you're running more than 1 Earendil node on the same machine, because otherwise the different nodes will try to use the same default value. And two daemon cannot use the same database or listen to the same port!

2. Start a separate daemon for each node using the config files.
21 changes: 5 additions & 16 deletions en/getting-started/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ db_path: ./.cache/earendil
control_listen: 127.0.0.1:11111

# ------------------------ routing config ----------------------------
# relays to connect to as neighbors. Client configs *must* contain at least one `out_route`; optional for relays.
out_routes:
# relays to connect to as neighbors. Client configs *must* contain at least one `out_link`; optional for relays.
out_links:
example-relay:
# IP address and port where the relay is listening for incoming connections
connect: 62.210.93.59:12345
Expand All @@ -30,17 +30,6 @@ out_routes:
# - `sosistab3`: a TCP-based obfuscated transport with a symmetric cookie, defined by the relay. This obfuscation protocol is developed as a part of [geph5](https://github.com/geph-official/geph5)
obfs:
sosistab3: shove-mistake-wish-endless-antique-citizen-filter-employ-cigar-clip-acid-defense
# price and debt config for this link
price_config:
# how much you charge per incoming packet, in µMELs
inbound_price: 0
# debt limit for inbound packets, in µMELs
inbound_debt_limit: 0
# max price you're willing to pay per outgoing packet, in µMELs
outbound_max_price: 10
# min debt limit you accept for outbound packets, in µMELs
# Negative debt limit means prepayment is required
outbound_min_debt_limit: -100
# more relays to connect to
relay-2:
connect: ...
Expand Down Expand Up @@ -106,20 +95,20 @@ relay_config:
identity_file: /your/path/identity.secret

# where & how to accept incoming connections
in_routes:
in_links:
main_obfs:
# obfuscation protocol to use, for resisting ISP-level censorship
obfs:
sosistab3: snake-before-antenna-toward-floor-stuff-frozen-power-avocado-retire-grunt-nation
# TCP port this in_route listens at
# TCP port this in_link listens at
listen: 0.0.0.0:19999
# price config for this route, in µMELs
price_config:
inbound_price: 5
inbound_debt_limit: 50000
outbound_max_price: 0
outbound_min_debt_limit: 0
# another in_route, with no obfuscation
# another in_link, with no obfuscation
no_obfs:
obfs: none
listen: 0.0.0.0:19998
Expand Down
14 changes: 2 additions & 12 deletions en/getting-started/havens.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,12 @@ This tutorial will teach you how to use and host basic Earendil havens.
You can access HTTP-based havens right in your browser. Paste the following config file into the "Settings" tab of your Earendil GUI:

```yaml
out_routes:
out_links:
example-relay-free:
connect: 62.210.93.59:12345
fingerprint: 4b7a641b77c2d6ceb8b3fecec2b2978dfe81ae045ed9a25ed78b828009c4967a
obfs:
sosistab3: "randomly-generated-cookie-lala-doodoo"
price_config:
inbound_price: 0
inbound_debt_limit: 0
outbound_max_price: 0
outbound_min_debt_limit: 0
```

Then, set your browser to use `localhost:30003` as a SOCKS5 proxy. For Firefox this looks like:
Expand Down Expand Up @@ -73,17 +68,12 @@ server {
Paste this config file into your Earendil GUI's "Settings" tab:

```yaml
out_routes:
out_links:
example-relay-free:
connect: 62.210.93.59:12345
fingerprint: 4b7a641b77c2d6ceb8b3fecec2b2978dfe81ae045ed9a25ed78b828009c4967a
obfs:
sosistab3: "randomly-generated-cookie-lala-doodoo"
price_config:
inbound_price: 0
inbound_debt_limit: 0
outbound_max_price: 0
outbound_min_debt_limit: 0

# havens we're hosting
havens:
Expand Down
7 changes: 1 addition & 6 deletions en/getting-started/host-proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,12 @@ Both client and relay Earendil nodes can host web proxies. When you host an Eare
To host a web proxy, paste this config file into the "Settings" tab of your Earendil GUI:

```yaml
out_routes:
out_links:
example-relay-free:
connect: 62.210.93.59:12345
fingerprint: 4b7a641b77c2d6ceb8b3fecec2b2978dfe81ae045ed9a25ed78b828009c4967a
obfs:
sosistab3: "randomly-generated-cookie-lala-doodoo"
price_config:
inbound_price: 0
inbound_debt_limit: 0
outbound_max_price: 0
outbound_min_debt_limit: 0

exit_config: # you want to be an exit node
allowed_ports: # destination ports that your exit node will allow; to only allow browsing http and https websites through your proxy, only put 80 and 443 here
Expand Down
12 changes: 8 additions & 4 deletions en/getting-started/pay.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Pay and get paid

{% hint style="warning" %}
This is a **design document** for an _unimplemented_ feature.
{% endhint %}

In the Earendil network, nodes pay and get paid by their _immediate neighbors_.

This creates a free market for bandwidth --- if one neighbor is too expensive or unreliable, simply disconnect from them and find a cheaper or more reliable provider. Once you pay your neighbor, it's their responsibility to route your packets to their destinations. This is just like using the internet: you pay your ISP (like T-Mobile) and don't worry about the rest.
Expand All @@ -8,10 +12,10 @@ To learn more about Earendil's incentive system, read [this post](https://nullch

## Price & debt limit

Two neighbors agree **out-of-band** on a price and debt limit for sending packets when they first connect to each other. They then specify this information in the `price_config` section of the `in_route` or `out_route` block:
Two neighbors agree **out-of-band** on a price and debt limit for sending packets when they first connect to each other. They then specify this information in the `price_config` section of the `in_link` or `out_link` block:

```yaml
# every in_route and out_route has a price_config
# every in_link and out_link has a price_config
price_config:
# how much you charge per incoming packet, in µMEL
inbound_price: 5
Expand All @@ -26,7 +30,7 @@ price_config:
outbound_min_debt_limit: -100
```

As an example, say we have relay Alice and client Bob. Alice has this `price_config` in her in_route for Bob:
As an example, say we have relay Alice and client Bob. Alice has this `price_config` in her in_link for Bob:

```yaml
price_config:
Expand All @@ -36,7 +40,7 @@ price_config:
outbound_min_debt_limit: 0
```

While Bob has this `price_config` in his out_route for connecting to Alice:
While Bob has this `price_config` in his out_link for connecting to Alice:

```yaml
price_config:
Expand Down
2 changes: 1 addition & 1 deletion en/getting-started/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Paste this config file into your Settings tab:

```yaml
# relays to connect to
out_routes:
out_links:
# arbitrary name for this relay
example-relay-free:
# IP and port where the relay is listening
Expand Down
21 changes: 5 additions & 16 deletions en/getting-started/run-relay.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,32 @@
# Run a relay

We currently only support running relays using the CLI version. Relays should be run on machines with public IP addresses.
We currently only support running relays using the CLI version. **Relays should be run on machines with public IP addresses**.

Relays and clients nodes use the same `earendil` executable. The defining difference is in their config file: relay configs have a `relay_config` section that specifies `identity_file` (to store the relay's long-term identity) and `in_routes` (where and how to accept incoming connections), while client configs do not.
Relays and clients nodes use the same `earendil` executable. The defining difference is in their config file: relay configs have a `relay_config` section that specifies `identity_file` (to store the relay's long-term identity) and `in_links` (where and how to accept incoming connections), while client configs do not.

To run a relay, save this config file into a file named `relay-cfg.yaml`. Be sure to replace "/your/path/\` with an appropriate path:

```yaml
# neighbors, same as in client config
out_routes:
out_links:
example-relay-free:
connect: 62.210.93.59:12345
fingerprint: 4b7a641b77c2d6ceb8b3fecec2b2978dfe81ae045ed9a25ed78b828009c4967a
obfs:
sosistab3: "randomly-generated-cookie-lala-doodoo"
price_config:
inbound_price: 0
inbound_debt_limit: 0
outbound_max_price: 0
outbound_min_debt_limit: 0

# relay-only settings
relay_config:
# replace with a writable path for storing identity secret
identity_file: /your/path/earendil-relay-id.secret

in_routes:
in_links:
main_udp:
obfs:
# random seed for obfsudp cookie. Generate your own with `earendil generate-seed`
sosistab3: <your_random_seed>
# port where this in-route listens
listen: 0.0.0.0:19999
# price, debt limit etc. for this in-route
price_config:
inbound_price: 0
inbound_debt_limit: 0
outbound_max_price: 0
outbound_min_debt_limit: 0
```

You can learn about paying and getting paid on the Earendil network, as well as the `price_config` [here](pay.md).
Expand Down Expand Up @@ -69,7 +58,7 @@ main_udp:
outbound_min_debt_limit: 0
```

Replace `<YOUR_IP>` with your server's public IP address. Other nodes (both clients and relays) can simply paste this block into the `out_routes` section of their config file to add your relay as a neighbor.
Replace `<YOUR_IP>` with your server's public IP address. Other nodes (both clients and relays) can simply paste this block into the `out_links` section of their config file to add your relay as a neighbor.

{% hint style="warning" %}
To serve users in regions with internet censorship, you should _avoid_ posting your relay's contact information publicly. Instead, distribute it in a way that reaches legitimate users but not censors--your relay will be blacklisted if the censor learns its IP address!
Expand Down
27 changes: 26 additions & 1 deletion en/wiki/protocols/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,29 @@ Earendil presents a pretty simple interface (basically a virtual IPv6-like netwo

This is illustrated by the following picture. **Note that A->B means A **_**depends**_** on B**, not that A somehow sends data unidirectionally to B!

![](../../.gitbook/assets/protocols.png)
```mermaid
flowchart TB
subgraph network["Network layer"]
socket["Unified socket abstraction"]
haven["Haven protocol"]
dht["Rendezvous DHT"]
forward["Haven forwarding"]
rpc["GlobalRPC"]
mixnet["Mixnet protocol"]
onion["Onion routing"]
end
subgraph lownet["LowNet"]
link["Link transport"]
end
socket --> haven
haven --> dht & forward
dht --> rpc
forward --> mixnet
rpc --> mixnet
mixnet --> onion
socks["SOCKS5 interface"] --> sosistab["Optionally reliable streams (virta)"]
tcp["TCP port forwarding"] --> sosistab
sosistab --> socket
tun["tun-based VPN interface"] --> socket
onion --> link & routegraph[("Route graph")]
```
2 changes: 1 addition & 1 deletion en/wiki/protocols/debt-accounting.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Each sides refuses to peel/relay any packets until the other side has signaled a

`push_price` may be called at any point, with the understanding that the other side may take a while to apply the changes to how debt etc is calculated.

`in_route` and `out_route` in config files specify maximum allowable prices and debt limit ranges.
`in_link` and `out_link` in config files specify maximum allowable prices and debt limit ranges.

## Tracking debt

Expand Down
2 changes: 1 addition & 1 deletion en/wiki/protocols/globalrpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: RPC protocol that any node can call any node

# GlobalRPC

GlobalRPC is the primary RPC protocol exposed by all relays, that any node can call. It runs over the node-to-relay protocol (N2R).
GlobalRPC is the primary RPC protocol exposed by all relays, that any node can call. It runs over the [mixnet protocol](mix-protocol.md).

Like all RPC protocols in Earendil, it is based on JSON-RPC 2.0.

Expand Down
4 changes: 2 additions & 2 deletions en/wiki/protocols/haven-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ In this example, Bob is a haven, Rob is the rendezvous relay, and Alice is a cli

There is one RPC method exposed in the global RPC: `alloc_forward` which takes in a signed request from a particular fingerprint and instructs the relay to process forwarding packets to this particular fingerprint. Bob must call this method before any of the following happens:

* Alice sends N2R messages to Rob to a special, well-known dock (**dock number 100002**). The messages are of the format `(bob_endpoint, inner)`. The inner part is separately end-to-end encrypted between Alice and Bob, using the same packet format as the [N2R protocol](n2r-protocol.md), but without the padding and onion encryption.
* Alice sends N2R messages to Rob to a special, well-known dock (**dock number 100002**). The messages are of the format `(bob_endpoint, inner)`. The inner part is separately end-to-end encrypted between Alice and Bob, using the same packet format as the [N2R protocol](mix-protocol.md), but without the padding and onion encryption.
* Rob sends to Bob the messages with the inner part verbatim, tagged as `(inner, bob_endpoint)`.
* Bob sends messages to Alice by sending messages of the format `(inner, alice_endpoint)` to Rob. Rob's internal state is something like a NAT table --- it allows anyone to send messages to Bob, and it allows Bob to send messages to anybody who has talked to Bob, but it refuses to forward any other messages, so it's not an open proxy. Rob identifies "backwards" messages because they are coming from Bob, somebody who has registered forwarding with Rob.

## Socket abstraction

Similar to sockets in the [N2R protocol](n2r-protocol.md), we have a socket abstraction for haven communication.
Similar to sockets in the [N2R protocol](mix-protocol.md), we have a socket abstraction for haven communication.

Both havens and clients who wish to talk to havens use the same protocol:

Expand Down
42 changes: 0 additions & 42 deletions en/wiki/protocols/link-protocol.md

This file was deleted.

Loading