> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tenderly.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Act 2: Running it locally

> Deploy scaffold-eth contracts to a Virtual Environment, run the Next.js UI locally, and fund a burner wallet using the unlimited faucet.

<small>Estimated time: <b>5 min</b></small>

In this act, you will:

* Deploy scaffold-eth contracts to a [Virtual Environment](/virtual-environments/overview)
* Run the UI
* Use the [infinite faucet](/virtual-environments/unlimited-faucet) from the UI

## Run & Deploy

<Steps>
  [//]: # "### Run"

  [//]: # "- Run the following commands to connect hardhat and nextjs to a Tenderly Virtual Environment. Note `packages/hardhat/tenderly.config.ts` and  `packages/nextjs/tenderly.config.ts`"

  [//]: #

  [//]: # "```bash"

  [//]: # "cd packages/tenderly"

  [//]: # "npm run stage:connect:hardhat"

  [//]: # "npm run stage:connect:nextjs"

  [//]: # "```"

  ### Deploy contracts

  Run the following command. It will:

  1. Deploy your contracts
  2. Have the contracts verified in Tenderly

  ```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  cd packages/tenderly
  npm run stage:connect:hardhat

  cd ../hardhat
  if [ -d deployments ]; then
    rm -r deployments
  fi
  npx hardhat deploy --network virtual_mainnet
  ```

  ### Get the UI running

  Run your NextJs server:

  ```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  cd packages/tenderly
  npm run stage:connect:nextjs
  cd ../nextjs
  npm run start
  ```

  ### Interact

  * Pick the **Burner Wallet** - ideal for local dev
  * Click 💵 Faucet button (far right)
  * Reload the page (because the funds are already there)
</Steps>
