The Agglayer Sandbox provides a comprehensive development environment for testing cross-chain bridging operations, smart contract interactions, and multi-layer blockchain scenarios.
A Docker-based development environment that simulates the Polygon Agglayer ecosystem locally, supporting:
- Cross-chain bridging between L1 and L2 networks
- Multi-L2 scenarios with up to 3 chains
- Fork mode for testing against real network state
- LXLY bridge operations with complete asset and message bridging
┌─────────────────┐ ┌─────────────────────┐ ┌─────────────────┐
│ L1 (Anvil) │◄────────┤ AggKit ├────────►│ L2 (Anvil) │
│ Port: 8545 │ │ REST API: 5577 │ │ Port: 8546 │
│ Network ID: 0 │ │ RPC: 8555 │ │ Network ID: 1 │
│ │ │ Telemetry: 8080 │ │ │
└─────────────────┘ └─────────────────────┘ └─────────────────┘
▲ ▲
│ │
└─────────────────────────────┼─────────────────────────────┘
│
┌─────────────────┐
│ Contract Deploy │
│ Service │
│ (runs once) │
└─────────────────┘
┌─────────────────────┐
│ AggKit-L2 │
┌──────┤ REST API: 5577 ├──────┐
│ │ RPC: 8555 │ │
│ │ Telemetry: 8080 │ │
│ └─────────────────────┘ │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ L1 (Anvil) │ │L2-1 (Anvil) │
│ Port: 8545 │ │ Port: 8546 │
│Network ID: 0│ │Network ID: 1│
└─────────────┘ └─────────────┘
│
│ ┌─────────────────────┐
└──────┤ AggKit-L3 ├──────┐
│ REST API: 5578 │ │
│ RPC: 8556 │ │
│ Telemetry: 8081 │ │
└─────────────────────┘ ▼
┌─────────────┐
│L2-2 (Anvil) │
│ Port: 8547 │
│Network ID: 2│
└─────────────┘
- Built in Rust for performance and reliability
- Rich UI with progress bars and detailed error messages
- Comprehensive commands for all sandbox operations
- JSON output support for automation
- Bridge Contracts: LXLY-compatible bridge implementation
- Bridge Extensions: Advanced bridging with contract calls
- ERC20 Tokens: Test token contracts for bridging
- Foundry-based: Modern Solidity development stack
- Anvil Nodes: Local blockchain simulation
- AggKit Services: Bridge oracles and REST APIs
- Database: PostgreSQL for bridge state
- Automatic Deployment: Contracts deployed on startup
- REST API: Query bridge state and proofs
- RPC Interface: Additional blockchain access
- Telemetry: Monitoring and observability
- Oracle Functions: Cross-chain state synchronization
- Fully local blockchain simulation
- No external dependencies
- Fast startup and deterministic behavior
- Ideal for development and CI/CD
- Fork real networks for testing
- Uses live blockchain data
- Requires API keys (Alchemy, Infura, etc.)
- Test against production state
- Three-chain setup: L1 + L2-1 + L2-2
- Cross-L2 bridging scenarios
- Can combine with fork mode
- Advanced testing capabilities
| Mode | L1 Chain | L2-1 Chain | L2-2 Chain |
|---|---|---|---|
| Local | Ethereum Sim | zkEVM Sim | PoS Sim |
| Fork | ETH Mainnet | Polygon zkEVM | Polygon PoS |
| Multi-L2 | ✅ | ✅ | ✅ |
- Asset bridging with ERC20 and ETH support
- Message bridging with contract execution
- Merkle proof verification for security
- Bridge-and-call functionality
- Rust CLI with ethers.rs integration
- Foundry for smart contract development
- Docker Compose for orchestration
- PostgreSQL for bridge state management
- Smart contract testing across chains
- Bridge integration development
- DeFi protocol cross-chain features
- Multi-chain dApp development
- Integration testing with real bridge mechanics
- Performance testing under load
- Security testing with various scenarios
- Regression testing for bridge operations
- Learning cross-chain concepts
- Understanding bridge mechanics
- Experimenting with L2 technologies
- Polygon ecosystem exploration
- Quick Start Guide - Get up and running
- CLI Reference - Complete command documentation
- Bridge Operations - Learn bridging workflows
- Configuration - Environment setup details