Merge branch 'bootstrap-setup-instructions' into 'main'

Add bootstrap setup instructions

See merge request veilid/veilid!197
This commit is contained in:
TC 2023-09-21 13:30:48 +00:00
commit 9b1bc5d9a2
8 changed files with 242 additions and 6 deletions

89
BOOTSTRAP-SETUP.md Executable file
View File

@ -0,0 +1,89 @@
# Starting a Generic/Public Veilid Bootstrap Server
## Instance Recommended Setup
CPU: Single
RAM: 1GB
Storage: 25GB
IP: Static v4 & v6
Firewall: 5150/TCP/UDP inbound allow all
## Install Veilid
Follow instructions in [INSTALL.md](./INSTALL.md)
## Configure Veilid as Bootstrap
### Stop the Veilid service
```shell
sudo systemctl stop veilid-server.service
```
### Setup the config
In _/etc/veilid-server/veilid-server.conf`_ ensure _bootstrap: ['bootstrap.<your.domain>']_ in the _routing_table:_ section
If you came here from the [dev network setup](./dev-setup/dev-network-setup.md) guide, this is when you set the network key.
**Switch to veilid user**
```shell
sudo -u veilid /bin/bash
```
### Generate a new keypair
Copy the output to secure storage such as a password manager. This information will be used in the next step and can be used for node recovery, moving to a different server, etc.
```shell
veilid-server --generate-key-pair
```
### Create new node ID and flush existing route table
Include the brackets [] when pasting the keys. Use the public key in the command. Secret key will be requested interactively and will not echo when pasted.
```shell
veilid-server --set-node-id [PUBLIC_KEY] --delete-table-store
```
### Generate the DNS TXT record
Copy the output to secure storage. This information will be use to setup DNS records.
```shell
veilid-server --dump-txt-record
```
### Start the Veilid service
Disconnect from the Veilid user and start veilid-server.service.
```shell
exit
```
```shell
sudo systemctl start veilid-server.service
```
Optionally configure the service to start at boot `sudo systemctl enable veilid-server.service`
_REPEAT FOR EACH BOOTSTRAP SERVER_
## Enter DNS Records
Create the following DNS Records for your domain:
(This example assumes two bootstrap serves are being created)
| Record | Value | Record Type |
|-----------|-----------------------------|-------------|
|bootstrap | 1,2 | TXT |
|1.bootstrap| IPv4 | A |
|1.bootstrap| IPv6 | AAAA |
|1.bootstrap| output of --dump-txt-record | TXT |
|2.bootstrap| IPv4 | A |
|2.bootstrap| IPv6 | AAAA |
|2.bootstrap| output of --dump-txt-record | TXT |

View File

@ -6,7 +6,7 @@ Before you get started, please review our [Code of Conduct](./code_of_conduct.md
To begin crafting code to contribute to the Veilid project, first set up a [development environment](./DEVELOPMENT.md). [Fork] and clone the project into your workspace; check out a new local branch and name it in a way that describes the work being done. This is referred to as a [feature branch]. To begin crafting code to contribute to the Veilid project, first set up a [development environment](./DEVELOPMENT.md). [Fork] and clone the project into your workspace; check out a new local branch and name it in a way that describes the work being done. This is referred to as a [feature branch].
Some contributions might introduce changes that are incompatible with other existing nodes. In this case it is recommended to also set a development network *Guide Coming Soon*. Some contributions might introduce changes that are incompatible with other existing nodes. In this case it is recommended to also setup a [development network](./dev-setup/dev-network-setup.md).
Once you have added your new function or addressed a bug, test it locally to ensure it's working as expected. If needed, test your work in a development network with more than one node based on your code. Once you're satisfied your code works as intended and does not introduce negative results or new bugs, follow the merge requests section below to submit your work for maintainer review. Once you have added your new function or addressed a bug, test it locally to ensure it's working as expected. If needed, test your work in a development network with more than one node based on your code. Once you're satisfied your code works as intended and does not introduce negative results or new bugs, follow the merge requests section below to submit your work for maintainer review.

View File

@ -0,0 +1,42 @@
# Dev Network Setup
## Purpose
There will be times when a contibutor wishes to dynamically test their work on live nodes. Doing so on the actual Veilid network would likely not yield productive test outcomes and so setting up an independent network for testing purposes is warranted.
This document outlines the process of using the steps found in [INSTALL.md](../INSTALL.md) and [BOOTSTRAP-SETUP.md](../BOOTSTRAP-SETUP.md) with some modifications which results in a reasonably isolated and independent network of Veilid development nodes which do not communicate with nodes on the actual Veilid network.
The minimum topology of a dev network is 1 bootstrap server and 4 nodes, all with public IP addresses with port 5150/TCP open. This allows enabling public address detection and private routing. The minimum specifications are 1 vCPU, 1GB RAM, and 25 GB storage.
## Quick Start
### The Network Key
This acts as a passphase to allow nodes to join the network. It is the mechanism that makes your dev network isolated and independent. Create a passphrase and protect/store it as you would any other a password.
### Dev Bootstrap Server
Follow the steps detailed in [BOOTSTRAP-SETUP.md](../BOOTSTRAP-SETUP.md) using the dev bootstrap example [config](../doc/config/veilid-dev-bootstrap-config.md) for the *Setup the config* section. Set a _network_key_password_ in the config file.
### Dev Nodes
1. Follow the steps detailed in [INSTALL.md](../INSTALL.md) *DO NOT START THE SYSTEMD SERVICE*
2. Replace the default veilid-server config using the dev node example [config](../doc/config/veilid-dev-server-config.md) as a template. Enter your information on lines 27 and 28 to match what was entered in the dev bootstrap server's config.
3. Start the node with fresh data
```shell
sudo -u veilid veilid-server --delete-protected-store --delete-block-store --delete-table-store`
```
4. `ctrl-c` to stop the above process
5. Start the dev node service
```shell
sudo systemctl start veilid-server.service
```
6. (Optionally) configure the service to start at boot
```shell
sudo systemctl enable veilid-server.service
```

