Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typo #54

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 41 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ Ansible playbooks to setup Matic validator node.

Make sure you are using python3.x with Ansible. To check: `ansible --version`

### Setup

Note: If your ssh public key (`~/.ssh/id_rsa.pub`) is already on the remote machines, skip this step.

**Copy `pem` private key file as `.workspace/private.pem`** to enable ssh through ansible. If you don't have pem file, just make sure you can reach remote machines from your own machine using ssh (`ssh <username>@ip`).

### Inventory

Ansible manages hosts using `inventory.yml` file.
Expand All @@ -37,6 +31,8 @@ To check if nodes are reachable, run following commands:
ansible all -m ping
```

Remove "GO" packet on sentry machine

### Networks

There are two networks available:
Expand All @@ -60,34 +56,29 @@ To run actual playbook on sentry nodes:
ansible-playbook playbooks/network.yml --extra-var="bor_version=v0.3.0 heimdall_version=v0.3.0 network=mainnet node_type=sentry"
```

### Validator node setup (with sentry)

To show list of hosts where the playbook will run (notice `--list-hosts` at the end):
### Setting Up Heimdall Node
Make sure to start/stop/restart service via root

Stop heimdall services :
```bash
ansible-playbook playbooks/network.yml --extra-var="bor_version=v0.3.0 heimdall_version=v0.3.0 network=mainnet node_type=validator" --list-hosts
systemctl stop heimdalld
```

To run actual playbook on validator node:

Edit /var/lib/heimdall/config/config
```bash
ansible-playbook playbooks/network.yml --extra-var="bor_version=v0.3.0 heimdall_version=v0.3.0 network=mainnet node_type=validator"
external_address="tcp://<YOUR_SENTRY_NODE>:26656"
```

### Archive node setup

To show list of hosts where the playbook will run (notice `--list-hosts` at the end):
Download newest heimdall snapshot :
https://snapshot.polygon.technology/

```bash
ansible-playbook playbooks/network.yml --extra-var="bor_version=v0.3.0 heimdall_version=v0.3.0 network=mainnet node_type=archive" --list-hosts
```

To run actual playbook on archive node:
tar -xzvf heimdall-snapshot-*.gz -C ~/.heimdalld/data/
cd /var/lib/heimdall/
chown -R heimdall:nogroup data/

```bash
ansible-playbook playbooks/network.yml --extra-var="bor_version=v0.3.0 heimdall_version=v0.3.0 network=mainnet node_type=archive"
systemctl enable --now heimdalld
systemctl restart heimdalld
```

### Check sync status

To check the sync status you can run the follwing command on your node
Expand All @@ -97,12 +88,25 @@ $ curl http://localhost:26657/status
```

The key called `catching_up` will show your sync status, if it's not catching up it means that you are fully synced!

Start The Bor service after the above command shows as false that mean heimdall is in sync

Command to Start Bor Service
### Bor Node Setup

Edit /var/lib/bor/config.toml
```bash
sudo service bor start
jsonrpc > host = "0.0.0.0"
```

Download the newest bor snapshot :
https://snapshot.polygon.technology/
```bash
tar -xzvf bor-fullnode-snapshot-*.gz -C ~/.bor/data/bor/chaindata
cd /var/lib/bor/
chown -R bor:nogroup data/
```
Command to Start Bor Service - Make sure to run as Root
```bash
service bor start
```
### Management commands

Expand Down Expand Up @@ -184,3 +188,13 @@ Following command will fetch and print all disk space stats from all hosts.
```bash
ansible all -m shell -a "df -h"
```

**FIREWALL Configuration**

Open ports 22, 80, 443, 8545, 26656 and 30303 to world (0.0.0.0/0) on sentry node firewall.

**External Links**

https://wiki.polygon.technology/docs/develop/network-details/full-node-deployment

https://wiki.polygon.technology/docs/develop/network-details/snapshot-instructions-heimdall-bor
2 changes: 1 addition & 1 deletion roles/install-bor/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

- name: add mainnet bootnodes
ansible.builtin.command:
cmd: sed -i 's|.*bootnodes =.*| bootnodes = ["enode://0cb82b395094ee4a2915e9714894627de9ed8498fb881cec6db7c65e8b9a5bd7f2f25cc84e71e89d0947e51c76e85d0847de848c7782b13c0255247a6758178c@44.232.55.71:30303,enode://88116f4295f5a31538ae409e4d44ad40d22e44ee9342869e7d68bdec55b0f83c1530355ce8b41fbec0928a7d75a5745d528450d30aec92066ab6ba1ee351d710@159.203.9.164:30303","enode://4be7248c3a12c5f95d4ef5fff37f7c44ad1072fdb59701b2e5987c5f3846ef448ce7eabc941c5575b13db0fb016552c1fa5cca0dda1a8008cf6d63874c0f3eb7@3.93.224.197:30303","enode://32dd20eaf75513cf84ffc9940972ab17a62e88ea753b0780ea5eca9f40f9254064dacb99508337043d944c2a41b561a17deaad45c53ea0be02663e55e6a302b2@3.212.183.151:30303"]|g' /var/lib/bor/config.toml
cmd: sed -i 's|.*bootnodes =.*| bootnodes = ["enode://0cb82b395094ee4a2915e9714894627de9ed8498fb881cec6db7c65e8b9a5bd7f2f25cc84e71e89d0947e51c76e85d0847de848c7782b13c0255247a6758178c@44.232.55.71:30303","enode://88116f4295f5a31538ae409e4d44ad40d22e44ee9342869e7d68bdec55b0f83c1530355ce8b41fbec0928a7d75a5745d528450d30aec92066ab6ba1ee351d710@159.203.9.164:30303","enode://4be7248c3a12c5f95d4ef5fff37f7c44ad1072fdb59701b2e5987c5f3846ef448ce7eabc941c5575b13db0fb016552c1fa5cca0dda1a8008cf6d63874c0f3eb7@3.93.224.197:30303","enode://32dd20eaf75513cf84ffc9940972ab17a62e88ea753b0780ea5eca9f40f9254064dacb99508337043d944c2a41b561a17deaad45c53ea0be02663e55e6a302b2@3.212.183.151:30303"]|g' /var/lib/bor/config.toml
when: network == "mainnet"
become: true

Expand Down