# Simple Staging [@TenderlyApp](https://x.com/TenderlyApp) [@nenadvitt](https://x.com/nenadvitt) This simple guide will take you through first steps to stage a [ScaffoldETH2](https://github.com/scaffold-eth/scaffold-eth-2) app using [Tenderly's Virtual Testnets](https://docs.tenderly.co/virtual-testnets). [Full guide to Virtual TestNets in CI](https://docs.tenderly.co/workshops/virtual-testnets) ## Install Tenderly CLI [Instructions](https://github.com/Tenderly/tenderly-cli) ```bash curl https://raw.githubusercontent.com/Tenderly/tenderly-cli/master/scripts/install-macos.sh | sh ``` Then login ([create account](https://dashboard.tenderly.co) first) ``` tenderly login ``` ## Clone the repo Clone the Scaffold ETH 2 fork. ``` git clone https://github.com/nvitorovic/scaffold-eth-2 ``` ## Configure Create `packages/tenderly/.env` ``` # https://docs.tenderly.co/account/projects/account-project-slug TENDERLY_ACCOUNT_ID= TENDERLY_PROJECT_ID= # https://docs.tenderly.co/account/projects/how-to-generate-api-access-token TENDERLY_ACCESS_TOKEN= ``` Create `packages/hardhat/.env` ``` ALCHEMY_API_KEY= # leave empty # DEPLOYER_PRIVATE_KEY= ETHERSCAN_API_KEY= # leave empty # https://docs.tenderly.co/account/projects/account-project-slug TENDERLY_ACCOUNT_ID= TENDERLY_PROJECT_ID= # https://docs.tenderly.co/account/projects/how-to-generate-api-access-token TENDERLY_ACCESS_TOKEN= TENDERLY_AUTOMATIC_VERIFICATIONS=true ``` ## Create a staging environment Note: use different environment name (`test-4`) every time ```bash cd packages/tenderly yarn stage:new test-4 1 8453 yarn stage:activate test-4 yarn stage:connect:hardhat yarn stage:connect:nextjs ``` ## Deploy ```bash cd packages/hardhat yarn deploy --network virtual_mainnet ``` ## Run ```bash cd packages/nextjs yarn dev ```