{"id":19121144,"url":"https://github.com/maticnetwork/node-ansible","last_synced_at":"2025-04-12T19:43:10.794Z","repository":{"id":37904427,"uuid":"268325249","full_name":"maticnetwork/node-ansible","owner":"maticnetwork","description":"Ansible scripts to setup Matic validator node","archived":false,"fork":false,"pushed_at":"2024-10-23T17:31:18.000Z","size":117,"stargazers_count":95,"open_issues_count":12,"forks_count":145,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-04-03T22:09:54.598Z","etag":null,"topics":["ansible","bor","ethereum","heimdall","maticnetwork","web3"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maticnetwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-31T17:04:08.000Z","updated_at":"2025-03-02T20:16:48.000Z","dependencies_parsed_at":"2024-02-01T00:23:08.831Z","dependency_job_id":"79b7389a-1943-4e67-b046-8718698693fd","html_url":"https://github.com/maticnetwork/node-ansible","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maticnetwork%2Fnode-ansible","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maticnetwork%2Fnode-ansible/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maticnetwork%2Fnode-ansible/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maticnetwork%2Fnode-ansible/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maticnetwork","download_url":"https://codeload.github.com/maticnetwork/node-ansible/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625478,"owners_count":21135512,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","bor","ethereum","heimdall","maticnetwork","web3"],"created_at":"2024-11-09T05:16:14.067Z","updated_at":"2025-04-12T19:43:10.762Z","avatar_url":"https://github.com/maticnetwork.png","language":"Shell","readme":"# Node Ansible\n\nAnsible playbooks to setup Matic validator node.\n\n### Requirements\n\nMake sure you are using python3.x with Ansible. To check: `ansible --version` \n\n### Setup\n\nNote: If your ssh public key (`~/.ssh/id_rsa.pub`) is already on the remote machines, skip this step.\n\n**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 \u003cusername\u003e@ip`). \n\n### Inventory\n\nAnsible manages hosts using `inventory.yml` file.\n\n**Setup inventory**\n\nAdd nodes ip's in `inventory.yml` as example\n\nExample:\n\n```yml\n#add your instance ips here in palce of xx..\nxxx.xxx.xx.xx # \u003c----- Add IP for sentry/validator node\n\n```\n\nNote: By default the user to login is setup as ubuntu in `group_vars/all` file. If you have a specific user to be logged in with please change the username in this file.\n\nTo check if nodes are reachable, run following commands:\n\n```bash\n# to check if nodes are reachable\nansible all -m ping\n```\n\n### Networks\n\nThere are two networks available:\n\n* `mainnet` (Mainnet v1)\n* `amoy` (Amoy testnet)\n\nWhile running Ansible playbook, `network` `node_type` `heimdall_version` `bor_version` needs to be set. These Values can be passed in `--extra-var`\n\n### Sentry node setup\n\nTo show list of hosts where the playbook will run (notice `--list-hosts` at the end):\n\n```bash\nansible-playbook playbooks/network.yml --extra-var=\"bor_version=v0.3.0 heimdall_version=v0.3.0 network=mainnet node_type=sentry\" --list-hosts\n```\n\nTo run actual playbook on sentry nodes:\n\n```bash\nansible-playbook playbooks/network.yml --extra-var=\"bor_version=v0.3.0 heimdall_version=v0.3.0 network=mainnet node_type=sentry\"\n```\n\n### Validator node setup (with sentry)\n\nTo show list of hosts where the playbook will run (notice `--list-hosts` at the end):\n\n```bash\nansible-playbook playbooks/network.yml --extra-var=\"bor_version=v0.3.0 heimdall_version=v0.3.0 network=mainnet node_type=validator\" --list-hosts\n```\n\nTo run actual playbook on validator node:\n\n```bash\nansible-playbook playbooks/network.yml --extra-var=\"bor_version=v0.3.0 heimdall_version=v0.3.0 network=mainnet node_type=validator\"\n```\n\nTo setup a validator wallet/keys\n```bash\nansible-playboook -i $inventory playbooks/validator-setup.yml\n```\n\n\n### Archive node setup \n\nTo show list of hosts where the playbook will run (notice `--list-hosts` at the end):\n\n```bash\nansible-playbook playbooks/network.yml --extra-var=\"bor_version=v0.3.0 heimdall_version=v0.3.0 network=mainnet node_type=archive\" --list-hosts\n```\n\nTo run actual playbook on archive node:\n\n```bash\nansible-playbook playbooks/network.yml --extra-var=\"bor_version=v0.3.0 heimdall_version=v0.3.0 network=mainnet node_type=archive\"\n```\n\n### Check sync status\n\nTo check the sync status you can run the follwing command on your node\n\n```js\n$ curl http://localhost:26657/status\n```\nYou can also use the following playbook\n```bash\nansible-playbook -i $inventory playbooks/heimdall/get-sync-status.yml\n```\n\nThe key called `catching_up` will show your sync status, if it's not catching up it means that you are fully synced!\n\nStart The Bor service after the above command shows as false that mean heimdall is in sync\n\nCommand to Start Bor Service\n```bash\nsudo service bor start\n```\n### Management commands\n\n**To clean deployed setup (warning: this will delete all blockchain data)**\n\n```bash\nansible-playbook -l \u003cgroup-name\u003e playbooks/clean.yml\n```\n\n**To show Heimdall account**\n\n```bash\nansible-playbook -l \u003cgroup-name\u003e playbooks/heimdall/heimdall-show-account.yml\n```\n\n**To increase ulimit**\n\n```bash\nansible-playbook -l \u003cgroup-name\u003e playbooks/ulimit.yml\n```\n\n**To setup prometheus exporters**\n\n```bash\nansible-playbook -l \u003cgroup-name\u003e playbooks/setup-exporters.yml\n```\n\nThis will install node and process exporter on machines for prometheus monitoring. Both exporters will be available at default ports.\n\n**To reboot machine**\n\n```bash\nansible-playbook -l \u003cgroup-name\u003e playbooks/reboot.yml\n```\n\n### Stand-alone build\n\n**To setup Heimdall**\n\n```bash\nansible-playbook playbooks/heimdall/heimdall.yml --extra-var=\"heimdall_version=v0.3.0 network=mainnet node_type=sentry\"\n```\n\nTo show list of hosts where the playbook will run:\n\n```bash\nansible-playbook playbooks/heimdall/heimdall.yml --extra-var=\"heimdall_version=v0.3.0 network=mainnet node_type=sentry\" --list-hosts\n```\n\n**To setup Bor**\n\n```bash\nansible-playbook playbooks/bor/bor.yml --extra-var=\"bor_version=v0.3.0 network=mainnet node_type=sentry\"\n```\n\nTo show list of hosts where the playbook will run:\n\n```bash\nansible-playbook playbooks/bor/bor.yml --extra-var=\"bor_version=v0.3.0 network=mainnet node_type=sentry\" --list-hosts\n```\n\n### Adhoc queries\n\n**Ping**\n\nJust to see if machines are reachable:\n\n```bash\nansible all -m ping\n```\n\n`ping` is a module name. You can any module and arguments here.\n\n**Run shell command**\n\nFollowing command will fetch and print all disk space stats from all hosts.\n\n\n```bash\nansible all -m shell -a \"df -h\"\n```\n\n**Snapshots and Backups**\n\nYou can run the following playbook to start a snapshot on your host for bor\n```bash\nansible-playbook -i $inventory playbooks/bor/snapshot-create -e \"chaindata=$path target=$target_save_dir\"\nansible-playbook -i $inventory playbooks/heimdall/snapshot-create -e \"data=$path target=$target_save_dir\"\n```\n\nYou can run the following command on to take a backup of your validator. This playbook assumes you know path of bor and heimdall config directories\n```bash\nansible-playbook -i $inventory playbooks/validator-backup.yml -e \"destination=$WHERE_YOU_WANT_TO_SAVE_LOCALLY bor_path=PATH_TO_YOUR_BOR_INSTALL heimdall_path=PATH_TO_YOUR_HEIMDALL_PATH\"\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaticnetwork%2Fnode-ansible","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaticnetwork%2Fnode-ansible","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaticnetwork%2Fnode-ansible/lists"}