Skip to content

Commit

Permalink
additional files
Browse files Browse the repository at this point in the history
  • Loading branch information
dzekicb committed Oct 1, 2024
1 parent 280bb56 commit cd801f4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
9 changes: 6 additions & 3 deletions .github/actions/tenderly-testnet-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,22 @@ runs:
echo "API Response: $RESPONSE"
TESTNET_ID=$(echo $RESPONSE | jq -r '.id')
RPC_URL=$(echo $RESPONSE | jq -r '.rpc_url')
ADMIN_RPC_URL=$(echo $RESPONSE | jq -r '.rpcs[] | select(.name == "Admin RPC") | .url')
PUBLIC_RPC_URL=$(echo $RESPONSE | jq -r '.rpcs[] | select(.name == "Public RPC") | .url')
if [ -z "$TESTNET_ID" ] || [ "$TESTNET_ID" == "null" ]; then
echo "Failed to create Virtual TestNet"
exit 1
fi
echo "TENDERLY_TESTNET_ID=$TESTNET_ID" >> $GITHUB_ENV
echo "TENDERLY_RPC_URL=$RPC_URL" >> $GITHUB_ENV
echo "TENDERLY_ADMIN_RPC_URL=$ADMIN_RPC_URL" >> $GITHUB_ENV
echo "TENDERLY_PUBLIC_RPC_URL=$PUBLIC_RPC_URL" >> $GITHUB_ENV
- name: Output TestNet information
shell: bash
run: |
echo "Tenderly Virtual TestNet created successfully"
echo "TestNet ID: ${{ env.TENDERLY_TESTNET_ID }}"
echo "RPC URL: ${{ env.TENDERLY_RPC_URL }}"
echo "Admin RPC URL: ${{ env.TENDERLY_ADMIN_RPC_URL }}"
echo "Public RPC URL: ${{ env.TENDERLY_PUBLIC_RPC_URL }}"
18 changes: 12 additions & 6 deletions .github/workflows/test-tenderly-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Tenderly TestNet
uses: ./.github/actions/tenderly-testnet-action
with:
Expand All @@ -22,13 +22,19 @@ jobs:
testnet_name: 'CI TestNet'
network_id: '1'
block_number: '0x13e772b'
- name: Test RPC URL

- name: Test RPC URLs
run: |
echo "TestNet ID: ${{ env.TENDERLY_TESTNET_ID }}"
echo "RPC URL: ${{ env.TENDERLY_RPC_URL }}"
echo "Admin RPC URL: ${{ env.TENDERLY_ADMIN_RPC_URL }}"
echo "Public RPC URL: ${{ env.TENDERLY_PUBLIC_RPC_URL }}"
# Test the RPC endpoint
curl -X POST ${{ env.TENDERLY_RPC_URL }} \
# Optional: Test the Admin RPC endpoint
curl -X POST ${{ env.TENDERLY_ADMIN_RPC_URL }} \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
# Optional: Test the Public RPC endpoint
curl -X POST ${{ env.TENDERLY_PUBLIC_RPC_URL }} \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

0 comments on commit cd801f4

Please sign in to comment.