We use Tenderly to fork the Gnosis Mainnet chain for development purposes. This allows us to interact with the chain without risking real funds.
Go to Tenderly and create an account.
Create a new project in Tenderly.
-
Go to the Forks section under the Development tab in your Tenderly dashboard.
-
Click Create Fork.
-
Select "Gnosis Chain" as the network.
-
Use Chain ID
100
. -
Copy the RPC URL provided by Tenderly.
Set the FORK_URL
and DEV_RPC
environment variables in your .env
file to the RPC URL provided by Tenderly.
Click the Fund Accounts button in Tenderly to fund your accounts with XDAI (native token) and OLAS.
It is important to update your fork periodically to ensure that your forked chain is up-to-date with mainnet. You can do this by creating a new fork in Tenderly and updating your FORK_URL
and DEV_RPC
environment variables.
Alternatively, you can try the Tenderly's virtual testnet feature, which can automatically update your fork for you relative to mainnet. Though, this sometimes results in instability.
Hardhat is a local alternative to Tenderly for forking EVM chains. It is useful for development purposes, though the chain state is lost once the Hardhat node is turned off.