Skip to content

Commit

Permalink
add integration tests for web3 signer (#124)
Browse files Browse the repository at this point in the history
* add integration tests for web3 signer
  • Loading branch information
shrimalmadhur authored May 9, 2024
1 parent c16b646 commit 363c5d7
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 5 deletions.
69 changes: 64 additions & 5 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
pull_request:

jobs:
Test:
name: Integration Test
LocalKeystore:
name: Integration Test - Local Keystore
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
Expand Down Expand Up @@ -49,14 +49,73 @@ jobs:
- name: Register Operator
run: |
cd eigenlayer-cli
echo "" | ./bin/eigenlayer operator register operator-ci.yaml
echo "" | ./bin/eigenlayer operator register tests/keystore/operator-ci.yaml
- name: Check operator status
run: |
cd eigenlayer-cli
./bin/eigenlayer operator status operator-ci.yaml
./bin/eigenlayer operator status tests/keystore/operator-ci.yaml
- name: Update operator details
run: |
cd eigenlayer-cli
echo "" | ./bin/eigenlayer operator update operator-ci.yaml
echo "" | ./bin/eigenlayer operator update tests/keystore/operator-ci.yaml
Web3Signer:
name: Integration Test - Web3 Signer
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Checkout incredible squaring
uses: actions/checkout@v4
with:
repository: layr-labs/incredible-squaring-avs
token: ${{ github.token }}
ref: master
- name: Run anvil chain
run: |
nohup make start-anvil-chain-with-el-and-avs-deployed > nohup.out 2>&1 &
- name: Install EigenLayer CLI
uses: actions/checkout@v4
with:
path: eigenlayer-cli
- name: Install less
run: |
sudo apt update
sudo apt-get install less
- name: Install EigenLayer CLI
run: |
cd eigenlayer-cli
make build
./bin/eigenlayer --version
- name: Run Web3 Signer
run: |
cd eigenlayer-cli/tests/web3signer
docker compose up -d
- name: Send funds
run: |
cd eigenlayer-cli
sleep 5
cast send 0x7dbc809c1ec153d45ffb0c75fb4fded68e34699e --value 10ether --private-key 0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6
- name: Register Operator
run: |
cd eigenlayer-cli
sleep 5
echo "HhzcmbpkHCQpvBlXrvLB" | ./bin/eigenlayer operator register tests/web3signer/operator-ci.yaml
- name: Check operator status
run: |
cd eigenlayer-cli
./bin/eigenlayer operator status tests/web3signer/operator-ci.yaml
- name: Update operator details
run: |
cd eigenlayer-cli
echo "HhzcmbpkHCQpvBlXrvLB" | ./bin/eigenlayer operator update tests/web3signer/operator-ci.yaml
File renamed without changes.
19 changes: 19 additions & 0 deletions tests/web3signer/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
services:
web3signer:
image: consensys/web3signer:develop
ports:
- "9001:9001"
command:
- '--key-config-path=/data'
- '--http-cors-origins=*'
- '--http-listen-host=0.0.0.0'
- '--http-listen-port=9001'
- '--http-host-allowlist=*'
- '--swagger-ui-enabled=true'
- '--logging=ALL'
- 'eth1'
- '--chain-id=31337'
volumes:
- "./key-config.yaml:/data/config.yaml"
- "./operator_keys:/data/keystore"
- "./passwords:/data/password"
4 changes: 4 additions & 0 deletions tests/web3signer/key-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type: "file-keystore"
keyType: "SECP256K1"
keystoreFile: "/data/keystore/opr.ecdsa.key.json"
keystorePasswordFile: "/data/password/opr.ecdsa.key.txt"
13 changes: 13 additions & 0 deletions tests/web3signer/operator-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
operator:
address: 0x7dbc809c1ec153d45ffb0c75fb4fded68e34699e
earnings_receiver_address: 0x7dbc809c1ec153d45ffb0c75fb4fded68e34699e
delegation_approver_address: 0xcaB1b44dd1f1C265405878Ac1179cd94D0dBA634
staker_opt_out_window_blocks: 0
metadata_url: https://madhur-test-public.s3.us-east-2.amazonaws.com/metadata.json
el_delegation_manager_address: 0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9
eth_rpc_url: http://localhost:8545
private_key_store_path:
signer_type: web3
chain_id: 31337
web3:
url: http://127.0.0.1:9001
1 change: 1 addition & 0 deletions tests/web3signer/operator_keys/opr.ecdsa.key.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"7dbc809c1ec153d45ffb0c75fb4fded68e34699e","crypto":{"cipher":"aes-128-ctr","ciphertext":"4152a6e1f742b561761813b43520c6a0bf54df2192201ec846a05f7995ee53af","cipherparams":{"iv":"522e00dd72923680cb4bdbf7bfbec063"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"d15d722e4b070bf447904f5ef513530a382d9aab24dcab97a7951db5bec9b6a1"},"mac":"2a69553d8b0ee3fcc127d6e2f521255950a3e95829769baaa0dd0b2383b7b842"},"id":"25c9845e-534f-4318-b0ff-eeeedf28c88d","version":3}
1 change: 1 addition & 0 deletions tests/web3signer/passwords/opr.ecdsa.key.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
HhzcmbpkHCQpvBlXrvLB

0 comments on commit 363c5d7

Please sign in to comment.