From 4cfa700b7f54eb0c1d2748afeb3ac38a82ce8aab Mon Sep 17 00:00:00 2001 From: Adam Mizerski Date: Thu, 12 Jan 2023 11:37:01 +0100 Subject: [PATCH 1/5] fix typo --- roles/install-bor/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/install-bor/tasks/main.yml b/roles/install-bor/tasks/main.yml index 3187849..7b935f8 100644 --- a/roles/install-bor/tasks/main.yml +++ b/roles/install-bor/tasks/main.yml @@ -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 From ba923cced1912c6dfe63e2f498a1d5698d806db1 Mon Sep 17 00:00:00 2001 From: EvilSeeQu-sys <85349934+EvilSeeQu-sys@users.noreply.github.com> Date: Fri, 13 Jan 2023 11:24:17 +0100 Subject: [PATCH 2/5] Update README.md --- README.md | 51 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 0fe00ad..35b502a 100644 --- a/README.md +++ b/README.md @@ -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 @ip`). - ### Inventory Ansible manages hosts using `inventory.yml` file. @@ -88,6 +82,29 @@ To run actual playbook on archive node: ansible-playbook playbooks/network.yml --extra-var="bor_version=v0.3.0 heimdall_version=v0.3.0 network=mainnet node_type=archive" ``` +### Setting Up Heimdall Node +Make sure to start/stop/restart service via root + +Stop heimdall services : +```bash +systemctl stop heimdalld +``` + +Make sure to +```bash +chown -R heimdall:nogroup /var/lib/heimdall/* +``` +Download newest heimdall snapshot : +https://snapshot.polygon.technology/ + +```bash +tar -xzvf heimdall-snapshot-*.gz -C ~/.heimdalld/data/ +cd /var/lib/heimdall/ +chown -R heimdall:nogroup data/ + +systemctl enable --now heimdalld +systemctl restart heimdalld +``` ### Check sync status To check the sync status you can run the follwing command on your node @@ -97,12 +114,19 @@ $ 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 + +Download the newest bor snapshot : +https://snapshot.polygon.technology/ +```bash +tar -xzvf bor-fullnode-snapshot-*.gz -C ~/.bor/data/bor/chaindata +chown -R bor:nogroup data/ +``` +Command to Start Bor Service - Make sure to run as Root ```bash -sudo service bor start +service bor start ``` ### Management commands @@ -184,3 +208,12 @@ 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 From 02b55d261891c5d3584904397ed1ca9ed42564ca Mon Sep 17 00:00:00 2001 From: EvilSeeQu-sys <85349934+EvilSeeQu-sys@users.noreply.github.com> Date: Fri, 13 Jan 2023 11:26:58 +0100 Subject: [PATCH 3/5] Update README.md --- README.md | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 35b502a..8172bc9 100644 --- a/README.md +++ b/README.md @@ -31,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: @@ -54,34 +56,6 @@ 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): - -```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 -``` - -To run actual playbook on validator node: - -```bash -ansible-playbook playbooks/network.yml --extra-var="bor_version=v0.3.0 heimdall_version=v0.3.0 network=mainnet node_type=validator" -``` - -### Archive node setup - -To show list of hosts where the playbook will run (notice `--list-hosts` at the end): - -```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: - -```bash -ansible-playbook playbooks/network.yml --extra-var="bor_version=v0.3.0 heimdall_version=v0.3.0 network=mainnet node_type=archive" -``` - ### Setting Up Heimdall Node Make sure to start/stop/restart service via root From c5dfaffdd5a65887a2d81b09511812a2dbb1ee0c Mon Sep 17 00:00:00 2001 From: EvilSeeQu-sys <85349934+EvilSeeQu-sys@users.noreply.github.com> Date: Fri, 13 Jan 2023 11:34:42 +0100 Subject: [PATCH 4/5] Update README.md --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8172bc9..3195b45 100644 --- a/README.md +++ b/README.md @@ -63,11 +63,11 @@ Stop heimdall services : ```bash systemctl stop heimdalld ``` - -Make sure to +Edit /var/lib/heimdall/config/config ```bash -chown -R heimdall:nogroup /var/lib/heimdall/* +external_address="tcp://:26656" ``` + Download newest heimdall snapshot : https://snapshot.polygon.technology/ @@ -92,10 +92,16 @@ Start The Bor service after the above command shows as false that mean heimdall ### Bor Node Setup +Edit /var/lib/bor/config.toml +```bash +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 From e324bf1ae7d410538c9e93a568c4bc7b74a9706d Mon Sep 17 00:00:00 2001 From: EvilSeeQu-sys <85349934+EvilSeeQu-sys@users.noreply.github.com> Date: Fri, 13 Jan 2023 11:35:34 +0100 Subject: [PATCH 5/5] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3195b45..5064ad7 100644 --- a/README.md +++ b/README.md @@ -190,6 +190,7 @@ 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**