Skip to content

Commit

Permalink
update staging bash example
Browse files Browse the repository at this point in the history
  • Loading branch information
nvitorovic committed Apr 25, 2024
1 parent 3c74573 commit 45f859d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 11 deletions.
32 changes: 21 additions & 11 deletions virtual-testnets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

Expand All @@ -81,19 +92,18 @@ 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

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

Expand Down
15 changes: 15 additions & 0 deletions virtual-testnets/src/contracts-staging/.example.env
Original file line number Diff line number Diff line change
@@ -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=...
Expand Down

0 comments on commit 45f859d

Please sign in to comment.