Skip to content

Commit ccee0c6

Browse files
authored
Merge pull request #1 from ccris02/patch-1
Thanks!
2 parents 9c92100 + c05ca34 commit ccee0c6

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

README.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# Polkdadot Validation Node Ansible Setup
1+
# Polkadot Validation Node Ansible Setup
22

3-
This repo is to set up Polkadot Validation node. This repo is a heavily influenced by https://github.com/w3f/polkadot-validator-setup, the official Polkadot secure setup guide.
3+
This repo is to set up the Polkadot Validation node. This repo is heavily influenced by https://github.com/w3f/polkadot-validator-setup, the official Polkadot secure setup guide.
44

55
## Motivation
66

77
While the official setup is very comprehensive, it can be overwhelming for "small" validators (myself included) who do not care much about using Terraform on the infrastructure layer. I took the Ansible part of the script and updated it:
88

9-
1. The setup is more opinionated, thus the script is simplier by avoiding many "if" statements. It is tailored for Ubuntu only, but you should be able to get it working on other Linux distribution with some revisions.
10-
2. It is more opinionated about node monitoring by recommending Node Exporter, Processor Exporter, and Promtail (for centralized log monitoring). I also have a companion Ansible script (https://github.com/polkachu/server-monitoring) that installs Prometheus, Grafana and Loki to set up such a centralized monitoring server. This setup will make your life easier if you eventually move from a "small" validator to running a cluster of Polkadot/Kusama nodes.
11-
3. The setup assumes that you will start from an archived node snapshot provided by https://polkashots.io. It is much simpler and less error-prone than Rust compiling. Highly recommended. In fact, we at Polkachu is currently planning to offer such archived node snapshots to provide redundency to the community.
9+
1. The setup is more opinionated, thus the script is simpler by avoiding many "if" statements. It is tailored for Ubuntu only, but you should be able to get it working on other Linux distributions with some revisions.
10+
2. It is more opinionated about node monitoring by recommending Node Exporter, Processor Exporter, and Promtail (for centralized log monitoring). I also have a companion Ansible script (https://github.com/polkachu/server-monitoring) that installs Prometheus, Grafana, and Loki to set up such a centralized monitoring server. This setup will make your life easier if you eventually move from a "small" validator to running a cluster of Polkadot/Kusama nodes.
11+
3. The setup assumes that you will start from an archived node snapshot provided by https://polkashots.io. It is much simpler and less error-prone than Rust compiling. Highly recommended. In fact, we at Polkachu are currently planning to offer such archived node snapshots to provide redundancy to the community.
1212
4. Since it has happened twice already, I have included a configuration to help you roll back to version `0.8.30` in the `group_vars/polkadot.yml` file.
1313

1414
## Summary
@@ -40,10 +40,10 @@ Needless to say, you need to update the dummy values in the inventory file. For
4040

4141
You will also need to update:
4242

43-
1. ansible_user: The sample file assumes `ansible`, but you might have another username. Make sure that user has `sudo` privilege.
43+
1. ansible_user: The sample file assumes `ansible`, but you might have another username. Make sure that the user has `sudo` privilege.
4444
2. ansible_port: The sample file assumes `22`. But if you are like me, you will have a different ssh port other than `22` to avoid port sniffing.
4545
3. ansible_ssh_private_key_file: The sample file assumes `~/.ssh/id_rsa`, but you might have a different key location.
46-
4. log_monitor: Enter your monitor server IP. It is most likely a private IP address if you use firewall around your private virtual cloud (VPC).
46+
4. log_monitor: Enter your monitor server IP. It is most likely a private IP address if you use a firewall around your private virtual cloud (VPC).
4747

4848
It is beyond the scope of this guide to help you create a sudo user, alternate ssh port, create a private key, install Ansible on your machine, etc. You can do a quick online search and find the answers. In my experience, Digital Ocean have some quality guides on these topics. Stack Overflow can help you trouble-shoot if you are stuck.
4949

@@ -53,15 +53,15 @@ The basic cluster structure is:
5353

5454
1. Name each Kusama node as `kusama1`, `kusama2`, etc. Group all Kusama nodes into `kusama` group.
5555
2. Name each Polkadot node as `polkadot1`, `polkadot2`, etc. Group all Polkadot nodes into `polkadot` group.
56-
3. Group all nodes into `validators` group.
56+
3. Group all nodes into a `validators` group.
5757

5858
The structure allows you to target `vars` to each node, or either Kusama or Polkadot cluster, or the whole cluster.
5959

60-
Make sure that you are familiar with the files in the `group_vars` folder. They follow this cluster structure closely. The files in this folder often need to be changed to stay up to date with the latest releases. I, for one, bump these program versions religiously so I live on the cutting edge!
60+
Make sure that you are familiar with the files in the `group_vars` folder. They follow this clustered structure closely. The files in this folder often need to be changed to stay up to date with the latest releases. I, for one, bump these program versions religiously so I live on the cutting edge!
6161

6262
## Main Playbook to Set Up a Kusama/Polkadot Validator (Archive Node)
6363

64-
The key Ansible playbook is `polkadot_full_setup.yml`. It will set up a fresh validator from scratch. Notice that it will restore from a snapshot from https://polkashots.io. It is very possible that you will get an error on checksum of data restore in your first attempt, because the snapshot is updated regularly. When this happens, update the files accordingly.
64+
The key Ansible playbook is `polkadot_full_setup.yml`. It will set up a fresh validator from scratch. Notice that it will restore from a snapshot from https://polkashots.io. It is very possible that you will get an error on the checksum of data to restore in your first attempt because the snapshot is updated regularly. When this happens, update the files accordingly.
6565

6666
The main setup playbook is:
6767

@@ -72,35 +72,35 @@ ansible-playbook -i inventory polkadot_full_setup.yml -e "target=VALIDATOR_TARGE
7272
Notice that you need to specify a target when you run this playbook (and other playbooks in this repo, as described in the next section). `VALIDATOR_TARGET` is a placeholder that could be a host (`kusama1`, `kusama2`, `polkadot1`, `polkadot2`, etc), a group (`kusama`, `polkadot`), or all validators (`validators`). This is intentionally designed to:
7373

7474
1. Prevent you from updating all nodes by mistake
75-
2. Allow you to expirement a move on a low-risk node before rolling out to the whole cluster
75+
2. Allow you to experiment a move on a low-risk node before rolling out to the whole cluster
7676

7777
## Various Playbooks for Different Purposes
7878

7979
The most commonly used playbooks are:
8080

81-
| Playbook | Description |
82-
| ------------------------- | ---------------------------------------------------------------------------------------- |
83-
| `polkadot_full_setup.yml` | Run the initial full setup |
84-
| `polkadot_prepare.yml ` | Do the prep work, such as firewall, set up proxy, copy service files, create users, etc. |
85-
| `polkadot_update.yml` | Update the polkadot binary and restart service. You probably need to use it regularly |
86-
| `polkadot_restore.yml` | Restore the polkadot database with screenshot. Only useful for initial setup |
87-
| `node_exporter.yml` | Update Node Exporter |
88-
| `process_exporter.yml` | Update Process Exporter |
89-
| `promtail.yml` | Update Promtail |
81+
| Playbook | Description |
82+
| ------------------------- | ----------------------------------------------------------------------------------------- |
83+
| `polkadot_full_setup.yml` | Run the initial full setup |
84+
| `polkadot_prepare.yml ` | Do the prep work, such as firewall, set up a proxy, copy service files, create users, etc.|
85+
| `polkadot_update.yml` | Update the Polkadot binary and restart the service. You probably need to use it regularly |
86+
| `polkadot_restore.yml` | Restore the Polkadot database with a screenshot. Only useful for initial setup |
87+
| `node_exporter.yml` | Update Node Exporter |
88+
| `process_exporter.yml` | Update Process Exporter |
89+
| `promtail.yml` | Update Promtail |
9090

9191
The less commonly used playbooks are:
9292

9393
| Playbook | Description |
9494
| ------------------------------ | ------------------------------------------------------------------------------------- |
95-
| `polkadot_backup_keystore.yml` | Backup keystore (Not sure about use case) |
96-
| `polkadot_clean_logs.yml` | Clean journal logs (Probably useful when disk is full) |
97-
| `polkadot_restart.yml` | Restart polkadot ad hoc (Probably useful when server runs wild for no obvious reason) |
98-
| `polkadot_stop.yml` | Stop polkadot ad hoc |
95+
| `polkadot_backup_keystore.yml` | Backup Keystore (Not sure about use case) |
96+
| `polkadot_clean_logs.yml` | Clean journal logs (Probably useful when the disk is full) |
97+
| `polkadot_restart.yml` | Restart Polkadot ad hoc (Probably useful when server runs wild for no obvious reason) |
98+
| `polkadot_stop.yml` | Stop Polkadot ad hoc |
9999
| `polkadot_rorate_keys.yml` | Rotate session keys the easy way without you ssh into the server yourself |
100100

101101
## Update All Servers
102102

103-
One more thing! Sometimes you want to install all apt patches on all machines. I provides you with a simple playbook. Just run:
103+
One more thing! Sometimes you want to install all apt patches on all machines. I provide you with a simple playbook. Just run:
104104

105105
```bash
106106
ansible-playbook -i inventory all_apt_update.yml

0 commit comments

Comments
 (0)