diff --git a/components/QuickStart.tsx b/components/QuickStart.tsx index ee8ffa68..7b9d0b3d 100644 --- a/components/QuickStart.tsx +++ b/components/QuickStart.tsx @@ -18,7 +18,7 @@ export const QuickStartArea = () => { description: `Start your journey on Tangle Network. This guide will walk you through the steps to become a validator, ensuring network security and integrity.`, name: "Validate on Tangle Network", }} - href="/docs/tangle-network/validator/quickstart/" + href="/docs/tangle-network/node/quickstart/" > { { description: `Want to spin up a full node on the Tangle Network? We've made it easier than ever!`, name: "Deploy a Tangle Node!", }} - href="/docs/tangle-network/getting-started/deploy-using-hardhat/" + href="/docs/tangle-network/node/docker-node" > { description: `Our easy-to-use testnet faucet allows you to claim test tokens with just a few clicks. Start experimenting with Hubble Bridge today.`, name: "Faucet dApp", }} - href="https://stats.tangle.tools" + href="https://faucet.tangle.tools" /> -``` - - - For an overview of the above flags, please refer to the [CLI Usage](/docs/ecosystem-roles/validator/api-reference/cli/) page of our documentation. - - -Once Docker pulls the necessary images, your Tangle node will start, displaying lots of information, -such as the chain specification, node name, role, genesis state, and more. - -If you followed the installation instructions for Tangle, once synced, you will be connected to peers and see -blocks being produced on the Tangle network! Note that in this case you need to also sync to the Polkadot/Kusama -relay chain, which might take a few days. - -### Update the Client - -As Tangle development continues, it will sometimes be necessary to upgrade your node software. Node operators will be notified -on our Discord channel when upgrades are available and whether they are necessary (some client upgrades are optional). -The upgrade process is straightforward and is the same for a full node. - -1. Stop the docker container: - -```sh filename="docker stop" copy -sudo docker stop `CONTAINER_ID` -``` - -2. Get the latest version of Tangle from the Tangle GitHub Release [page](https://github.com/webb-tools/tangle/pkgs/container/tangle%2Ftangle-standalone) - -3. Pull the latest version of Tangle binary by doing `docker pull ghcr.io/webb-tools/tangle/tangle-standalone:{VERSION_CODE}`. - Example, if the latest version of Tangle is v0.1.2, then the command would be `docker pull ghcr.io/webb-tools/tangle/tangle-standalone:v0.1.12` - -4. Restart the tangle container and you should have the updated version of the client. - -### Purge Your Node - -If you need a fresh instance of your Tangle node, you can purge your node by removing the associated data directory. - -You'll first need to stop the Docker container: - -```sh filename="docker stop" copy -sudo docker stop `CONTAINER_ID` -``` - -If you did not use the `-v` flag to specify a local directory for storing your chain data when you spun up your node, then the data folder is related to the Docker container itself. Therefore, removing the Docker container will remove the chain data. - -If you did spin up your node with the `-v` flag, you will need to purge the specified directory. For example, for the suggested data directly, you can run the following command to purge your parachain node data: - -```sh filename="rm" copy -# purges standalone data -sudo rm -rf /data/chains/* -``` - -If you ran with parachain node you can run the following command to purge your relay-chain node data: - -```sh filename="rm" copy -# purges relay chain data -sudo rm -rf /data/polkadot/* -``` - -Now that your chain data has been purged, you can start a new node with a fresh data directory! - -## Logs - -If you'd like to run the node with verbose logs, you may add the following arguments during initial setup. Adjust the target for the desired logging level (debug | error | info| trace | warn): - -```bash --ldkg=debug \ --ldkg_metadata=debug \ --lruntime::offchain=debug \ --ldkg_proposal_handler=debug \ --ldkg_proposals=debug -``` diff --git a/pages/docs/tangle-network/node/deploy-with-docker/validator-node.mdx b/pages/docs/tangle-network/node/docker-node.mdx similarity index 74% rename from pages/docs/tangle-network/node/deploy-with-docker/validator-node.mdx rename to pages/docs/tangle-network/node/docker-node.mdx index a1c18eef..52744cd4 100644 --- a/pages/docs/tangle-network/node/deploy-with-docker/validator-node.mdx +++ b/pages/docs/tangle-network/node/docker-node.mdx @@ -1,21 +1,22 @@ --- title: Deploying with Docker -description: Deploy a Tangle validator node with only a few steps. +description: Deploy a Tangle node with only a few steps using Docker. --- -import Callout from "../../../../../components/Callout"; +import Callout from "../../../../components/Callout"; +import { Tabs } from 'nextra/components'; -# Deploying with Docker +# Deploying a Tangle Network Node with Docker -A Tangle node can be spun up quickly using Docker. For more information on installing Docker, -please visit the official Docker [docs](https://docs.docker.com/get-docker/). When connecting to Tangle on Kusama, it will take a few days to completely sync the embedded relay chain. Make sure that your system meets the requirements which can read [here](/docs/tangle-network/node-operators/requirements). +A Tangle Network node can be spun up quickly using Docker. **This guide covers both Full Node and Validator Node deployment.** . For more information on installing Docker, +please visit the official Docker [docs](https://docs.docker.com/get-docker/). Make sure that your system meets the requirements which can read [here](https://docs.webb.tools/docs/ecosystem-roles/validator/requirements/). -## Standalone Testnet +## Setup the Docker Environment -### **1. Pull the Tangle Docker image:** +The quickest and easiest way to get started is to make use of our published Docker Tangle image. In doing so, users simply pull down the image from ghcr.io, +set their keys, fetch the applicable chainspec and run the start command to get up and running. -Although we can make use of the provided `docker-compose` file in the [Tangle repo](https://github.com/webb-tools/tangle/tree/main/docker/tangle-standalone), we pull the `tangle-standalone:main` Docker image from ghcr.io -so that we can generate and insert our required keys before starting the node. +### 1. Pull the Tangle Docker image: ```sh filename="pull" copy # Only use "main" if you know what you are doing, it will use the latest and maybe unstable version of the node. @@ -23,17 +24,17 @@ so that we can generate and insert our required keys before starting the node. docker pull ghcr.io/webb-tools/tangle/tangle-standalone:main ``` -### **2. Create a local directory to store the chain data:** +### 2. Create a local directory to store the chain data: -Let us create a directory where we will store all the data for our node. This includes the chain data, keys, and logs. +Let us create a directory where we will store all the data for our node. This includes the chain data, and logs. ```sh filename="mkdir" copy mkdir /var/lib/tangle/ ``` -### **3. Fetch applicable chainspec(s):** +### 3. Fetch applicable chainspec(s): -To join the Tangle Test network as node operator we need to fetch the appropriate chainspec for the Tangle network. +To join the Tangle Test network, we need to fetch the appropriate chainspec for the Tangle network. Download the latest chainspec for standalone testnet: ```sh filename="get chainspec" copy @@ -43,7 +44,41 @@ wget https://raw.githubusercontent.com/webb-tools/tangle/main/chainspecs/testnet Please make a reference where you have stored this `json` file as we will need it in the next steps. -### **4. Generate and store keys:** +### 4. Select and Start your Node Type + + + +**4. Start Tangle full node:** + +**Note:** Full nodes do not participate in block production or consensus so no required keys are necessary. + +To start the node run the following command: + +```sh filename="docker run" copy +docker run --rm -it -v /var/lib/tangle/:/data ghcr.io/webb-tools/tangle/tangle-standalone:main \ + --chain tangle-testnet \ + --name="YOUR-NODE-NAME" \ + --base-path /data \ + --rpc-cors all \ + --port 9946 \ + --telemetry-url "wss://telemetry.polkadot.io/submit/ 0" --name +``` + + + For an overview of the above flags, please refer to the [CLI Usage](/docs/ecosystem-roles/validator/api-reference/cli/) page of our documentation. + + +Once Docker pulls the necessary images, your Tangle node will start, displaying lots of information, +such as the chain specification, node name, role, genesis state, and more. + +If you followed the installation instructions for Tangle, once synced, you will be connected to peers and see +blocks being produced on the Tangle network! Note that in this case you need to also sync to the Polkadot/Kusama +relay chain, which might take a few days. + + + + +### Generate and store keys: We need to generate the required keys for our node. For more information on these keys, please see the [Required Keys](/docs/ecosystem-roles/validator/required-keys) section. The keys we need to generate include the following: @@ -123,7 +158,7 @@ ls ~/webb/tangle/chains/*/keystore **Caution:** Ensure you insert the keys using the instructions at [generate keys](#generate-and-store-keys), if you want the node to auto generate the keys, add the `--auto-insert-keys` flag. -### **5. Start Tangle Validator node:** +### 5. Start Tangle Validator node: To start the node run the following command: @@ -196,7 +231,10 @@ After that run: docker compose up -d ``` -## Update the Client + + + +### Update the Client As Tangle development continues, it will sometimes be necessary to upgrade your node software. Node operators will be notified on our Discord channel when upgrades are available and whether they are necessary (some client upgrades are optional). @@ -215,9 +253,7 @@ sudo docker stop `CONTAINER_ID` 4. Restart the tangle container and you should have the updated version of the client. -Once your node is running again, you should see logs in your terminal. - -## Purge Your Node +### Purge Your Node If you need a fresh instance of your Tangle node, you can purge your node by removing the associated data directory. @@ -229,7 +265,7 @@ sudo docker stop `CONTAINER_ID` If you did not use the `-v` flag to specify a local directory for storing your chain data when you spun up your node, then the data folder is related to the Docker container itself. Therefore, removing the Docker container will remove the chain data. -If you did spin up your node with the `-v` flag, you will need to purge the specified directory. For example, for the suggested data directly, you can run the following command to purge your standalone node data: +If you did spin up your node with the `-v` flag, you will need to purge the specified directory. For example, for the suggested data directly, you can run the following command to purge your parachain node data: ```sh filename="rm" copy # purges standalone data @@ -237,3 +273,23 @@ sudo rm -rf /data/chains/* ``` Now that your chain data has been purged, you can start a new node with a fresh data directory! + +## Logs + +If you'd like to run the node with verbose logs, you may add the following arguments during initial setup. Adjust the target for the desired logging level (debug | error | info| trace | warn): + +```bash +-ldkg=debug \ +-ldkg_metadata=debug \ +-lruntime::offchain=debug \ +-ldkg_proposal_handler=debug \ +-ldkg_proposals=debug +``` + +## Begin Validating + +Now that your node is setup, [continue onto our Validator guides to understand token bonding and more.](./validator/requirements.mdx) + +## Support and Questions + +Visit our [Discord's validator channel](https://webb.tools/community) for community assistance. diff --git a/pages/docs/tangle-network/node/systemd/quick-node.mdx b/pages/docs/tangle-network/node/quicknode.mdx similarity index 100% rename from pages/docs/tangle-network/node/systemd/quick-node.mdx rename to pages/docs/tangle-network/node/quicknode.mdx diff --git a/pages/docs/tangle-network/node/systemd.mdx b/pages/docs/tangle-network/node/systemd.mdx new file mode 100644 index 00000000..39ee712c --- /dev/null +++ b/pages/docs/tangle-network/node/systemd.mdx @@ -0,0 +1,375 @@ +--- +title: Systemd Node Operation +description: Run a Tangle full node or Validator node using systemd. +--- + +import { Tabs } from 'nextra/components' + +# Running with Systemd + +You can run your **full** or **validator** node as a systemd process so that it will automatically restart on server reboots or crashes, helping to avoid getting slashed. This guide now includes additional steps for setting up dependencies and Rust configuration, ensuring a smoother setup process. + +Before following this guide, ensure that your machine's environment is set up and the Tangle binary is compiled. If you haven't done so, please refer to the [Requirements](https://docs.webb.tools/docs/ecosystem-roles/validator/requirements/) page. + +## Setup + +### 1. Fetch the Tangle Network Binary + +Use the latest release version in the url in place of ``, you can visit [releases](https://github.com/webb-tools/tangle/releases) page to view the latest info + +``` +wget https://github.com/webb-tools/tangle/releases/download//tangle-standalone-linux-amd64 +``` + +For example, at the time of writing this document, the latest release is v0.4.7 and the link would be as follows + +``` +wget https://github.com/webb-tools/tangle/releases/download/v0.4.7/tangle-standalone-linux-amd64 +``` + +### 2. Install Dependencies + +Ensure all necessary dependencies are installed: + +```sh +sudo apt update && sudo apt upgrade -y +sudo apt install curl iptables build-essential git wget jq make gcc nano tmux htop nvme-cli pkg-config libssl-dev libleveldb-dev libgmp3-dev tar clang bsdmainutils ncdu unzip llvm libudev-dev make protobuf-compiler -y +``` + +### 3. Install and Configure Rust + +```sh +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh +# choose option 1 +source $HOME/.cargo/env +rustup default nightly +rustup update +rustup update nightly +rustup target add wasm32-unknown-unknown --toolchain nightly +``` + +### 4. Select and Run Your Node Type + + + + + #### Create the Service Configuration File + Run the following commands to create the service configuration file: + + ```sh filename="mv" copy + # Move the tangle-standalone binary to the bin directory (assumes you are in repo root directory) + sudo mv ./target/release/tangle-standalone /usr/bin/ + ``` + + Add the following contents to the service configuration file. Make sure to replace the **USERNAME** with the username you created in the previous step, add your own node name, and update + any paths or ports to your own preference. + + **Note:** The below configuration assumes you are targeting the Tangle Network chainspec. + + **Full Node Service Configuration File** + + ```sh filename="full.service" copy + sudo tee /etc/systemd/system/full.service > /dev/null << EOF + [Unit] + Description=Tangle Full Node + After=network-online.target + StartLimitIntervalSec=0 + + [Service] + User= + Restart=always + RestartSec=3 + ExecStart=/usr/bin/tangle-standalone \ + --base-path /data/full-node \ + --name \ + --chain tangle-testnet \ + --node-key-file "/home//node-key" \ + --rpc-cors all \ + --port 9946 \ + --no-mdns \ + --telemetry-url "wss://telemetry.polkadot.io/submit/ 0" --name + + [Install] + WantedBy=multi-user.target + EOF + ``` + #### Enable the services + + After ensuring the config is correctly written to /etc/systemd/system/full.service, enable and start the service: + + ```sh filename="enable service" copy + sudo systemctl daemon-reload + sudo systemctl enable full + sudo systemctl start full + ``` + **Check the Status of the Service** + ```sh filename="status" copy + sudo systemctl status full + ``` + You should see the node connecting to the network and syncing with the latest blocks. + + **Tail the Latest Outputs** + ```sh filename="logs" copy + sudo journalctl -u full.service -f + ``` + + #### Network sync + + After a full node is started, it will start syncing with the current chain state. Depending on the size of the chain when you do this, this step may take anywhere from a few minutes to a few hours. + + Example of node sync : + + ```sh filename="output after synced" copy + 2021-06-17 03:07:39 🔍 Discovered new external address for our node: /ip4/10.26.16.1/tcp/30333/ws/p2p/12D3KooWLtXFWf1oGrnxMGmPKPW54xWCHAXHbFh4Eap6KXmxoi9u + 2021-06-17 03:07:40 ⚙️ Syncing 218.8 bps, target=#5553764 (17 peers), best: #24034 (0x08af…dcf5), finalized #23552 (0xd4f0…2642), ⬇ 173.5kiB/s ⬆ 12.7kiB/s + 2021-06-17 03:07:45 ⚙️ Syncing 214.8 bps, target=#5553765 (20 peers), best: #25108 (0xb272…e800), finalized #25088 (0x94e6…8a9f), ⬇ 134.3kiB/s ⬆ 7.4kiB/s + 2021-06-17 03:07:50 ⚙️ Syncing 214.8 bps, target=#5553766 (21 peers), best: #26182 (0xe7a5…01a2), finalized #26112 (0xcc29…b1a9), ⬇ 5.0kiB/s ⬆ 1.1kiB/s + 2021-06-17 03:07:55 ⚙️ Syncing 138.4 bps, target=#5553767 (21 peers), best: #26874 (0xcf4b…6553), finalized #26624 (0x9dd9…27f8), ⬇ 18.9kiB/s ⬆ 2.0kiB/s + 2021-06-17 03:08:00 ⚙️ Syncing 37.0 bps, target=#5553768 (22 peers), best: #27059 (0x5b73…6fc9), finalized #26624 (0x9dd9…27f8), ⬇ 14.3kiB/s ⬆ 4.4kiB/s + ``` + + + + + #### Generate and Store Keys + + We need to generate the required keys for our node. For more information on these keys, please see the [Required Keys](https://wiki.polkadot.network/docs/learn-cryptography) section. + The keys we need to generate include the following: + + - DKG key (Ecdsa) + - Aura key (Sr25519) + - Account key (Sr25519) + - Grandpa key (Ed25519) + - ImOnline key (Sr25519) + + Let's now insert our required secret keys, we will not pass the SURI in the command, instead it will be interactive, where you + should paste your SURI when the command asks for it. + + **Account Keys** + + ```sh filename="Acco" copy + # it will ask for your suri, enter it. + ./target/release/tangle-standalone key insert --base-path /data/validator/ \ + --chain ./chainspecs/tangle-standalone.json \ + --scheme Sr25519 \ + --suri <"12-MNEMONIC-PHARSE"> \ + --key-type acco + ``` + + **Aura Keys** + + ```sh filename="Aura" copy + # it will ask for your suri, enter it. + ./target/release/tangle-standalone key insert --base-path /data/validator/ \ + --chain ./chainspecs/tangle-standalone.json \ + --scheme Sr25519 \ + --suri <"12-MNEMONIC-PHARSE"> \ + --key-type aura + ``` + + **Im-online Keys** - **these keys are optional** + + ```sh filename="Imonline" copy + # it will ask for your suri, enter it. + ./target/release/tangle-standalone key insert --base-path /data/validator/ \ + --chain ./chainspecs/tangle-standalone.json \ + --scheme Sr25519 \ + --suri <"12-MNEMONIC-PHARSE"> \ + --key-type imon + ``` + + **DKG Keys** + + ```sh filename="DKG" copy + # it will ask for your suri, enter it. + ./target/release/tangle-standalone key insert --base-path /data/validator/ \ + --chain ./chainspecs/tangle-standalone.json \ + --scheme Ecdsa \ + --suri <"12-MNEMONIC-PHARSE"> \ + --key-type wdkg + ``` + + **Grandpa Keys** + + ```sh filename="Grandpa" copy + # it will ask for your suri, enter it. + ./target/release/tangle-standalone key insert --base-path /data/validator/ \ + --chain ./chainspecs/tangle-standalone.json \ + --scheme Ed25519 \ + --suri <"12-MNEMONIC-PHARSE"> \ + --key-type gran + ``` + + To ensure you have successfully generated the keys correctly run: + + ```sh filename="ls" copy + ls ~/data/validator//keystore + # You should see a some file(s) there, these are the keys. + ``` + + ## System service setup + + Run the following commands to create the service configuration file: + + ```sh filename="mv" copy + # Move the tangle-standalone binary to the bin directory (assumes you are in repo root directory) + sudo mv ./target/release/tangle-standalone /usr/bin/ + ``` + + Add the following contents to the service configuration file. Make sure to replace the **USERNAME** with the username you created in the previous step, add your own node name, and update any paths or ports to your own preference. + + **Note:** The below configuration assumes you are targeting the Tangle Network chainspec. + + **Caution:** Ensure you insert the keys using the instructions at [generate keys](#generate-and-store-keys), + if you want the node to auto generate the keys, add the `--auto-insert-keys` flag. + + **Validator Node** + + ```sh filename="validator.service" copy + sudo tee /etc/systemd/system/validator.service > /dev/null << EOF + [Unit] + Description=Tangle Validator Node + After=network-online.target + StartLimitIntervalSec=0 + + [Service] + User= + Restart=always + RestartSec=3 + ExecStart=/usr/bin/tangle-standalone \ + --base-path /data/validator/ \ + --name \ + --chain tangle-testnet \ + --node-key-file "/home//node-key" \ + --port 30333 \ + --validator \ + --no-mdns \ + --telemetry-url "wss://telemetry.polkadot.io/submit/ 0" --name + + [Install] + WantedBy=multi-user.target + EOF + ``` + #### Enable Validator Node + + Double check that the config has been written to `/etc/systemd/system/validator.service` correctly. + If so, enable the service so it runs on startup, and then try to start it now: + + ```sh filename="enable service" copy + sudo systemctl daemon-reload + sudo systemctl enable validator + sudo systemctl start validator + ``` + + Check the status of the service: + + ```sh filename="status" copy + sudo systemctl status validator + ``` + + You should see the node connecting to the network and syncing the latest blocks. + If you need to tail the latest output, you can use: + + ```sh filename="logs" copy + sudo journalctl -u validator.service -f + ``` + + If the node is running correctly, you should see an output similar to below: + + ```sh filename="output" + 2023-03-22 14:55:51 Tangle Standalone Node + 2023-03-22 14:55:51 ✌️ version 0.1.15-54624e3-aarch64-macos + 2023-03-22 14:55:51 ❤️ by Webb Technologies Inc., 2017-2023 + 2023-03-22 14:55:51 📋 Chain specification: Tangle Testnet + 2023-03-22 14:55:51 🏷 Node name: cooing-morning-2891 + 2023-03-22 14:55:51 👤 Role: FULL + 2023-03-22 14:55:51 💾 Database: RocksDb at /Users/local/Library/Application Support/tangle-standalone/chains/local_testnet/db/full + 2023-03-22 14:55:51 ⛓ Native runtime: tangle-standalone-115 (tangle-standalone-1.tx1.au1) + 2023-03-22 14:55:51 Bn254 x5 w3 params + 2023-03-22 14:55:51 [0] 💸 generated 5 npos voters, 5 from validators and 0 nominators + 2023-03-22 14:55:51 [0] 💸 generated 5 npos targets + 2023-03-22 14:55:51 [0] 💸 generated 5 npos voters, 5 from validators and 0 nominators + 2023-03-22 14:55:51 [0] 💸 generated 5 npos targets + 2023-03-22 14:55:51 [0] 💸 new validator set of size 5 has been processed for era 1 + 2023-03-22 14:55:52 🔨 Initializing Genesis block/state (state: 0xfd16…aefd, header-hash: 0x7c05…a27d) + 2023-03-22 14:55:52 👴 Loading GRANDPA authority set from genesis on what appears to be first startup. + 2023-03-22 14:55:53 Using default protocol ID "sup" because none is configured in the chain specs + 2023-03-22 14:55:53 🏷 Local node identity is: 12D3KooWDaeXbqokqvEMqpJsKBvjt9BUz41uP9tzRkYuky1Wat7Z + 2023-03-22 14:55:53 💻 Operating system: macos + 2023-03-22 14:55:53 💻 CPU architecture: aarch64 + 2023-03-22 14:55:53 📦 Highest known block at #0 + 2023-03-22 14:55:53 〽️ Prometheus exporter started at 127.0.0.1:9615 + 2023-03-22 14:55:53 Running JSON-RPC HTTP server: addr=127.0.0.1:9933, allowed origins=["http://localhost:*", "http://127.0.0.1:*", "https://localhost:*", "https://127.0.0.1:*", "https://polkadot.js.org"] + 2023-03-22 14:55:53 Running JSON-RPC WS server: addr=127.0.0.1:9944, allowed origins=["http://localhost:*", "http://127.0.0.1:*", "https://localhost:*", "https://127.0.0.1:*", "https://polkadot.js.org"] + 2023-03-22 14:55:53 discovered: 12D3KooWMr4L3Dun4BUyp23HZtLfxoQjR56dDp9eH42Va5X6Hfgi /ip4/192.168.0.125/tcp/30304 + 2023-03-22 14:55:53 discovered: 12D3KooWNHhcCUsZTdTkADmDJbSK9YjbtscHHA8R4jvrbGwjPVez /ip4/192.168.0.125/tcp/30305 + 2023-03-22 14:55:53 discovered: 12D3KooWMr4L3Dun4BUyp23HZtLfxoQjR56dDp9eH42Va5X6Hfgi /ip4/192.168.88.12/tcp/30304 + 2023-03-22 14:55:53 discovered: 12D3KooWNHhcCUsZTdTkADmDJbSK9YjbtscHHA8R4jvrbGwjPVez /ip4/192.168.88.12/tcp/30305 + ``` + + #### Network sync + + After a validator node is started, it will start syncing with the current chain state. Depending on the size of the chain when you do this, this step may take anywhere from a few minutes to a few hours. + + Example of node sync : + + ```sh filename="output after synced" copy + 2021-06-17 03:07:39 🔍 Discovered new external address for our node: /ip4/10.26.16.1/tcp/30333/ws/p2p/12D3KooWLtXFWf1oGrnxMGmPKPW54xWCHAXHbFh4Eap6KXmxoi9u + 2021-06-17 03:07:40 ⚙️ Syncing 218.8 bps, target=#5553764 (17 peers), best: #24034 (0x08af…dcf5), finalized #23552 (0xd4f0…2642), ⬇ 173.5kiB/s ⬆ 12.7kiB/s + 2021-06-17 03:07:45 ⚙️ Syncing 214.8 bps, target=#5553765 (20 peers), best: #25108 (0xb272…e800), finalized #25088 (0x94e6…8a9f), ⬇ 134.3kiB/s ⬆ 7.4kiB/s + 2021-06-17 03:07:50 ⚙️ Syncing 214.8 bps, target=#5553766 (21 peers), best: #26182 (0xe7a5…01a2), finalized #26112 (0xcc29…b1a9), ⬇ 5.0kiB/s ⬆ 1.1kiB/s + 2021-06-17 03:07:55 ⚙️ Syncing 138.4 bps, target=#5553767 (21 peers), best: #26874 (0xcf4b…6553), finalized #26624 (0x9dd9…27f8), ⬇ 18.9kiB/s ⬆ 2.0kiB/s + 2021-06-17 03:08:00 ⚙️ Syncing 37.0 bps, target=#5553768 (22 peers), best: #27059 (0x5b73…6fc9), finalized #26624 (0x9dd9…27f8), ⬇ 14.3kiB/s ⬆ 4.4kiB/s + ``` + + #### Bond TNT and setup validator Account + + After your node is synced, you are ready to setup keys and onboard as a validator, make sure to complete the steps + at [Start Validating](/docs/tangle-network/node/validator/requirements) to start validating. + + + + The following is the service configuration file, use this while completing the Full Node guide. + **Note:** To run with evm trace, you should use a binary built with `txpool` flag, refer [requirements](/docs/ecosystem-roles/validator/requirements/) page for more details. + + ```sh filename="full.service" copy + sudo tee /etc/systemd/system/full.service > /dev/null << EOF + [Unit] + Description=Tangle Full Node + After=network-online.target + StartLimitIntervalSec=0 + + [Service] + User= + Restart=always + RestartSec=3 + ExecStart=/usr/bin/tangle-standalone \ + --base-path /data/full-node \ + --name \ + --chain tangle-testnet \ + --node-key-file "/home//node-key" \ + --rpc-cors all \ + --port 9946 \ + --no-mdns --ethapi trace,debug,txpool + + [Install] + WantedBy=multi-user.target + EOF + ``` + + + + +Congratulations! You have officially setup a Tangle Network node using Systemd. + +## Monitoring + +To setup monitoring for your node, please refer to the [monitoring](./monitoring/quickstart.mdx) page. + +## Begin Validating + +Now that your node is setup, [continue onto our Validator guides to understand token bonding and more.](./validator/requirements.mdx) + +## Support and Questions + +Visit our [Discord's validator channel](https://webb.tools/community) for community assistance. diff --git a/pages/docs/tangle-network/node/systemd/_meta.json b/pages/docs/tangle-network/node/systemd/_meta.json deleted file mode 100644 index a3cff2b9..00000000 --- a/pages/docs/tangle-network/node/systemd/_meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "full-node": "Full Node", - "validator-node": "Validator Node" -} diff --git a/pages/docs/tangle-network/node/systemd/full-node.mdx b/pages/docs/tangle-network/node/systemd/full-node.mdx deleted file mode 100644 index 745890f3..00000000 --- a/pages/docs/tangle-network/node/systemd/full-node.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -title: Running with Systemd -description: Run a Tangle full node using systemd. ---- - -# Running with Systemd - -You can run your full node as a systemd process so that it will automatically restart on server reboots -or crashes (and helps to avoid getting slashed!). - -Before following this guide you should have already set up your machines environment, installed the dependencies, and -compiled the Tangle binary. If you have not done so, please refer to the [Requirements](https://docs.webb.tools/docs/ecosystem-roles/validator/requirements/) page. - -## System service setup - -Run the following commands to create the service configuration file: - -```sh filename="mv" copy -# Move the tangle-standalone binary to the bin directory (assumes you are in repo root directory) -sudo mv ./target/release/tangle-standalone /usr/bin/ -``` - -Add the following contents to the service configuration file. Make sure to replace the **USERNAME** with the username you created in the previous step, add your own node name, and update -any paths or ports to your own preference. - -**Note:** The below configuration assumes you are targeting the Tangle Network chainspec. - -**Full Node** - -```sh filename="full.service" copy -sudo tee /etc/systemd/system/full.service > /dev/null << EOF -[Unit] -Description=Tangle Full Node -After=network-online.target -StartLimitIntervalSec=0 - -[Service] -User= -Restart=always -RestartSec=3 -ExecStart=/usr/bin/tangle-standalone \ - --base-path /data/full-node \ - --name \ - --chain tangle-testnet \ - --node-key-file "/home//node-key" \ - --rpc-cors all \ - --port 9946 \ - --no-mdns \ - --telemetry-url "wss://telemetry.polkadot.io/submit/ 0" --name - -[Install] -WantedBy=multi-user.target -EOF -``` - -**Full Node with evm trace** - -**Note:** To run with evm trace, you should use a binary built with `txpool` flag, refer [requirements](../requirements.mdx) page for more details. - -```sh filename="full.service" copy -sudo tee /etc/systemd/system/full.service > /dev/null << EOF -[Unit] -Description=Tangle Full Node -After=network-online.target -StartLimitIntervalSec=0 - -[Service] -User= -Restart=always -RestartSec=3 -ExecStart=/usr/bin/tangle-standalone \ - --base-path /data/full-node \ - --name \ - --chain tangle-testnet \ - --node-key-file "/home//node-key" \ - --rpc-cors all \ - --port 9946 \ - --no-mdns --ethapi trace,debug,txpool - -[Install] -WantedBy=multi-user.target -EOF -``` - -### Enable the services - -Double check that the config has been written to `/etc/systemd/system/full.service` correctly. -If so, enable the service so it runs on startup, and then try to start it now: - -```sh filename="enable service" copy -sudo systemctl daemon-reload -sudo systemctl enable full -sudo systemctl start full -``` - -Check the status of the service: - -```sh filename="status" copy -sudo systemctl status full -``` - -You should see the node connecting to the network and syncing the latest blocks. -If you need to tail the latest output, you can use: - -```sh filename="logs" copy -sudo journalctl -u full.service -f -``` - -Congratulations! You have officially setup a Tangle Network node using Systemd. If you are interested -in learning how to setup monitoring for your node, please refer to the [monitoring](../monitoring/quickstart.mdx) page. diff --git a/pages/docs/tangle-network/node/systemd/validator-node.mdx b/pages/docs/tangle-network/node/systemd/validator-node.mdx deleted file mode 100644 index 6a072462..00000000 --- a/pages/docs/tangle-network/node/systemd/validator-node.mdx +++ /dev/null @@ -1,216 +0,0 @@ ---- -title: Running with Systemd -description: Run a Tangle Validator node using systemd. ---- - -# Running with Systemd - -You can run your validator node as a Systemd process so that it will automatically restart on server reboots -or crashes (and helps to avoid getting slashed!). - -Before following this guide you should have already set up your machines environment, installed the dependencies, and -compiled the Tangle binary. If you have not done so, please refer to the [Requirements](/docs/tangle-network/node/validator/requirements) page. - -## Standalone Testnet - -### Generate and store keys - -We need to generate the required keys for our node. For more information on these keys, please see the [Required Keys](https://wiki.polkadot.network/docs/learn-cryptography) section. -The keys we need to generate include the following: - -- DKG key (Ecdsa) -- Aura key (Sr25519) -- Account key (Sr25519) -- Grandpa key (Ed25519) -- ImOnline key (Sr25519) - -Let's now insert our required secret keys, we will not pass the SURI in the command, instead it will be interactive, where you -should paste your SURI when the command asks for it. - -**Account Keys** - -```sh filename="Acco" copy -# it will ask for your suri, enter it. -./target/release/tangle-standalone key insert --base-path /data/validator/ \ ---chain ./chainspecs/tangle-standalone.json \ ---scheme Sr25519 \ ---suri <"12-MNEMONIC-PHARSE"> \ ---key-type acco -``` - -**Aura Keys** - -```sh filename="Aura" copy -# it will ask for your suri, enter it. -./target/release/tangle-standalone key insert --base-path /data/validator/ \ ---chain ./chainspecs/tangle-standalone.json \ ---scheme Sr25519 \ ---suri <"12-MNEMONIC-PHARSE"> \ ---key-type aura -``` - -**Im-online Keys** - **these keys are optional** - -```sh filename="Imonline" copy -# it will ask for your suri, enter it. -./target/release/tangle-standalone key insert --base-path /data/validator/ \ ---chain ./chainspecs/tangle-standalone.json \ ---scheme Sr25519 \ ---suri <"12-MNEMONIC-PHARSE"> \ ---key-type imon -``` - -**DKG Keys** - -```sh filename="DKG" copy -# it will ask for your suri, enter it. -./target/release/tangle-standalone key insert --base-path /data/validator/ \ ---chain ./chainspecs/tangle-standalone.json \ ---scheme Ecdsa \ ---suri <"12-MNEMONIC-PHARSE"> \ ---key-type wdkg -``` - -**Grandpa Keys** - -```sh filename="Grandpa" copy -# it will ask for your suri, enter it. -./target/release/tangle-standalone key insert --base-path /data/validator/ \ ---chain ./chainspecs/tangle-standalone.json \ ---scheme Ed25519 \ ---suri <"12-MNEMONIC-PHARSE"> \ ---key-type gran -``` - -To ensure you have successfully generated the keys correctly run: - -```sh filename="ls" copy -ls ~/data/validator//keystore -# You should see a some file(s) there, these are the keys. -``` - -## System service setup - -Run the following commands to create the service configuration file: - -```sh filename="mv" copy -# Move the tangle-standalone binary to the bin directory (assumes you are in repo root directory) -sudo mv ./target/release/tangle-standalone /usr/bin/ -``` - -Add the following contents to the service configuration file. Make sure to replace the **USERNAME** with the username you created in the previous step, add your own node name, and update any paths or ports to your own preference. - -**Note:** The below configuration assumes you are targeting the Tangle Network chainspec. - -**Caution:** Ensure you insert the keys using the instructions at [generate keys](#generate-and-store-keys), -if you want the node to auto generate the keys, add the `--auto-insert-keys` flag. - -**Validator Node** - -```sh filename="validator.service" copy -sudo tee /etc/systemd/system/validator.service > /dev/null << EOF -[Unit] -Description=Tangle Validator Node -After=network-online.target -StartLimitIntervalSec=0 - -[Service] -User= -Restart=always -RestartSec=3 -ExecStart=/usr/bin/tangle-standalone \ - --base-path /data/validator/ \ - --name \ - --chain tangle-testnet \ - --node-key-file "/home//node-key" \ - --port 30333 \ - --validator \ - --no-mdns \ - --telemetry-url "wss://telemetry.polkadot.io/submit/ 0" --name - -[Install] -WantedBy=multi-user.target -EOF -``` - -### Enable the services - -Double check that the config has been written to `/etc/systemd/system/validator.service` correctly. -If so, enable the service so it runs on startup, and then try to start it now: - -```sh filename="enable service" copy -sudo systemctl daemon-reload -sudo systemctl enable validator -sudo systemctl start validator -``` - -Check the status of the service: - -```sh filename="status" copy -sudo systemctl status validator -``` - -You should see the node connecting to the network and syncing the latest blocks. -If you need to tail the latest output, you can use: - -```sh filename="logs" copy -sudo journalctl -u validator.service -f -``` - -If the node is running correctly, you should see an output similar to below: - -```sh filename="output" -2023-03-22 14:55:51 Tangle Standalone Node -2023-03-22 14:55:51 ✌️ version 0.1.15-54624e3-aarch64-macos -2023-03-22 14:55:51 ❤️ by Webb Technologies Inc., 2017-2023 -2023-03-22 14:55:51 📋 Chain specification: Tangle Testnet -2023-03-22 14:55:51 🏷 Node name: cooing-morning-2891 -2023-03-22 14:55:51 👤 Role: FULL -2023-03-22 14:55:51 💾 Database: RocksDb at /Users/local/Library/Application Support/tangle-standalone/chains/local_testnet/db/full -2023-03-22 14:55:51 ⛓ Native runtime: tangle-standalone-115 (tangle-standalone-1.tx1.au1) -2023-03-22 14:55:51 Bn254 x5 w3 params -2023-03-22 14:55:51 [0] 💸 generated 5 npos voters, 5 from validators and 0 nominators -2023-03-22 14:55:51 [0] 💸 generated 5 npos targets -2023-03-22 14:55:51 [0] 💸 generated 5 npos voters, 5 from validators and 0 nominators -2023-03-22 14:55:51 [0] 💸 generated 5 npos targets -2023-03-22 14:55:51 [0] 💸 new validator set of size 5 has been processed for era 1 -2023-03-22 14:55:52 🔨 Initializing Genesis block/state (state: 0xfd16…aefd, header-hash: 0x7c05…a27d) -2023-03-22 14:55:52 👴 Loading GRANDPA authority set from genesis on what appears to be first startup. -2023-03-22 14:55:53 Using default protocol ID "sup" because none is configured in the chain specs -2023-03-22 14:55:53 🏷 Local node identity is: 12D3KooWDaeXbqokqvEMqpJsKBvjt9BUz41uP9tzRkYuky1Wat7Z -2023-03-22 14:55:53 💻 Operating system: macos -2023-03-22 14:55:53 💻 CPU architecture: aarch64 -2023-03-22 14:55:53 📦 Highest known block at #0 -2023-03-22 14:55:53 〽️ Prometheus exporter started at 127.0.0.1:9615 -2023-03-22 14:55:53 Running JSON-RPC HTTP server: addr=127.0.0.1:9933, allowed origins=["http://localhost:*", "http://127.0.0.1:*", "https://localhost:*", "https://127.0.0.1:*", "https://polkadot.js.org"] -2023-03-22 14:55:53 Running JSON-RPC WS server: addr=127.0.0.1:9944, allowed origins=["http://localhost:*", "http://127.0.0.1:*", "https://localhost:*", "https://127.0.0.1:*", "https://polkadot.js.org"] -2023-03-22 14:55:53 discovered: 12D3KooWMr4L3Dun4BUyp23HZtLfxoQjR56dDp9eH42Va5X6Hfgi /ip4/192.168.0.125/tcp/30304 -2023-03-22 14:55:53 discovered: 12D3KooWNHhcCUsZTdTkADmDJbSK9YjbtscHHA8R4jvrbGwjPVez /ip4/192.168.0.125/tcp/30305 -2023-03-22 14:55:53 discovered: 12D3KooWMr4L3Dun4BUyp23HZtLfxoQjR56dDp9eH42Va5X6Hfgi /ip4/192.168.88.12/tcp/30304 -2023-03-22 14:55:53 discovered: 12D3KooWNHhcCUsZTdTkADmDJbSK9YjbtscHHA8R4jvrbGwjPVez /ip4/192.168.88.12/tcp/30305 -``` - -### Network sync - -After a validator node is started, it will start syncing with the current chain state. Depending on the size of the chain when you do this, this step may take anywhere from a few minutes to a few hours. - -Example of node sync : - -```sh filename="output after synced" copy -2021-06-17 03:07:39 🔍 Discovered new external address for our node: /ip4/10.26.16.1/tcp/30333/ws/p2p/12D3KooWLtXFWf1oGrnxMGmPKPW54xWCHAXHbFh4Eap6KXmxoi9u -2021-06-17 03:07:40 ⚙️ Syncing 218.8 bps, target=#5553764 (17 peers), best: #24034 (0x08af…dcf5), finalized #23552 (0xd4f0…2642), ⬇ 173.5kiB/s ⬆ 12.7kiB/s -2021-06-17 03:07:45 ⚙️ Syncing 214.8 bps, target=#5553765 (20 peers), best: #25108 (0xb272…e800), finalized #25088 (0x94e6…8a9f), ⬇ 134.3kiB/s ⬆ 7.4kiB/s -2021-06-17 03:07:50 ⚙️ Syncing 214.8 bps, target=#5553766 (21 peers), best: #26182 (0xe7a5…01a2), finalized #26112 (0xcc29…b1a9), ⬇ 5.0kiB/s ⬆ 1.1kiB/s -2021-06-17 03:07:55 ⚙️ Syncing 138.4 bps, target=#5553767 (21 peers), best: #26874 (0xcf4b…6553), finalized #26624 (0x9dd9…27f8), ⬇ 18.9kiB/s ⬆ 2.0kiB/s -2021-06-17 03:08:00 ⚙️ Syncing 37.0 bps, target=#5553768 (22 peers), best: #27059 (0x5b73…6fc9), finalized #26624 (0x9dd9…27f8), ⬇ 14.3kiB/s ⬆ 4.4kiB/s -``` - -### Bond TNT and setup validator Account - -After your node is synced, you are ready to setup keys and onboard as a validator, make sure to complete the steps -at [Start Validating](/docs/tangle-network/node/validator/requirements) to start validating. - ---- - -Congratulations! You have officially setup an Tangle Network node using Systemd. If you are interested -in learning how to setup monitoring for your node, please refer to the [monitoring](../monitoring/quickstart.mdx) page.