-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
656d43c
commit 3c74573
Showing
146 changed files
with
21,228 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Staging contracts and updating others | ||
on: push | ||
jobs: | ||
deploy_to_testnet: | ||
name: Deploy Contracts To TestNet | ||
runs-on: ubuntu-latest | ||
env: | ||
TENDERLY_ACCESS_KEY: ${{secrets.TENDERLY_ACCESS_KEY}} | ||
DEPLOYER_PRIVATE_KEY: ${{secrets.DEPLOYER_PRIVATE_KEY}} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.12.0 | ||
cache: npm | ||
|
||
- name: Install | ||
uses: npm ci | ||
|
||
- name: deploy | ||
working-directory: virtual-testnets-staging/foundry | ||
run: deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[submodule "hello_virtual_testnets/lib/forge-std"] | ||
path = hello_virtual_testnets/lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std | ||
[submodule "virtual-testnets-staging/contracts-foundry/lib/forge-std"] | ||
path = virtual-testnets-staging/contracts-foundry/lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std | ||
[submodule "virtual-testnets-state-sync/contracts/lib/forge-std"] | ||
path = virtual-testnets-state-sync/contracts/lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# 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... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Node Examples | ||
|
||
This section contains examples on usage of Tenderly node via: | ||
|
||
- [Ethers 5](ethers-5/) | ||
- [Viem examples](ethers-6/) | ||
- [Viem examples](samples/viem) | ||
|
||
## Environment setup | ||
|
||
Set up environment variables: | ||
- **`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 | ||
- **`ORIGINAL_NETWORK_ID`** with the [ID of the network](https://docs.tenderly.co/supported-networks-and-languages) you | ||
want to base the TestNet on | ||
|
||
```bash | ||
cp .env.example .env | ||
vi .env # modify environment variables | ||
``` | ||
|
||
## Running the samples | ||
|
||
### Viem | ||
|
||
```bash | ||
source .env | ||
cd samples/viem | ||
yarn | ||
npx ts-node 0-batch-calls.ts | ||
npx ts-node 0-send-tx.ts | ||
``` | ||
|
||
### Ethers 5 | ||
|
||
```bash | ||
bash .env | ||
cd ethers-5 | ||
yarn | ||
npx ts-node json-rpc-https-provider.ts | ||
``` | ||
|
||
### Ethers 6 | ||
|
||
```bash | ||
bash .env | ||
cd ethers-6 | ||
yarn | ||
npx ts-node json-rpc-https-provider.ts | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Installation Instructions: https://docs.ethers.io/v5/getting-started | ||
import { ethers } from "ethers"; | ||
|
||
const RPC_URL = `https://mainnet.gateway.tenderly.co/${process.env.TENDERLY_NODE_ACCESS_KEY}`; | ||
|
||
await (async () => { | ||
// Initialize an ethers provider instance | ||
const provider = new ethers.providers.JsonRpcProvider(RPC_URL); | ||
|
||
const blockNumber = await provider.getBlockNumber(); | ||
|
||
console.log(blockNumber); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Installation Instructions: https://docs.ethers.io/v5/getting-started | ||
import { ethers } from "ethers"; | ||
|
||
const RPC_URL_WSS = `wss://mainnet.gateway.tenderly.co/${process.env.TENDERLY_NODE_ACCESS_KEY}`; | ||
|
||
await (async () => { | ||
// Initialize an ethers provider instance | ||
const provider = new ethers.providers.WebSocketProvider(RPC_URL_WSS); | ||
|
||
const blockNumber = await provider.getBlockNumber(); | ||
|
||
console.log(blockNumber); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "simulations", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@types/node": "^20.12.7", | ||
"ethers": "^5.7.2", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^5.4.5" | ||
} | ||
} |
Oops, something went wrong.