Testnets which are initialized with the current mainnet state?

Hey all,

Has the community considered creating testnets which are initialized with the current mainnet state?

I’m doing the Nomadic Labs smart contract class (which has been great so far!), and I’d like to write a contract that interacts with existing contracts (tokens and DEXs). Unfortunately there doesn’t seem to be any easy way to test such a contract, because the testnets weren’t initialized with the mainnet state at the time of creation.

Relatedly, it would be amazing if I could grab a mockup environment with a somewhat up-to-date snapshot of mainnet.

You can take a mainnet node and turn it into your private testing environment by using a yes-node

The problem with starting with the state of mainnet is that you need a majority of mainnet bakers to participate in the network and use the secret keys holding all their funds. At some point we launched test chains from the state of mainnet during the third phase of the protocol amendment process but there has never been much participation on these test chains so we stopped doing them (see Draft: Add a draft for the deactivation of the test chain (!141) · Merge requests · Tezos / tzip · GitLab).

That being said, when we launch a Tezos network we can start with a block containing the contracts we want at the addresses we want; that’s not enough to mimick mainnet but that’s enough to test many applications.

Interesting - I’ll look into yes-nodes

Thanks for that info. It sounds painful but I’d still love it if someone would figure it out :grin: