diff --git a/BOOTSTRAP-SETUP.md b/BOOTSTRAP-SETUP.md new file mode 100755 index 00000000..1f2ca219 --- /dev/null +++ b/BOOTSTRAP-SETUP.md @@ -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.']_ 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 | diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9d8e949e..6f621442 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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]. -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. diff --git a/dev-setup/dev-network-setup.md b/dev-setup/dev-network-setup.md new file mode 100644 index 00000000..e5e822bb --- /dev/null +++ b/dev-setup/dev-network-setup.md @@ -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 + ``` diff --git a/doc/config/veilid-bootstrap-config b/doc/config/veilid-bootstrap-config new file mode 100644 index 00000000..7988de7c --- /dev/null +++ b/doc/config/veilid-bootstrap-config @@ -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.'] + 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' \ No newline at end of file diff --git a/doc/config/veilid-dev-bootstrap-config b/doc/config/veilid-dev-bootstrap-config new file mode 100644 index 00000000..936effb3 --- /dev/null +++ b/doc/config/veilid-dev-bootstrap-config @@ -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.'] + network_key_password: '' + 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' \ No newline at end of file diff --git a/doc/config/veilid-dev-node-config b/doc/config/veilid-dev-node-config new file mode 100644 index 00000000..f2bf161d --- /dev/null +++ b/doc/config/veilid-dev-node-config @@ -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.'] + network_key_password: '' + 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' \ No newline at end of file diff --git a/doc/guide/guide.html b/doc/guide/guide.html index b2f641b2..7ec8bf31 100644 --- a/doc/guide/guide.html +++ b/doc/guide/guide.html @@ -14,7 +14,6 @@
early α docs
- please don't share publicly

Veilid Architecture Guide

diff --git a/doc/guide/guide.md b/doc/guide/guide.md index 6c5d63b8..58e57229 100644 --- a/doc/guide/guide.md +++ b/doc/guide/guide.md @@ -1,7 +1,3 @@ -# early α docs - -# please don't share publicly - # Veilid Architecture Guide - [From Orbit](#from-orbit)