View File

@ -0,0 +1,33 @@
# Veilid Server
# =============
#
# Public Bootstrap Server Configuration
#
# -----------------------------------------------------------
---
logging:
system:
enabled: true
level: debug
api:
enabled: true
level: debug
terminal:
enabled: false
core:
capabilities:
disable: ['TUNL','SGNL','RLAY','DIAL','DHTV','APPM']
network:
upnp: false
dht:
min_peer_count: 2
detect_address_changes: false
routing_table:
bootstrap: ['bootstrap.<your.domain>']
protected_store:
insecure_fallback_directory: '/var/db/veilid-server/protected_store'
table_store:
directory: '/var/db/veilid-server/table_store'
block_store:
directory: '/var/db/veilid-server/block_store'

View File

@ -0,0 +1,39 @@
# Veilid Server
# =============
#
# Private Development Bootstrap Server Configuration
#
# This config is templated to setup a bootstrap server with
# a network_key_password. Set the network key to whatever you
# like. Treat it like a password. Use the same network key in
# the config files for at least four nodes to establish an
# independent Veilid network for private or development uses.
# -----------------------------------------------------------
---
logging:
system:
enabled: true
level: debug
api:
enabled: true
level: debug
terminal:
enabled: false
core:
capabilities:
disable: ['TUNL','SGNL','RLAY','DIAL','DHTV','APPM']
network:
upnp: false
dht:
min_peer_count: 2
detect_address_changes: false
routing_table:
bootstrap: ['bootstrap.<your.domain>']
network_key_password: '<your-chosen-passkey>'
protected_store:
insecure_fallback_directory: '/var/db/veilid-server/protected_store'
table_store:
directory: '/var/db/veilid-server/table_store'
block_store:
directory: '/var/db/veilid-server/block_store'

View File

@ -0,0 +1,38 @@
# Veilid Server
# =============
#
# Private Development Node Configuration
#
# This config is templated to setup a Velid node with a
# network_key_password. Set the network key to whatever you
# set within your private bootstrap server's config. Treat it
# like a password.
# -----------------------------------------------------------
---
logging:
system:
enabled: true
level: debug
api:
enabled: true
level: debug
terminal:
enabled: false
core:
capabilities:
disable: ['APPM']
network:
upnp: false
dht:
min_peer_count: 10
detect_address_changes: false
routing_table:
bootstrap: ['bootstrap.<your.domain>']
network_key_password: '<your-chosen-passkey>'
protected_store:
insecure_fallback_directory: '/var/db/veilid-server/protected_store'
table_store:
directory: '/var/db/veilid-server/table_store'
block_store:
directory: '/var/db/veilid-server/block_store'

View File

@ -14,7 +14,6 @@
<div style="font-family: monospace; font-size: 3em; font-weight: bold; background-color: red; color: white; padding: 0.5em;"> <div style="font-family: monospace; font-size: 3em; font-weight: bold; background-color: red; color: white; padding: 0.5em;">
early α docs<br/> early α docs<br/>
please don't share publicly
</div> </div>
<h1>Veilid Architecture Guide</h1> <h1>Veilid Architecture Guide</h1>

View File

@ -1,7 +1,3 @@
# early α docs
# please don't share publicly
# Veilid Architecture Guide # Veilid Architecture Guide
- [From Orbit](#from-orbit) - [From Orbit](#from-orbit)