### Install AggSandbox CLI with Make Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/quickstart.md This command clones the AggSandbox repository and uses the Make build tool to install the AggSandbox CLI. It sets up necessary bridge service dependencies and configures bridge functionality. ```bash # Clone the repository git clone https://github.com/agglayer/aggsandbox cd aggsandbox # Install the CLI tool make install ``` -------------------------------- ### Verify Prerequisites with Bash Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/quickstart.md This script checks if Docker, Docker Compose, Rust, Make, and Git are installed and accessible in the system's PATH. It provides immediate feedback on the installation status of each tool. ```bash # Check all required tools docker --version && echo "✅ Docker installed" docker compose version && echo "✅ Docker Compose installed" rustc --version && echo "✅ Rust installed" make --version && echo "✅ Make installed" git --version && echo "✅ Git installed" ``` -------------------------------- ### Troubleshoot AggSandbox Startup and Docker Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/quickstart.md Offers solutions for common issues when starting the `aggsandbox`, specifically focusing on Docker integration. It includes commands to check Docker version and perform a clean restart of the sandbox, potentially with volume cleaning. ```bash # Check Docker is running docker --version # Clean restart aggsandbox stop --volumes aggsandbox start --detach ``` -------------------------------- ### Start AggSandbox Environment with Docker Compose Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/quickstart.md These commands start the AggSandbox environment using Docker Compose. The first command starts the environment without automatic claim sponsoring, while the second includes the `--claim-all` flag for automatic claim sponsoring. ```bash # Start the bridge environment without automatic claim aggsandbox start --detach # Start the complete bridge environment with automatic claim sponsoring aggsandbox start --detach --claim-all ``` -------------------------------- ### Install AggSandbox Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/get-started/quickstart.md Clones the AggSandbox repository, navigates into the directory, and installs project dependencies using make. Ensure you have Git, Node.js 18+, and Docker installed. ```bash git clone https://github.com/agglayer/aggsandbox.git cd aggsandbox make install ``` -------------------------------- ### Start AggSandbox in Standard Mode Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/installation.md Starts the AggSandbox environment in standard mode, which facilitates basic L1 <-> L2 bridging. This mode sets up an L1 Ethereum network and an L2 zkEVM network, along with a bridge service for cross-chain operations. ```bash aggsandbox start --detach ``` -------------------------------- ### Install AggSandbox CLI Tool Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/installation.md Clones the AggSandbox repository from GitHub, navigates into the directory, and installs the command-line interface (CLI) tool using the `make install` command. It concludes by verifying the installation by displaying the help message. ```bash # Clone repository git clone https://github.com/agglayer/aggsandbox cd aggsandbox # Install CLI tool make install # Verify installation aggsandbox --help ``` -------------------------------- ### Start Aggsandbox in Fork Mode (Bash) Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/installation.md Starts the Aggsandbox environment in fork mode and detaches the process. This mode allows testing against actual production contract addresses and configurations, providing realistic testing scenarios with authentic token balances and network states. ```bash aggsandbox start --fork --detach ``` -------------------------------- ### Install Make and Git on Ubuntu/Debian and macOS Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/installation.md Installs the `make` utility and `git` version control system. Provides commands for both Ubuntu/Debian systems using `apt-get` and for macOS using Homebrew. Verifies the installation of both tools. ```bash # Ubuntu/Debian sudo apt-get update sudo apt-get install -y make git # macOS (with Homebrew) brew install make git # Verify installation make --version git --version ``` -------------------------------- ### Resolve 'Command Not Found' Errors Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/quickstart.md Addresses the 'Command Not Found' error when trying to execute `aggsandbox` or other installed binaries. It suggests ensuring the installation directory is in the system's PATH or provides instructions for reinstalling the necessary components. ```bash # Ensure ~/.local/bin is in PATH export PATH="$HOME/.local/bin:$PATH" # Or reinstall make install ``` -------------------------------- ### Windows (WSL2) Specific Installation Steps (Bash) Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/installation.md Guide for Windows users installing Aggsandbox via WSL2. It ensures WSL2 is set to the default version, installs necessary packages within the WSL2 environment, and directs users to follow standard Linux installation procedures. ```bash # Ensure WSL2 is running wsl --set-default-version 2 # Install in WSL2 environment sudo apt-get update sudo apt-get install -y make git curl build-essential # Follow Linux installation steps ``` -------------------------------- ### Start Agglayer Local Environment Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/get-started/quickstart.md Starts the Agglayer local development environment using the aggsandbox tool. The --detach flag runs the environment in the background. You can also fork from mainnet for testing with real data using the --fork flag. ```bash aggsandbox start --detach # Or fork from mainnet for testing with real data aggsandbox start --fork --detach ``` -------------------------------- ### Automated Bridge Testing with Python Framework Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/quickstart.md Provides examples of using the Python testing framework for automated bridge tests. It includes commands to run specific test scripts for L1-L2 and L2-L1 asset bridging and claiming, as well as bridge-and-call operations. ```python # Run automated bridge tests python3 test/L1-L2/test_bridge_asset_and_claim.py 25 python3 test/L2-L1/test_bridge_asset_and_claim.py 15 python3 test/L1-L2/test_bridge_and_call_and_claim.py 5 ``` -------------------------------- ### Start AggSandbox in Multi-L2 Mode for L2 <-> L2 Bridging Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/installation.md Initiates AggSandbox in multi-L2 mode to enable L2 <-> L2 bridging. This setup includes an L1 Ethereum network, a primary L2 zkEVM network, and a secondary L2 network, coordinated by an enhanced bridge service. ```bash aggsandbox start --multi-l2 --detach ``` -------------------------------- ### Verify Agglayer Installation Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/get-started/quickstart.md Verifies the Agglayer local environment by checking available bridges on a specific network and monitoring chain events. These commands help confirm that the sandbox is running as expected. ```bash aggsandbox show bridges --network 0 aggsandbox events --chain anvil-l1 ``` -------------------------------- ### Copy Base Genesis Template Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/cdk/cdk-opgeth/devnet-deployment-guide.md Copies the example base genesis file. This file will be populated with the contents of your specific genesis configuration. ```bash cp ./tools/createSovereignGenesis/genesis-base.json.example ./tools/createSovereignGenesis/genesis-base.json ``` -------------------------------- ### Customize Docker Compose for AggSandbox Resources Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/installation.md Illustrates how to customize the `docker-compose.yml` file to manage resource allocation for services within AggSandbox. This example shows how to set memory and CPU limits and reservations for the `anvil-l1` service. ```yaml # Custom resource limits services: anvil-l1: deploy: resources: limits: memory: 1G cpus: '0.5' reservations: memory: 512M cpus: '0.25' ``` -------------------------------- ### OP Stack: Start Core Services Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/cdk/cdk-opgeth/devnet-deployment-guide.md Starts the essential OP Stack services, including the `op-geth` node, `op-node`, and `op-batcher`, using Docker Compose. These services form the foundation of the Layer 2 network. ```bash docker compose up -d op-geth docker compose up -d op-node docker compose up -d op-batcher ``` -------------------------------- ### Ubuntu/Debian Specific Installation Steps (Bash) Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/installation.md Instructions for Ubuntu/Debian users to install Aggsandbox. It covers updating the package manager, installing essential build tools, and ensuring necessary SSL certificates are present. ```bash # Update package manager sudo apt-get update # Install build essentials sudo apt-get install -y build-essential curl # Fix potential SSL issues sudo apt-get install -y ca-certificates ``` -------------------------------- ### Manage AggSandbox Service Lifecycle Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/installation.md Provides commands to manage the AggSandbox service. It includes starting the sandbox in detached mode, checking its current status, viewing detailed information and configuration, and stopping the sandbox service. ```bash # Start sandbox aggsandbox start --detach # Check status aggsandbox status # View configuration aggsandbox info # Stop sandbox aggsandbox stop ``` -------------------------------- ### Copy Sovereign Genesis Parameter File Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/cdk/cdk-opgeth/devnet-deployment-guide.md Copies an example parameter file for creating sovereign genesis. This file will be updated with specific network details. ```bash cp ./tools/createSovereignGenesis/create-genesis-sovereign-params.json.example ./tools/createSovereignGenesis/create-genesis-sovereign-params.json ``` -------------------------------- ### Start Local MkDocs Development Server (Bash) Source: https://context7.com/agglayer/agglayer-docs/llms.txt This script sets up a Python virtual environment, installs project dependencies from 'requirements.txt', and starts the MkDocs development server with live reload functionality. It's used for local documentation editing and previewing. Access the documentation at http://127.0.0.1:8000/. ```bash #!/usr/bin/env bash # run.sh - Setup and start local development server # Create virtual environment python3 -m venv venv source venv/bin/activate # Install dependencies pip3 install -r requirements.txt # Start development server with live reload mkdocs serve # Access documentation at http://127.0.0.1:8000/ # Changes to markdown files will automatically reload the browser ``` -------------------------------- ### Aggkit: Start PostgreSQL Database Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/cdk/cdk-opgeth/devnet-deployment-guide.md Starts the PostgreSQL database service using Docker Compose, which is a dependency for the `aggkit` and `bridge` services to store and manage data. ```bash docker compose up -d db ``` -------------------------------- ### Configure AggSandbox Environment Variables Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/installation.md Demonstrates how to customize AggSandbox settings by creating and editing an optional `.env` file. It shows the process of copying an example configuration file and provides a list of common environment variables for network, service ports, Docker, and logging. ```bash # Copy example configuration cp .env.example .env # Edit configuration nano .env # Available Variables: # Network Configuration # FORK_URL_L1=https://eth-mainnet.alchemyapi.io/v2/your-key # FORK_URL_L2=https://polygon-mainnet.alchemyapi.io/v2/your-key # # Service Ports # L1_RPC_PORT=8545 # L2_RPC_PORT=8546 # BRIDGE_API_PORT=5577 # # Docker Configuration # DOCKER_COMPOSE_FILE=docker-compose.yml # DOCKER_NETWORK=aggsandbox_default # # Logging # LOG_LEVEL=info # DEBUG_MODE=false ``` -------------------------------- ### Install Docker and Docker Compose on Ubuntu/Debian Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/installation.md Installs Docker and Docker Compose using convenience scripts and direct download for the Ubuntu/Debian Linux distributions. Verifies the installation by checking the versions of both Docker and Docker Compose. ```bash # Install Docker (Ubuntu/Debian) curl -fsSL https://get.docker.com -o get-docker.sh sh get-docker.sh # Install Docker Compose sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose # Verify installation docker --version docker compose version ``` -------------------------------- ### Configure and Test Multi-L2 Mode with AggSandbox CLI Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/quickstart.md Shows how to enable and utilize the Multi-L2 mode in `aggsandbox` for testing L2-to-L2 bridging. This involves stopping the current sandbox, starting it with the `--multi-l2` flag, and then performing an L2-to-L2 asset bridge. ```bash # Stop current sandbox aggsandbox stop # Start with L2-L2 support aggsandbox start --multi-l2 --detach # Test L2-L2 bridging aggsandbox bridge asset \ --network 1 --destination-network 2 \ --amount 10 \ --token-address 0x5FbDB2315678afecb367f032d93F642f64180aa3 ``` -------------------------------- ### macOS Specific Installation Steps (Bash) Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/installation.md Commands for macOS users to ensure a smooth Aggsandbox installation. This includes installing Xcode command line tools, Homebrew dependencies, and addressing potential M1 chip issues by running make commands with `arch -arm64`. ```bash # Install Xcode command line tools xcode-select --install # Install Homebrew dependencies brew install make git # Fix potential M1 issues arch -arm64 make install ``` -------------------------------- ### Install Rust Toolchain Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/installation.md Installs the Rust programming language toolchain using the official `rustup.rs` script. It then sources the environment to make Rust commands available and verifies the installation by checking the Rust compiler (`rustc`) and package manager (`cargo`) versions. ```bash # Install Rust curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source ~/.cargo/env # Verify installation rustc --version cargo --version ``` -------------------------------- ### Launch cdk-opgeth Stack with Kurtosis Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/cdk/cdk-opgeth/local-guide.md This command deploys a local L1 devnet, Agglayer contracts, op-geth, op-node, op-batcher, and Aggkit/op-succinct infrastructure using Kurtosis. It requires the Kurtosis CLI to be installed. ```bash kurtosis run \ --enclave cdk \ --args-file https://raw.githubusercontent.com/0xPolygon/kurtosis-cdk/refs/tags/v0.4.0/.github/tests/chains/op-succinct.yml \ github.com/0xPolygon/kurtosis-cdk@v0.4.0 ``` -------------------------------- ### Troubleshoot Build Failures (Bash) Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/installation.md Steps to address build failures during Aggsandbox compilation. Includes cleaning the build, reinstalling, checking build logs, and updating Rust dependencies. ```bash # Clean build make clean make install # Check build logs make build 2>&1 | tee build.log # Update dependencies rustup update ``` -------------------------------- ### Display AggSandbox Configuration Info with Bash Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/quickstart.md This command retrieves and displays detailed information about the AggSandbox configuration, including available accounts with private keys, network details (RPCs, Chain IDs), and deployed contract addresses for bridge contracts and test tokens. ```bash # See available accounts and contracts aggsandbox info ``` -------------------------------- ### Verify AggSandbox Installation and Docker Integration Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/installation.md Checks if the AggSandbox CLI is accessible and displays its help message. It also verifies the installation and availability of Docker and Docker Compose, along with the Rust toolchain, ensuring all essential components are correctly set up. ```bash # Check CLI is available aggsandbox --help # Check Docker integration docker --version docker compose version # Check Rust toolchain rustc --version ``` -------------------------------- ### Web3.js Provider Setup with JavaScript Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/lxlyjs/installation.md Configures the LxLyClient to use a Web3.js provider. This involves importing necessary modules, enabling the Web3 client plugin, and initializing the client. ```javascript import { LxLyClient, use } from '@maticnetwork/lxlyjs'; import { Web3ClientPlugin } from '@maticnetwork/maticjs-web3'; import HDWalletProvider from '@truffle/hdwallet-provider'; // Enable Web3.js support use(Web3ClientPlugin); const client = new LxLyClient(); ``` -------------------------------- ### Configuration File Setup with JavaScript Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/lxlyjs/installation.md Loads environment variables using dotenv and exports a configuration object for Lxly.js. This object includes network details, bridge and wrapper addresses, token addresses, and user account information. ```javascript const dotenv = require('dotenv'); dotenv.config(); module.exports = { network: process.env.NETWORK || 'testnet', configuration: { 0: { rpc: process.env.NETWORK_0_RPC, bridgeAddress: process.env.NETWORK_0_BRIDGE, wrapperAddress: process.env.NETWORK_0_WRAPPER, isEIP1559Supported: true }, 1: { rpc: process.env.NETWORK_1_RPC, bridgeAddress: process.env.NETWORK_1_BRIDGE, isEIP1559Supported: false } }, tokens: { 0: { ether: '0x0000000000000000000000000000000000000000', erc20: '0x3fd0A53F4Bf853985a95F4Eb3F9C9FDE1F8e2b53' // Example token }, 1: { ether: '0x0000000000000000000000000000000000000000', erc20: '0x3cc6055f4e88638c46daa9cf5f5fc54a801e5f03' // Wrapped token } }, user1: { privateKey: process.env.USER1_PRIVATE_KEY, address: process.env.USER1_FROM } }; ``` -------------------------------- ### OP Stack: Setup Environment Variables Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/cdk/cdk-opgeth/devnet-deployment-guide.md Defines essential environment variables for the OP Stack, including chain ID and private keys for sequencer and batcher. These values are critical for initializing and running the L2 network components. ```bash CHAIN_ID=473 SEQUENCER_PRIVATE_KEY=redacted BATCHER_PRIVATE_KEY=redacted L1_RPC_URL_HTTP=https://... L1_RPC_URL_WS=wss://... ``` -------------------------------- ### Run CDK-erigon with Kurtosis (Pessimistic Proof) Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/cdk/cdk-erigon/local-deployment.md Executes a Kurtosis run to deploy a CDK chain with pessimistic proof configuration. This command utilizes a specific arguments file for detailed setup. ```bash kurtosis run --enclave cdk --args-file "https://raw.githubusercontent.com/0xPolygon/kurtosis-cdk/refs/heads/main/.github/tests/fork12-pessimistic.yml" github.com/0xPolygon/kurtosis-cdk ``` -------------------------------- ### Check AggSandbox Service Status with Bash Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/quickstart.md This command verifies that all services within the AggSandbox environment are running correctly. It provides a status report for the bridge service, L1 Ethereum node, and L2 zkEVM node. ```bash # Verify everything is running aggsandbox status ``` -------------------------------- ### Aggkit: Run Services Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/cdk/cdk-opgeth/devnet-deployment-guide.md Starts the `bridge` and `aggkit` services using Docker Compose after their configurations and dependencies have been set up. These services handle cross-chain asset transfers and data aggregation. ```bash docker compose up -d bridge docker compose up -d aggkit ``` -------------------------------- ### Bridge Asset Operations with AggSandbox CLI Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/quickstart.md Demonstrates how to use the `aggsandbox` CLI to perform asset bridging operations between different networks. This includes bridging ETH or ERC20 tokens and testing both L1 to L2 and L2 to L1 bridging scenarios. ```bash # Bridge ETH instead of ERC20 aggsandbox bridge asset \ --network 0 --destination-network 1 \ --amount 1000000000000000000 \ --token-address 0x0000000000000000000000000000000000000000 # Try L2 to L1 bridging aggsandbox bridge asset \ --network 1 --destination-network 0 \ --amount 5 \ --token-address 0x5FbDB2315678afecb367f032d93F642f64180aa3 ``` -------------------------------- ### Clone and Checkout Git Repository Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/cdk/cdk-opgeth/devnet-deployment-guide.md Clones the zkevm-contracts repository and checks out a specific version. This is the first step in setting up the development environment. ```bash git clone https://github.com/0xPolygonHermez/zkevm-contracts.git cd zkevm-contracts git checkout v10.0.0-rc.7 ``` -------------------------------- ### Troubleshoot Agglayer Services Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/get-started/quickstart.md Provides commands to stop and restart the Agglayer local development environment. It also includes a command to view detailed logs for troubleshooting. ```bash aggsandbox stop aggsandbox start --detach aggsandbox logs ``` -------------------------------- ### Troubleshoot Rust Not Found (Bash) Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/installation.md Instructions for resolving 'Rust Not Found' errors. It includes sourcing the Rust environment variables or reinstalling Rust using the official installation script. ```bash # Source Rust environment source ~/.cargo/env # Or reinstall Rust curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` -------------------------------- ### OP Stack: Initialize Data Directory Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/cdk/cdk-opgeth/devnet-deployment-guide.md Initializes the data directory for the OP Stack's `op-geth` client using a provided genesis configuration. This step prepares the necessary file structure and state for the blockchain node. ```bash docker run --rm -it \ -v $(pwd)/deployer/genesis.json:/etc/optimism/genesis.json:ro \ -v $(pwd)/datadir:/datadir \ us-docker.pkg.dev/oplabs-tools-artifacts/images/op-geth:v1.101411.3 \ init \ --state.scheme=hash \ --datadir=/datadir \ /etc/optimism/genesis.json ``` -------------------------------- ### Environment-Specific Setup: Production Configuration (JavaScript) Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/lxlyjs/client-initialization.md This JavaScript example details the configuration for a production environment. It sets the network to 'mainnet', disables logging for performance, and configures the provider using environment variables for private RPC endpoints and keys, ensuring security and reliability. ```javascript // production.js const config = { network: 'mainnet', log: false, // Disable logging in production requestConcurrency: 5, // Limit concurrent requests providers: { // Use private, reliable RPCs 0: { provider: new HDWalletProvider([process.env.PRIVATE_KEY], process.env.ETHEREUM_RPC), // ... configuration } } }; ``` -------------------------------- ### Environment Variables for Configuration Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/lxlyjs/installation.md Sets up essential network and account configuration using environment variables in a .env file. It defines network endpoints, bridge addresses, and user credentials. Note the security warning regarding private keys. ```bash # Network Configuration NETWORK=testnet # or 'mainnet' # Ethereum/Sepolia Configuration NETWORK_0_RPC=https://eth-sepolia.g.alchemy.com/v2/your-api-key NETWORK_0_BRIDGE=0x528e26b25a34a4A5d0dbDa1d57D318153d2ED582 NETWORK_0_WRAPPER=0x0f04f8434bac2e1db8fca8a34d3e177b6c7ccaba # Polygon zkEVM/Cardona Configuration NETWORK_1_RPC=https://rpc.cardona.zkevm-rpc.com NETWORK_1_BRIDGE=0x528e26b25a34a4A5d0dbDa1d57D318153d2ED582 # Account Configuration (for testing only) USER1_PRIVATE_KEY=your_private_key_here USER1_FROM=your_address_here ``` -------------------------------- ### Aggsandbox Clean Uninstall (Bash) Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/installation.md Commands to perform a clean uninstallation of Aggsandbox. This includes stopping the sandbox with volume cleanup, uninstalling the CLI, and removing the project repository. ```bash # Stop sandbox aggsandbox stop --volumes # Uninstall CLI cd aggsandbox make uninstall # Remove repository cd .. rm -rf aggsandbox ``` -------------------------------- ### Ethers.js Provider Setup with JavaScript Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/lxlyjs/installation.md Configures the LxLyClient to use an Ethers.js provider. This involves importing necessary modules, enabling the Web3 client plugin, and initializing the client. ```javascript import { LxLyClient, use } from '@maticnetwork/lxlyjs'; import { Web3ClientPlugin } from '@maticnetwork/maticjs-ethers'; import { providers, Wallet } from 'ethers'; // Enable Ethers.js support use(Web3ClientPlugin); const client = new LxLyClient(); ``` -------------------------------- ### AggSandbox Local Testing Environment Setup (Bash) Source: https://context7.com/agglayer/agglayer-docs/llms.txt This bash script sets up and configures the AggSandbox local testing environment for cross-chain bridge development. It checks for prerequisites like Docker, Docker Compose, Rust, and Make, clones the AggSandbox repository, installs its CLI tool, configures the environment variables, and starts the sandbox with claim sponsoring enabled. It also includes steps to check the service status and display environment configuration. No specific inputs or outputs are defined beyond standard console logging and error reporting. ```bash #!/bin/bash # AggSandbox Setup and Testing Script # Prerequisites check echo "Checking prerequisites..." docker --version || { echo "Docker not installed"; exit 1; } docker compose version || { echo "Docker Compose not installed"; exit 1; } rustc --version || { echo "Rust not installed"; exit 1; } make --version || { echo "Make not installed"; exit 1; } # Step 1: Clone and install AggSandbox echo "Installing AggSandbox..." git clone https://github.com/agglayer/aggsandbox cd aggsandbox # Install CLI tool to ~/.local/bin make install # Verify installation aggsandbox --help # Step 2: Configure environment echo "Configuring environment..." cp .env.example .env # Step 3: Start sandbox with claim sponsoring echo "Starting AggSandbox environment..." aggsandbox start --detach --claim-all # Wait for services to be ready echo "Waiting for services to start..." sleep 10 # Step 4: Check status aggsandbox status # Expected output: # ✅ All services are running # 📊 Bridge service: Ready # 🌐 L1 Ethereum: Ready (http://localhost:8545) # 🌐 L2 zkEVM: Ready (http://localhost:8546) # Step 5: View configuration echo "Displaying environment configuration..." aggsandbox info # Shows: # - Available test accounts with private keys # - Network RPC endpoints and chain IDs # - Pre-deployed contract addresses # - Test token addresses ``` -------------------------------- ### Troubleshoot Bridge Claim Failures and AggKit Sync Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/aggsandbox/quickstart.md Provides guidance on troubleshooting failed bridge claims. This involves checking if the bridge has been indexed using `aggsandbox show bridges` and understanding the expected synchronization times for AggKit, particularly noting the longer waits required for L2-L2 bridging. ```bash # Check if bridge is indexed aggsandbox show bridges --network-id 0 # Wait longer for AggKit sync (especially for L2-L2) # L1<->L2: ~30 seconds # L2<->L2: ~60-90 seconds ``` -------------------------------- ### Add Additional Services to params.yml (YAML) Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/cdk/cdk-erigon/local-deployment.md Configure additional services to be included in the CDK stack by modifying the `params.yml` file. This example shows how to add 'blockscout' and 'prometheus_grafana'. ```yaml args: additional_services: - blockscout - prometheus_grafana ``` -------------------------------- ### Set Network Deployment Environment Variables Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/cdk/cdk-opgeth/devnet-deployment-guide.md Sets environment variables required for network deployment, including CLAIMTX_ADDRESS, AGGORACLE_ADDRESS, and CHAIN_ID. These values should be specific to your setup. ```bash export CLAIMTX_ADDRESS=0x0e40237b464f9945FDE774a2582109Aa943b9111 export AGGORACLE_ADDRESS=0x94e8844309E40f4FFa9146a7a890077561f925bc export CHAIN_ID=473 ``` -------------------------------- ### Get Bridge UI URL from Kurtosis Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/cdk/cdk-erigon/use-native-token.md Command to retrieve the URL for the bridge UI service managed by Kurtosis. This URL is used to access the bridge interface in a web browser. ```sh kurtosis port print cdk-v1 zkevm-bridge-proxy-001 web-ui ``` -------------------------------- ### Run CDK Stack with Custom Gas Token Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/cdk/cdk-erigon/use-native-token.md Command to execute the CDK stack with a custom gas token configuration specified in params.yml. This command downloads images and starts the stack. ```sh kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . ``` -------------------------------- ### Sovereign Genesis Parameter JSON Configuration Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/cdk/cdk-opgeth/devnet-deployment-guide.md Configuration file for creating sovereign genesis parameters. It includes addresses for various network components and settings for pre-minting accounts and timelocks. ```json { "rollupManagerAddress": "polygonRollupManagerAddress", "rollupID": rollupID, "chainID": chainID, "gasTokenAddress": "gasTokenAddress", "bridgeManager": "admin address", "sovereignWETHAddress": "0x0000000000000000000000000000000000000000", "sovereignWETHAddressIsNotMintable": false, "globalExitRootUpdater": "aggoracle address", "globalExitRootRemover": "0x0000000000000000000000000000000000000000", "emergencyBridgePauser": "admin address", "setPreMintAccounts": true, "preMintAccounts": [ # add as many as you like { "balance": "1000000000000000000", "address": "admin address" } ], "setTimelockParameters": true, "timelockParameters": { "adminAddress": "admin address", "minDelay": 0 # timelock delay, for devnets it's convinient to set it to zero }, "formatGenesis": "geth" } ``` -------------------------------- ### Run CDK-erigon with Kurtosis (FEP) Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/cdk/cdk-erigon/local-deployment.md Launches a Kurtosis run to deploy a CDK chain using the FEP (presumably Feature Enhancement Proposal) configuration. This is a simpler command for a standard FEP setup. ```bash kurtosis run --enclave cdk github.com/0xPolygon/kurtosis-cdk ``` -------------------------------- ### Environment-Specific Setup: Development Configuration (JavaScript) Source: https://github.com/agglayer/agglayer-docs/blob/main/docs/agglayer/developer-tools/lxlyjs/client-initialization.md This JavaScript snippet shows the configuration for a development environment. It sets the network to 'testnet', enables logging, and configures the provider using a public RPC endpoint, suitable for local testing and development. ```javascript // development.js const config = { network: 'testnet', log: true, // Enable detailed logging providers: { // Use public RPCs for development 0: { provider: new HDWalletProvider([devPrivateKey], 'https://eth-sepolia.g.alchemy.com/v2/demo'), // ... configuration } } }; ```