Before you begin
- A Tenderly access key. Export it as
TENDERLY_ACCESS_KEYin your shell. - Your account and project slugs, available in the URL of your Tenderly Dashboard.
Create a single-network Virtual Environment
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" }
}')
The
rpcs array on the response contains the Admin and Public RPC URLs. Pull the Admin RPC out for the rest of your script:Create a Multichain Virtual Environment
A Multichain Virtual Environment is created in a single call via themultivnets endpoint. All networks in the call are grouped under one stack_id, which is what makes cross-chain bridging possible between them.
multivnet-create.sh
vnets array creates one network inside the Multichain Virtual Environment. The response returns a stack_id and an array of Virtual Environment objects, each with its own RPC endpoints.
See the REST API reference for the field-by-field schema.
Next steps
- Set up GitHub Actions with Foundry or Hardhat to provision Virtual Environments per pull request.
- Stage contracts on the Virtual Environment you just created.
- Browse the full REST API reference.