Virtual TestNets are live! ⚡️ Test and stage dapps on real-time production data.
Get started →

All Products

Virtual TestNets
UI Libraries

Dynamic and Virtual TestNets

In this guide you’ll learn how to connect a Next.js app to Virtual TestNets using Dynamic.

Dynamic is a UI kit for building login flows and onboarding experiences.

You can connect Dynamic to Virtual TestNets to interact with staged smart contracts while demoing your dap and building the UI.

Create a Virtual TestNet

In Tenderly Dashboard, create a new Virtual TestNet:

  • Select Mainnet as the base network
  • Name it Dynamic TestNet
  • Choose a unique chain ID 73571
  • Turn on the Public Explorer
  • Copy the Testnet RPC

Create a Chain Config

Create a file src/tenderly.config.ts and replace the following:

  1. Paste the chain ID to the id property
  2. Change the chainNname and currency
  3. Paste the Testnet RPC to rpcUrls
  4. Paste the Block Explorer URL to blockExplorerUrls
export const tenderlyChains = [
    blockExplorerUrls: [''],
    chainId: 73571,
    chainName: 'Virtual Ethereum Mainnet',
    iconUrls: [''],
    name: 'Ethereum',
    nativeCurrency: {
      decimals: 18,
      name: 'Ether',
      symbol: 'ETH',
    networkId: 1,
    rpcUrls: [process.env.TENDERLY_VIRTUAL_MAINNET_RPC!],
    vanityName: 'Virtual ETH Mainnet',

Wrap your dapp in DynamicContextProvider

Wrap your app (or a component) in a DynamicContextProvider, configure evmNetworks with tenderlyChains defined previously.

'use client';
import './globals.css';
import { EthereumWalletConnectors } from '@dynamic-labs/ethereum';
import { tenderlyChains } from '@/tenderly.config';
import { DynamicContextProvider, DynamicWidget } from '@dynamic-labs/sdk-react-core';
import { DynamicWagmiConnector } from '@dynamic-labs/wagmi-connector';
export default function RootLayout({ children }: Readonly<{ children: React.ReactNode; }>) {
  return (
    <html lang="en">
        // Find your environment id at
        environmentId: 'ENVIRONMENT_ID',
        walletConnectors: [EthereumWalletConnectors],
        evmNetworks: process.env.NEXT_PUBLIC_TENDERLY_VNETS_ENABLED ? tenderlyChains : [],
        <DynamicWidget />

Run the dapp