{"id":13563966,"url":"https://github.com/larry0x/cosmos-sdk-historical-query","last_synced_at":"2025-12-24T04:57:08.534Z","repository":{"id":212881716,"uuid":"732518431","full_name":"larry0x/cosmos-sdk-historical-query","owner":"larry0x","description":"How to query a Cosmos chain at historical block heights in Rust, Go, JS, and Bash","archived":false,"fork":false,"pushed_at":"2023-12-17T02:32:30.000Z","size":82,"stargazers_count":20,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-01T13:30:28.255Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/larry0x.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-12-16T23:57:38.000Z","updated_at":"2024-06-03T11:06:24.000Z","dependencies_parsed_at":"2024-01-14T03:47:57.950Z","dependency_job_id":"439a28b2-257e-4915-ba74-3e9fd3c88d41","html_url":"https://github.com/larry0x/cosmos-sdk-historical-query","commit_stats":null,"previous_names":["larry0x/cosmos-sdk-historical-query"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larry0x%2Fcosmos-sdk-historical-query","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larry0x%2Fcosmos-sdk-historical-query/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larry0x%2Fcosmos-sdk-historical-query/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larry0x%2Fcosmos-sdk-historical-query/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/larry0x","download_url":"https://codeload.github.com/larry0x/cosmos-sdk-historical-query/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223030794,"owners_count":17076504,"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":[],"created_at":"2024-08-01T13:01:25.077Z","updated_at":"2025-12-24T04:57:08.514Z","avatar_url":"https://github.com/larry0x.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# cosmos-sdk-historical-query\n\nSample code for querying a Cosmos chain at a historical block height, in four languages:\n\n- Rust\n- Go\n- JavaScript\n- Bash\n\nIn addition, the example persented here is a paginated query, meaning it may take more than one query to retrieve the full result. We show how to do this using a loop.\n\n## How to use\n\nRust:\n\n```bash\ncd rust\ncargo run\n```\n\nGo:\n\n```bash\ncd go\ngo run main.go\n```\n\nJavaScript:\n\n```bash\ncd js\nnode main.js\n```\n\nBash:\n\n```bash\ncd bash\nbash main.sh\n```\n\nResult should look like this:\n\n```plain\nperforming query... next=\"\"\nperforming query... next=\"14614fecb276f5e00c2fd0db40130023bb3f832175\"\nperforming query... next=\"14ab2bc85eaa365c4cf39f6a7525b44fef8264512e\"\nperforming query... next=\"14dbfdb0af1e9dc4a05a94074e6c900b29550b2dad\"\n[\n  {\n    \"delegation\": {\n      \"delegator_address\": \"celestia15rpm3yhl76ps7s74nu5pg06atpz70slal4kdk2\",\n      \"validator_address\": \"celestiavaloper1qx43f066sh6728avms4qq09cj2a3mg83dgjh22\",\n      \"shares\": \"350000000000.000000000000000000\"\n    },\n    \"balance\": {\n      \"denom\": \"utia\",\n      \"amount\": \"350000000000\"\n    }\n  },\n  {\n    \"delegation\": {\n      \"delegator_address\": \"celestia15rpm3yhl76ps7s74nu5pg06atpz70slal4kdk2\",\n      \"validator_address\": \"celestiavaloper1qxeza0sa037u35p3ze8p7ka7emajvydnyjlp07\",\n      \"shares\": \"350000000000.000000000000000000\"\n    },\n    \"balance\": {\n      \"denom\": \"utia\",\n      \"amount\": \"350000000000\"\n    }\n  },\n...more\n```\n\nIf the node has already pruned the height you're querying at, an error like this should be returned:\n\n```plain\ncodespace: sdk\ncode: 18\nlog: failed to load state at height 123; version mismatch on immutable IAVL tree; version does not exist. Version has either been pruned, or is for a future block height (latest height: 344122): invalid request\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flarry0x%2Fcosmos-sdk-historical-query","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flarry0x%2Fcosmos-sdk-historical-query","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flarry0x%2Fcosmos-sdk-historical-query/lists"}