diff --git a/virtual-testnets/README.md b/virtual-testnets/README.md index d9e1e09..5732b43 100644 --- a/virtual-testnets/README.md +++ b/virtual-testnets/README.md @@ -28,25 +28,30 @@ You can run the following examples without any additional configuration source .env npx ts-node src/ethers-6-https.ts ``` + **Ethers: Send a transaction** + ```bash source .env npx ts-node src/ethers-send-tx.ts ``` **Viem: Query the network** + ```bash source .env npx ts-node src/viem.ts ``` **Viem: Send a transaction** + ```bash source .env npx ts-node src/viem-send-tx.ts ``` **Viem: Simulate a transaction** + ```bash source .env npx ts-node src/viem-simulate.ts @@ -56,13 +61,20 @@ npx ts-node src/viem-simulate.ts ### 1. Extend configuration -Edit `src/contracts-staging/.env` and add: - -- **`ORIGINAL_NETWORK_ID`** - the [ID of the network](https://docs.tenderly.co/supported-networks-and-languages) you - want to base the TestNet on -- **`TENDERLY_TESTNET_NAME`** - the name for the testnet -- **`PURPOSE`** - leave `development` -- **`BLOCK_NUMBER`** - either `latest` or a specific block number (`HEX`) +Create an `.env` file in `src/contracts-staging`, and specify + +- Tenderly access configuration: + - **`TENDERLY_ACCOUNT_ID`** with your [account ID](https://docs.tenderly.co/account/projects/account-project-slug) + - **`TENDERLY_PROJECT`** with your [project (slug)](https://docs.tenderly.co/account/projects/account-project-slug) + - **`TENDERLY_ACCESS_KEY`** with + the [access key you've generated](https://docs.tenderly.co/account/projects/how-to-generate-api-access-token) + - **`PRIVATE_KEY`** for signing test transactions (if needed) +- TestNet configuration: + - **`ORIGINAL_NETWORK_ID`** - the [ID of the network](https://docs.tenderly.co/supported-networks-and-languages) you + want to base the TestNet on + - **`TENDERLY_TESTNET_NAME`** - the name for the testnet + - **`PURPOSE`** - leave `development` + - **`BLOCK_NUMBER`** - either `latest` or a specific block number (`HEX`) ```bash cp src/contracts-staging/.example.env .env @@ -72,7 +84,6 @@ vi src/contracts-staging/.env #### 2. Call the API ```bash -source .env source src/contracts-staging/.env cd src/contracts-staging @@ -81,11 +92,11 @@ bash src/contracts-staging/create-testnet.sh ## Staging -To perform staging, follow these few steps +To perform staging, follow these few steps. ### 2. Add deployment command -Edit `deploy-command.sh` with the commands that deploy contracts to the Virtual TestNet. +Edit `deploy-command.sh` with the commands that deploy contracts to the Virtual TestNet. Follow the given example. ### 3. Stage @@ -93,7 +104,6 @@ Stage the contracts ```bash # create a testnet - or paste the Unlocked TestNet RPC URL -source .env source src/contracts-staging/.env cd src/contracts-staging diff --git a/virtual-testnets/src/contracts-staging/.example.env b/virtual-testnets/src/contracts-staging/.example.env index 62426d6..bc85813 100644 --- a/virtual-testnets/src/contracts-staging/.example.env +++ b/virtual-testnets/src/contracts-staging/.example.env @@ -1,3 +1,18 @@ +########### Tenderly Access Configuration ########### + +# https://docs.tenderly.co/account/projects/account-project-slug +export TENDERLY_ACCOUNT_ID=... +export TENDERLY_PROJECT=... + +# https://docs.tenderly.co/account/projects/how-to-generate-api-access-token +export TENDERLY_ACCESS_KEY=... + +# https://docs.tenderly.co/node +export TENDERLY_NODE_ACCESS_KEY=... + +## Private key to sign test transactions +export PRIVATE_KEY=0x... + ########### TestNet creation config ########### ## the parent network for testnet ORIGINAL_NETWORK_ID=...