b35a3d6574
There has been over 1 year of commit history leading up to this point, but almost all of that has had some kind network configuration or secrets built into the code. As of today all of that has been removed, and the codebase can finally be published! I am keeping a private copy of the previous commit history, though it's unclear if it will ever be able to be published.
109 lines
2.9 KiB
Markdown
109 lines
2.9 KiB
Markdown
# Getting Started
|
|
|
|
This document will guide you through the process of obtaining a cryptic-net
|
|
binary and joining the network.
|
|
|
|
NOTE currently only linux machines with amd64/x86_64 processors are supported.
|
|
More OSs and architectures coming soon!
|
|
|
|
## Obtaining a cryptic-net Binary
|
|
|
|
Every host can have a binary built for it which has all configuration for that
|
|
host embedded directly into it. Such binaries require no extra configuration by
|
|
the user to use, and have no dependencies on anything else in the user's system.
|
|
|
|
The process of obtaining a custom binary for your host is quite simple: ask an
|
|
admin of the network you'd like to join to give you one!
|
|
|
|
Note that if you'd like to join the network on multiple devices, each device
|
|
will needs its own binary, so be sure to tell your admin how many you want to
|
|
add and their names.
|
|
|
|
### Obtaining a cryptic-net Binary, the Hard Way
|
|
|
|
Alternatively, you can build your own binary by running the following from the
|
|
project's root:
|
|
|
|
```
|
|
nix-build -A appImage
|
|
```
|
|
|
|
The resulting binary can be found in the `result` directory which is created.
|
|
|
|
In this case you will need an admin to provide you with a `bootstrap.tgz` for
|
|
your host, rather than a custom binary. When running the daemon in the following
|
|
steps you will need to provide the `--bootstrap-path` CLI argument to the daemon
|
|
process.
|
|
|
|
## Running the Daemon
|
|
|
|
Once you have a binary, you will need to run the `daemon` sub-command as the
|
|
root user. This can most easily be done using the `sudo` command, in a terminal:
|
|
|
|
```
|
|
sudo /path/to/cryptic-net daemon
|
|
```
|
|
|
|
This will start the daemon process, which will keep running until you kill it
|
|
with `ctrl-c`.
|
|
|
|
You can double check that the daemon is running properly by pinging a private IP
|
|
from the network in a separate terminal:
|
|
|
|
```
|
|
ping 10.10.0.1
|
|
```
|
|
|
|
If the pings are successful then your daemon is working!
|
|
|
|
## Installing the Daemon as a Systemd Service
|
|
|
|
NOTE in the future we will introduce an `install` sub-command which will
|
|
automate most of this section.
|
|
|
|
Rather than running the daemon manually, you can install it as a systemd
|
|
service. This way your daemon will automatically start in the background on
|
|
startup, and will be restarted if it has any issues.
|
|
|
|
To do so, create a file at `/etc/systemd/system/cryptic-net.service` with the
|
|
following contents:
|
|
|
|
```
|
|
[Unit]
|
|
Description=cryptic-net
|
|
Requires=network.target
|
|
After=network.target
|
|
|
|
[Service]
|
|
Restart=always
|
|
RestartSec=1s
|
|
User=root
|
|
ExecStart=/path/to/cryptic-net daemon
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
```
|
|
|
|
Remember to change the `/path/to/cryptic-net` part to the actual absolute path
|
|
to your binary!
|
|
|
|
Once created, perform the following commands in a terminal to enable the
|
|
service:
|
|
|
|
```
|
|
sudo systemctl daemon-reload
|
|
sudo systemctl enable --now cryptic-net
|
|
```
|
|
|
|
You can check the service's status by doing:
|
|
|
|
```
|
|
sudo systemctl status cryptic-net
|
|
```
|
|
|
|
and you can view its full logs by doing:
|
|
|
|
```
|
|
sudo journalctl -lu cryptic-net
|
|
```
|