{"id":22886606,"url":"https://github.com/zenodeapp/restate-sync","last_synced_at":"2026-04-27T18:32:23.828Z","repository":{"id":216211863,"uuid":"740744363","full_name":"zenodeapp/restate-sync","owner":"zenodeapp","description":"A State Sync Refresher usable in Tendermint or CometBFT-based protocols. This wipes the whole data folder and recalibrates the state-sync to a more recent height while making sure to backup and restore the priv_validator_state.json file.","archived":false,"fork":false,"pushed_at":"2024-01-18T16:19:24.000Z","size":47,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-16T03:07:27.927Z","etag":null,"topics":["blockchain","cometbft","configuration","configuration-management","consensus","cosmos-sdk","node","statesync","tendermint","toml","toml-config","toml-parsing","validator"],"latest_commit_sha":null,"homepage":"","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/zenodeapp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["zenodeapp"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://zenode.app/support"]}},"created_at":"2024-01-09T01:15:27.000Z","updated_at":"2025-01-05T11:17:41.000Z","dependencies_parsed_at":"2025-03-31T18:45:37.102Z","dependency_job_id":"9cd7792d-100d-48ec-8c9b-f48fc9e7d7bd","html_url":"https://github.com/zenodeapp/restate-sync","commit_stats":{"total_commits":24,"total_committers":1,"mean_commits":24.0,"dds":0.0,"last_synced_commit":"fbfbc40f2ec35f4aaf9975020731502ccb0be15f"},"previous_names":["zenodeapp/restate-sync"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/zenodeapp/restate-sync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenodeapp%2Frestate-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenodeapp%2Frestate-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenodeapp%2Frestate-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenodeapp%2Frestate-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zenodeapp","download_url":"https://codeload.github.com/zenodeapp/restate-sync/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenodeapp%2Frestate-sync/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32349480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T17:12:42.749Z","status":"ssl_error","status_checked_at":"2026-04-27T17:12:41.658Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["blockchain","cometbft","configuration","configuration-management","consensus","cosmos-sdk","node","statesync","tendermint","toml","toml-config","toml-parsing","validator"],"created_at":"2024-12-13T20:19:28.386Z","updated_at":"2026-04-27T18:32:23.810Z","avatar_url":"https://github.com/zenodeapp.png","language":"Shell","funding_links":["https://github.com/sponsors/zenodeapp","https://zenode.app/support"],"categories":[],"sub_categories":[],"readme":"# Restate Sync\n\nA State Sync Refresher usable in Tendermint or CometBFT-based protocols. This wipes the whole data folder and recalibrates the state-sync to a more recent height while making sure to backup and restore the priv_validator_state.json file.\n\nThis has been written by ZENODE and is licensed under the MIT-license (see [LICENSE](./LICENSE)).\n\n## Overview\n\nRunning out of space happens to all of us, especially when you're running multiple nodes that grow day-by-day. When [State Sync](https://docs.tendermint.com/v0.34/tendermint-core/state-sync.html) arrived, many got very enthusiastic to how quickly one could now join a network, without needing a ton of space.\n\nBut, even a state-synced node could eventually become too large in size. This small repository aims to solve this problem by providing a script that somewhat automates the steps required to _recalibrate_ a state-sync to a more recent height.\n\n### [restate-sync.sh](restate-sync.sh)\n\n```\nUsage:   sh restate-sync.sh \u003cbinary_name\u003e \u003cnode_dir_name\u003e [height_interval] [rpc_server_1] [rpc_server_2]\n\nExample: sh restate-sync.sh genesisd .genesis 1000 \"https://26657.genesisl1.org:443\"\n         This will refresh the state sync using a trust height of latest_block - 1000 (rounded)\n         and sets the RPC server addresses to https://26657.genesisl1.org:443\n\n  \u003cnode_dir_name\u003e should only be the name of the node directory, not a path (e.g. .gaia, .genesis, .cronos, .osmosisd etc.).\n  [height_interval] is optional (default: 2000).\n  [rpc_server_1] is optional (if none is given then the script will try to use the RPC SERVER url in your config.toml file).\n  [rpc_server_2] is optional (default: [rpc_server_1]).\n```\n\n### Data wipe\n\n\u003e [!CAUTION]\n\u003e The node's **data-folder will get wiped** using `\u003cbinary_name\u003e tendermint unsafe-reset-all`!\n\nWhile it does try to stop the node service, create a backup of and restores the _priv_validator_state.json_ file, we encourage you to stop it yourself and create a backup in case of the small chance your setup _or_ chain differs from the _norm_. Though, rest assured, the script will tell you exactly what will happen before it does anything reckless.\n\nHere follows an example warning message when one runs `sh restate-sync.sh genesisd .genesis`:\n```\nWARNING: - Service 'genesisd' will get halted using 'systemctl stop genesisd'.\n         - A backup and restore of /root/.genesis/data/priv_validator_state.json will be performed.\n         - State-syncing will wipe the /root/.genesis/data folder.\n\nIf any of this doesn't match your setup, make sure to halt and/or backup the node yourself before continuing!\n\nDo you want to continue? (y/N): \n```\n\n### Breaking the two RPC server limit\n\n\u003e [!TIP]\n\u003e If you want to add more than two RPCs, then **manually configure the rpc_servers-field in your config.toml** and **leave [rpc_server_1] and [rpc_server_2] blank**.\n\nThis script is limited to setting two RPC URIs in the `rpc_servers`-field of your config.toml file. If you want to add more, then manually add the RPC URIs in your config.toml file and do not call the script with either of the `[rpc_server_1]` or `[rpc_server_2]` arguments. This will let the script parse the first rpc server frm the `rpc_servers`-field, uses this to query the latest block height _and_ leaves the field untouched.\n\n## Cronjob idea\n\nSomething for later down the line _or_ something you could create is a cronjob that periodically checks the size of the node directory and runs the [restate-sync.sh](restate-sync.sh) script whenever a certain threshold (in GBs) gets met.\n\n\u003c/br\u003e\n\n\u003cp align=\"right\"\u003e— ZEN\u003c/p\u003e\n\u003cp align=\"right\"\u003eCopyright (c) 2024 ZENODE\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenodeapp%2Frestate-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzenodeapp%2Frestate-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenodeapp%2Frestate-sync/lists"}