-
Notifications
You must be signed in to change notification settings - Fork 47
feat: Adding Local node using Anvil #594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds comprehensive local testing capabilities using Anvil, eliminating the need for testnet funds and enabling three distinct testing modes: Docker + Anvil (default), Standalone, and Testnet. The key architectural change is that tests now discover relayers dynamically via the API rather than reading from static config files, creating a single source of truth.
Key changes:
- Anvil Integration: Automated local Ethereum node with contract deployment and lifecycle management scripts
- API-based Discovery: Tests query the running relayer service for available relayers instead of parsing config files
- Mode-based Configuration: Separate config directories for local and testnet modes with environment-driven selection
Reviewed changes
Copilot reviewed 20 out of 22 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
tests/integration/tests/relayer_api.rs |
Updated CRUD tests to dynamically select network from enabled options, preferring "sepolia" for backward compatibility; simplified delete test to single relayer instead of bulk deletion |
tests/integration/tests/evm/contract_interaction.rs |
Changed type from custom RelayerInfo to standard RelayerResponse for API-based discovery |
tests/integration/tests/evm/basic_transfer.rs |
Changed type from custom RelayerInfo to standard RelayerResponse for API-based discovery |
tests/integration/config/local/registry.json |
Added local network configuration for Anvil with contract address for localhost-integration network |
tests/integration/config/local/keys/.gitkeep |
Placeholder for local Anvil keystore directory |
tests/integration/config/local/config.json |
Configuration for local Anvil relayer and signer using test keystore |
tests/integration/common/registry.rs |
Replaced file-based relayer discovery with API-based discovery; updated registry to support environment-based path selection |
tests/integration/common/evm_helpers.rs |
Updated type signatures from RelayerInfo to RelayerResponse to match API responses |
tests/integration/common/context.rs |
Made relayer discovery async to support API calls; updated type references |
tests/integration/common/confirmation.rs |
Added directory check to skip non-files when loading network timing configurations |
tests/integration/common/client.rs |
Removed unused delete_all_relayers_by_network method as tests now use individual deletion |
tests/integration/README.md |
Comprehensive documentation update covering all three testing modes with detailed setup instructions and architecture explanation |
scripts/run-integration-docker.sh |
Added MODE support (local/testnet) with profile-based service orchestration, Anvil health checks, and contract deployment integration |
scripts/deploy-local-contracts.sh |
New script to deploy test contracts to Anvil and update registry with deployed addresses |
scripts/anvil-local.sh |
New script for standalone Anvil lifecycle management with automated contract deployment |
docker-compose.integration.yml |
Added Anvil service with local profile, updated relayer to use dynamic config source, added health checks and dependencies |
config/networks/local-anvil.json |
Network configuration for standalone localhost Anvil (port 8545) |
config/networks/local-anvil-integration.json |
Network configuration for Docker Compose Anvil using service name (anvil:8545) |
Dockerfile.integration |
Simplified dependency caching by using cargo fetch instead of dummy build |
.gitignore |
Added patterns for local/testnet config directories and standalone auto-generated configs |
.github/workflows/integration-tests.yaml |
Updated CI to use testnet mode with proper config paths and KMS flag |
.env.integration.example |
Added MODE configuration and enhanced comments for local vs testnet usage |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
zeljkoX
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Added few comments.
Trying to test it.
zeljkoX
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for you work.
Added few nit comments.
Was able to run it locally
Summary
Three Testing Modes
🏗️ Infrastructure Components