🤔 Got questions? Schedule an office hours session.
Virtual TestNets
Develop
REST API

Virtual TestNets REST API

You can use the REST API for scripting Virtual TestNets creation.

Get Tenderly Access Key

Get Tenderly Access Key and export the value to your terminal environment

export TENDERLY_ACCESS_KEY=# the key you copied

Call the API

RESPONSE=$(curl --request POST \
  --url https://api.tenderly.co/api/v1/account/me/project/project/vnets \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header "X-Access-Key: ${TENDERLY_ACCESS_KEY}" \
  --data '
{
  "slug": "my-staging-testnet-25",
  "display_name": "My Staging TestNet",
  "fork_config": {
    "network_id": 1,
    "block_number": "latest"
  },
  "virtual_network_config": {
    "chain_config": {
      "chain_id": 73571
    }
  },
  "sync_state_config": {
    "enabled": false,
    "commitment_level": "latest"
  },
  "explorer_page_config": {
    "enabled": false,
    "verification_visibility": "bytecode"
  }
}')

Extract the Admin RPC

The RPC link is found in the the rpcs array, designated by name Admin RPC.

ADMIN_RPC=$(echo $RESPONSE | jq -r '.rpcs[] | select(.name == "Admin RPC") | .url')