Skip to content
Cosmopediaby Unity Nodes
DiscussionsFAQ & GuidesCan anyone tell me how to fork a live Cosmos testnet?Forum ↗

Can anyone tell me how to fork a live Cosmos testnet?

FAQ & Guides4 posts247 views1 likesLast activity 5d ago
AR
AryaLanjewar3005OP
Sep 2025

I want to fork a running chain to my local environment and use the fork as a testing chain. Similar to how anvil --forkworks, I know one method is to use a snapshot provider to sync with the local chain. However, the chain I want to fork does not provide snapshots. Is there any other way to achieve this?

JI
jijohn
Sep 2025

(post deleted by author)

KE
kelvin
Sep 2025

One approach is exporting the genesis file and then replaying blocks from the current height. It takes longer than using snapshots but gives a functional forked chain for testing.

ZA
ZainC
5d ago

Cosmos doesn’t have an exact drop-in equivalent to anvil --fork because IAVL state trees can’t easily be served on-demand via standard JSON-RPC queries like Ethereum. If the testnet doesn’t offer downloadable snapshot archives, the cleanest alternative is running State Sync on your local node against two public testnet RPCs to pull the latest state root in a couple of minutes without syncing old block history. Once your local node catches up to the current block height, kill the daemon and run appd export --height <height> > genesis.json. From there, you just modify the exported genesis to change the chain-id, replace the existing validator set with your own local keyring, and reset the state to boot your isolated local cluster. For more automated simulation testing, a lot of Cosmos teams are also using Strangelove’s interchaintest framework to spin up local instances with state preloads, especially as cross-chain dev tooling keeps expanding.

← Back to Discussions