### Copy example config files (JSON and TOML) Source: https://github.com/agglayer/aggkit/blob/develop/tools/exit_certificate/README.md Copies the example configuration files to create your own. The format is selected by file extension: `.toml` is parsed as TOML, anything else as JSON. The created files and the `output/` directory are git-ignored. ```bash # JSON cp parameters.json.example parameters.json ``` ```bash # or TOML cp parameters.toml.example parameters.toml ``` -------------------------------- ### AggSender ASAP trigger configuration example Source: https://github.com/agglayer/aggkit/blob/develop/docs/aggsender.md Example TOML configuration for the ASAP trigger mode. Set TriggerCertMode to "ASAP" and configure DelayBetweenCertificates and MinimumNewCertificateInterval under AggSender.TriggerASAP. ```toml [AggSender] TriggerCertMode = "ASAP" [AggSender.TriggerASAP] DelayBetweenCertificates = "1s" MinimumNewCertificateInterval = "1h" ``` -------------------------------- ### Basic Validation Call in Go Source: https://github.com/agglayer/aggkit/blob/develop/docs/aggsender_validator.md Create a validator and validate a certificate. The example shows error handling and logging on failure. ```go // Create validator validator := validator.NewAggsenderValidator( logger, flowPP, l1InfoTreeQuerier, certQuerier, lerQuerier) // Validate certificate params := types.VerifyIncomingRequest{ Certificate: cert, PreviousCertificate: prevCert, LastL2BlockInCert: blockNumber, } err := validator.ValidateCertificate(ctx, params) if err != nil { log.Errorf("Validation failed: %v", err) return err } ``` -------------------------------- ### RPCClientConfig TOML example for L1 and L2 RPC Source: https://github.com/agglayer/aggkit/blob/develop/docs/common_config.md Configures the JSON-RPC client for Ethereum nodes. The example shows settings for [L1NetworkConfig.RPC] (L1 node) and [Common.L2RPC] (L2 node). Note the different retry modes: backoff for L1 and delays for L2. ```toml [L1NetworkConfig.RPC] URL = "http://localhost:8545" Mode = "basic" HashFromJSON = false BatchBlockHeaderRetrieval = true RetryMode = "backoff" MaxRetries = 5 InitialBackoff = "5s" MaxBackoff = "60s" BackoffMultiplier = 2.0 [Common.L2RPC] URL = "http://localhost:8123" Mode = "basic" HashFromJSON = true BatchBlockHeaderRetrieval = true RetryMode = "delays" MaxRetries = 6 Delays = ["1s", "2s", "5s", "10s", "30s", "60s"] ``` -------------------------------- ### ClaimFeeEstimateResponse JSON example Source: https://github.com/agglayer/aggkit/blob/develop/docs/bridge_service.md Example response body for the L2 claim-fee-estimate request. Shows the feeestimate.ClaimFeeEstimateResponse shape with token_class 'wrapped_erc20', wrapper_exists true, applicable 'repeat_claim', gas_price snapshot, repeat_claim estimate, and unavailable reason for first_claim. ```json { "network_id": 1, "origin_network": 0, "origin_token_address": "0x3355789c8b6b7e4d3c2f1a0b9e8d7c6b5a49ff21", "token_class": "wrapped_erc20", "wrapper_exists": true, "applicable": "repeat_claim", "gas_price": { "base_fee": "15000000000", "priority_fee": "2000000000", "gas_price": "17000000000", "block_number": 123 }, "first_claim": null, "repeat_claim": { "gas_units": 110000, "cost": "1870000000000000", "sample_count": 37, "source": "class" }, "unavailable": { "first_claim": "wrapper already deployed; the first-claim estimate does not apply" }, "computed_at": 1760000000 } ``` -------------------------------- ### GET /health Source: https://github.com/agglayer/aggkit/blob/develop/tools/exit_certificate_claimer/SPEC.md Liveness/readiness probe. Returns service status and build information. ```APIDOC ## [GET] /health ### Description Liveness/readiness probe. Returns service status and build information. ### Method GET ### Endpoint /health ### Response #### Success Response (200) - **status** (string) - Always `ok`. The HTTP server only starts after the L1 Info Tree has been synced up to the certificate's settlement GER, so a reachable endpoint is always ready to serve claim requests. - **network_id** (number) - The source network ID the claimer is serving. - **version** (object) - Build/version info (same fields the exit_certificate tool prints in its startup banner): `version`, `git_rev`, `git_branch`, `build_date`, `go_version`, `os`, `arch`. Populated at build time via ldflags. #### Response Example { "status": "ok", "network_id": 1, "version": { "version": "v0.1.0", "git_rev": "abc1234", "git_branch": "feature/exit-certificate-tool", "build_date": "Mon, 30 Jun 2026 10:00:00 +0200", "go_version": "go1.22.0", "os": "linux", "arch": "amd64" } } ``` -------------------------------- ### Create local configuration for kurtosis environment Source: https://github.com/agglayer/aggkit/blob/develop/docs/local_debug.md Run this script to generate a configuration for the kurtosis environment. It also suggests a launch.json entry for VSCode debugging. ```bash scripts/local_config ``` -------------------------------- ### Build and run exit-certificate-claimer with config and CLI flags Source: https://github.com/agglayer/aggkit/blob/develop/tools/exit_certificate_claimer/README.md Builds the exit_certificate_claimer binary and runs it with various command-line options. Requires CGO_ENABLED=1 for SQLite via mattn/go-sqlite3. The --version flag (alias -v) prints build traceability info (version, git revision/branch, build date, Go version, OS/arch) matching GET /claimer/v1/health; values are injected via ldflags using the Makefile target. The healthcheck subcommand performs an HTTP probe and exits 0/1, backing the docker-compose healthcheck since the production image lacks shell/curl. ```bash make -C ../../.. $(go env GOPATH 2>/dev/null)/dev/null # (or use the repo Makefile) # from the repo root: make build-tools # builds all tools, including exit_certificate_claimer # or directly: CGO_ENABLED=1 go build -o exit-certificate-claimer ./tools/exit_certificate_claimer/service/cmd ./exit-certificate-claimer --config tools/exit_certificate_claimer/service/config.toml # derive the config from an exit_certificate config instead: ./exit-certificate-claimer --exit-certificate-config tools/exit_certificate/parameters.toml # override the bind host/port from the command line (works in both modes): ./exit-certificate-claimer --config config.toml --address 127.0.0.1 --port 9090 # emit logs in JSON format (default is the human-readable console format): ./exit-certificate-claimer --config config.toml --log-json # print the full build/version info and exit (same fields as GET /health): ./exit-certificate-claimer --version # probe a running claimer and exit 0/1 (backs the docker-compose healthcheck; the production # image has no shell or curl, so the binary performs the HTTP probe itself): ./exit-certificate-claimer healthcheck --address 127.0.0.1 --port 8080 ``` -------------------------------- ### launch.json configuration for debugging aggsender Source: https://github.com/agglayer/aggkit/blob/develop/docs/aggsender.md Generated by ./scripts/local_config_pp for debugging the aggsender component. Copy this JSON into your launch.json and start debugging. The args specify the local config file tmp/aggkit/local_config/test.kurtosis.toml and the aggsender component. ```json { "version": "0.2.0", "configurations": [ { "name": "Debug aggsender", "type": "go", "request": "launch", "mode": "auto", "program": "cmd/", "cwd": "${workspaceFolder}", "args":[ "run", "-cfg", "tmp/aggkit/local_config/test.kurtosis.toml", "-components", "aggsender", ] } ] } ``` -------------------------------- ### TOML configuration for backward-forward-let Source: https://github.com/agglayer/aggkit/blob/develop/tools/backward_forward_let/README.md Example TOML configuration required by the backward-forward-let tool. It includes sections for L2 RPC, bridge sync, Agglayer client, and BackwardForwardLET settings with key paths and passwords. ```toml [Common.L2RPC] URL = "http://localhost:8545" [BridgeL2Sync] BridgeAddr = "0x1111111111111111111111111111111111111111" [AgglayerClient.GRPC] URL = "http://localhost:4443" MinConnectTimeout = "5s" RequestTimeout = "300s" UseTLS = false [BackwardForwardLET] BridgeServiceURL = "http://localhost:8080/bridge/v1" AggsenderRPCURL = "http://localhost:5576" L2NetworkID = 1 [BackwardForwardLET.GERRemoverKey] Method = "local" Path = "/path/to/ger-remover.keystore" Password = "secret" [BackwardForwardLET.EmergencyPauserKey] Method = "local" Path = "/path/to/emergency-pauser.keystore" Password = "secret" [BackwardForwardLET.EmergencyUnpauserKey] Method = "local" Path = "/path/to/emergency-unpauser.keystore" Password = "secret" ``` -------------------------------- ### generate example with custom parameters and piping Source: https://github.com/agglayer/aggkit/blob/develop/tools/remove_ger/README.md Shows generating a scenario with custom deposit count and amount, then piping the output cast commands into a shell for execution in test environments only. ```bash # Generate scenario with custom parameters ./remove_ger generate --cfg aggkit-config.toml \ --network-id 1 \ --deposit-count 100 \ --amount 1000000000000000000 # Pipe the output cast commands into a shell (test environments only!) ./remove_ger generate --cfg aggkit-config.toml --network-id 1 2>&1 | bash ``` -------------------------------- ### Run Validator as Standalone Component Source: https://github.com/agglayer/aggkit/blob/develop/docs/aggsender_validator.md Starts only the aggsender-validator component using the specified configuration file. ```bash ./aggkit run --components aggsender-validator --cfg config.toml ``` -------------------------------- ### Remote Validator Client in Go Source: https://github.com/agglayer/aggkit/blob/develop/docs/aggsender_validator.md Create a remote validator client and use it to validate and sign a certificate. The example shows error handling and logging on failure. ```go // Create remote validator client remoteValidator, err := validator.NewRemoteValidator( grpcConfig, storage) if err != nil { return err } // Validate and sign certificate signature, err := remoteValidator.ValidateAndSignCertificate( ctx, certificate, lastL2Block) if err != nil { log.Errorf("Remote validation failed: %v", err) return err } ``` -------------------------------- ### Keystore (local) signer configuration Source: https://github.com/agglayer/aggkit/blob/develop/docs/common_config.md Configure a local keystore signer by setting Method to 'local' and providing the full path to the keystore file and its password. The example shows the configuration under the [AggSender] section. ```ini [AggSender] AggsenderPrivateKey = { Method="local", Path="/opt/private_key.kestore", Password="xdP6G8gV9PYs" } ``` -------------------------------- ### CLI invocation without signal-aware context Source: https://github.com/agglayer/aggkit/blob/develop/tools/exit_certificate/audit/Sigma_Prime_Polygon_Agglayer_Exit_Tool_Security_Assessment_Report_v2_1.pdf Starts the CLI with app.Run(os.Args) without cancellation plumbing. A SIGINT or SIGTERM abruptly terminates the process, skipping cleanup and potentially leaving partial files or DB state. ```go iferr:=app.Run(os.Args);err!=nil{// @audit no signal-aware context passed into the pipeline _,_=fmt.Fprintf(os.Stderr,"Error: %v\n",err) os.Exit(1) } ``` -------------------------------- ### OptimisticConfig TOML example Source: https://github.com/agglayer/aggkit/blob/develop/docs/aggsender.md Configures the optimistic mode for the AggSender, required when running in FEP (Fast Exit Protocol) mode. The TrustedSequencerKey must be the trusted sequencer's private key; setting RequireKeyMatchTrustedSequencer to true enables a sanity check that the signer's public key matches the trusted sequencer address. ```TOML [AggSender] [AggSender.OptimisticModeConfig] SovereignRollupAddr = "0x1234..." TrustedSequencerKey = { Method="local", Path="/opt/private_key.keystore", Password="password" } OpNodeURL = "http://localhost:8080" RequireKeyMatchTrustedSequencer = true ``` -------------------------------- ### RESTConfig CORS example for proxy [REST] section Source: https://github.com/agglayer/aggkit/blob/develop/docs/common_config.md Enables CORS for the proxy's [REST] section, allowing a frontend hosted at https://example.com to make cross-origin requests. CORS is disabled by default. When AllowCredentials is true, the Origin is reflected back instead of '*'. ```TOML [REST.CORS] Enabled = true AllowedOrigins = ["https://example.com"] AllowedMethods = ["GET", "POST", "OPTIONS"] AllowedHeaders = ["Content-Type", "Authorization"] AllowCredentials = false MaxAge = "12h" ``` -------------------------------- ### signerConfig local keystore configuration Source: https://github.com/agglayer/aggkit/blob/develop/tools/exit_certificate/README.md Configuration for signerConfig, required for Step SIGN. Uses the same JSON format as aggsender's AggsenderPrivateKey. Without this field, Step SIGN is skipped when running the full pipeline and you will need to sign manually. The example uses a local keystore file; other backends (GCP KMS, AWS KMS, etc.) are also supported. ```json "signerConfig": { "Method": "local", "Path": "/path/to/keystore.json", "Password": "your-password" } ``` -------------------------------- ### GET /bridge-address/1 response example Source: https://github.com/agglayer/aggkit/blob/develop/docs/bridgetracker/API.md Example JSON response for the GET /tracker/v1/bridge-address/{network_id} endpoint with network_id=1. Returns a single BridgeAddressItem object with network_id and bridge_address fields. ```json { "network_id": 1, "bridge_address": "0x2222222222222222222222222222222222222222" } ``` -------------------------------- ### RateLimitConfig example for AggSender.MaxSubmitCertificateRate Source: https://github.com/agglayer/aggkit/blob/develop/docs/common_config.md Configures rate limiting for the AggSender's MaxSubmitCertificateRate. If NumRequests or Interval is 0, rate limiting is disabled. When enabled, exceeding NumRequests within Interval causes the system to wait until the next interval. ```TOML [AggSender] [AggSender.MaxSubmitCertificateRate] NumRequests = 20 Interval = "1h" ``` -------------------------------- ### GET /bridge-address response example Source: https://github.com/agglayer/aggkit/blob/develop/docs/bridgetracker/API.md Example JSON response for the GET /tracker/v1/bridge-address endpoint (no network_id). Returns a BridgeAddressResponse containing an array of BridgeAddressItem objects, each with network_id and bridge_address fields. ```json { "bridges": [ { "network_id": 0, "bridge_address": "0x1111111111111111111111111111111111111111" }, { "network_id": 1, "bridge_address": "0x2222222222222222222222222222222222222222" } ] } ``` -------------------------------- ### Recommended AddBlocks() wrapper calling Sync() Source: https://github.com/agglayer/aggkit/blob/develop/tools/exit_certificate/audit/Sigma_Prime_Polygon_Agglayer_Exit_Tool_Security_Assessment_Report_v2_1.pdf Recommended consolidation to avoid duplication: make AddBlocks() a thin wrapper that calls Sync(). This preserves the semantic distinction while ensuring a single implementation. ```go func(s*BridgeSyncerLite)AddBlocks(ctxcontext.Context,fromBlock,toBlockuint64)error{ returns.Sync(ctx,fromBlock,toBlock) } ``` -------------------------------- ### Run force_ger_update with config file Source: https://github.com/agglayer/aggkit/blob/develop/tools/force_ger_update/README.md Run the tool against a config file. Copy example-config.toml and fill in your own L1URL, GlobalExitRootManagerAddr, BridgeAddr, DestinationNetwork, and PrivateKeys before running against a real network. ```bash ./target/force_ger_update --cfg tools/force_ger_update/example-config.toml ``` -------------------------------- ### Stop aggkit node started by Kurtosis CDK Source: https://github.com/agglayer/aggkit/blob/develop/docs/local_debug.md Stops the aggkit node (cdk-node-001) that was started by Kurtosis CDK, so you can run it locally for debugging. ```bash kurtosis service stop aggkit cdk-node-001 ``` -------------------------------- ### Health Check Response JSON Source: https://github.com/agglayer/aggkit/blob/develop/docs/bridge_service.md Example response from GET / and GET /health endpoints. Shows service identity, version, API revision, and per-component sync status. The api_revision field is informational and always present. ```json { "status": "ok", "time": "2025-06-05T07:30:00Z", "version": "v0.11.0", "api_revision": 1, "sync_status": "pending", "details": { "l1": { "is_active": true, "is_synced": false, "is_halted": false }, "l2": { "is_active": true, "is_synced": true, "is_halted": false }, "l2_ger": { "is_active": true, "is_halted": false }, "l1_info_tree": { "is_active": true, "is_halted": false }, "claim_l1": { "is_active": true, "is_halted": false }, "claim_l2": { "is_active": true, "is_halted": false } } } ``` -------------------------------- ### Use a prepared zkEVM config with exit_certificate Source: https://github.com/agglayer/aggkit/blob/develop/tools/exit_certificate/README.md Copies a ready-to-use zkEVM config (e.g., zkevm-mainnet.toml) and runs the tool with it. Requires editing parameters.toml fields like l1RpcUrl, exitAddress, and signerConfig. ```bash # Use a prepared zkEVM config as a starting point cp tools/exit_certificate/config-examples/zkevm-mainnet.toml parameters.toml # Edit parameters.toml (l1RpcUrl, exitAddress, signerConfig, etc.), then run ./target/exit_certificate --config parameters.toml ``` -------------------------------- ### curl requests for claim-fee-estimate Source: https://github.com/agglayer/aggkit/blob/develop/docs/bridge_service.md Two example curl requests for the GET /bridge/v1/claim-fee-estimate endpoint. The first claims on L1 (network_id 0) for the origin's native gas token; the second claims on the instance's L2 (network_id 1) for an L1 ERC20. Both use localhost:8080. ```bash # Claim on L1 (network_id 0) of the origin's native gas token curl 'localhost:8080/bridge/v1/claim-fee-estimate?network_id=0&origin_network=0&origin_token_address=0x0000000000000000000000000000000000000000' # Claim on the instance's L2 (network_id = its network id, e.g. 1) of an L1 ERC20 curl 'localhost:8080/bridge/v1/claim-fee-estimate?network_id=1&origin_network=0&origin_token_address=0x3355...ff21' ``` -------------------------------- ### Build exit_certificate directly with go Source: https://github.com/agglayer/aggkit/blob/develop/tools/exit_certificate/CLAUDE.md Builds the binary as exit-certificate in the current directory. Run from the tools/exit_certificate directory. ```bash cd tools/exit_certificate go build -o exit-certificate ./cmd ``` -------------------------------- ### agglayerClient full configuration with all fields Source: https://github.com/agglayer/aggkit/blob/develop/tools/exit_certificate/README.md Full agglayerClient configuration with all fields. Timeouts accept Go duration strings such as "5s" or "1m". Required for Steps H, SUBMIT, and WAIT. ```json "agglayerClient": { "GRPC": { "URL": "localhost:50051", "RequestTimeout": "30s", "MinConnectTimeout": "5s", "UseTLS": false, "Retry": { "MaxAttempts": 3, "InitialBackoff": "1s", "MaxBackoff": "10s", "BackoffMultiplier": 2.0 } } } ``` -------------------------------- ### GET / Source: https://github.com/agglayer/aggkit/blob/develop/docs/bridge_service.md Returns service identity/version and a summary bridge sync status. This endpoint is an alias for GET /health. ```APIDOC ## [GET] / ### Description Returns service identity/version and a summary bridge sync status. This endpoint is an alias for GET /health. ### Method GET ### Endpoint / ### Response #### Success Response (200) - **status** (string) - Overall health status. - **time** (string) - Timestamp of the health check. - **version** (string) - Service version. - **api_revision** (integer) - Wire API contract version. - **sync_status** (string) - Summary sync status (done, pending, error). - **details** (object) - Per-component breakdown. #### Response Example { "status": "ok", "time": "2025-06-05T07:30:00Z", "version": "v0.11.0", "api_revision": 1, "sync_status": "pending", "details": { "l1": { "is_active": true, "is_synced": false, "is_halted": false }, "l2": { "is_active": true, "is_synced": true, "is_halted": false }, "l2_ger": { "is_active": true, "is_halted": false }, "l1_info_tree": { "is_active": true, "is_halted": false }, "claim_l1": { "is_active": true, "is_halted": false }, "claim_l2": { "is_active": true, "is_halted": false } } } ``` -------------------------------- ### GET /health Source: https://github.com/agglayer/aggkit/blob/develop/docs/bridge_service.md Returns service identity/version and a summary bridge sync status. This endpoint is an explicit alias of the same handler as GET /. ```APIDOC ## [GET] /health ### Description Returns service identity/version and a summary bridge sync status. This endpoint is an explicit alias of the same handler as GET /. ### Method GET ### Endpoint /health ### Response #### Success Response (200) - **status** (string) - Overall health status. - **time** (string) - Timestamp of the health check. - **version** (string) - Service version. - **api_revision** (integer) - Wire API contract version. - **sync_status** (string) - Summary sync status (done, pending, error). - **details** (object) - Per-component breakdown. #### Response Example { "status": "ok", "time": "2025-06-05T07:30:00Z", "version": "v0.11.0", "api_revision": 1, "sync_status": "pending", "details": { "l1": { "is_active": true, "is_synced": false, "is_halted": false }, "l2": { "is_active": true, "is_synced": true, "is_halted": false }, "l2_ger": { "is_active": true, "is_halted": false }, "l1_info_tree": { "is_active": true, "is_halted": false }, "claim_l1": { "is_active": true, "is_halted": false }, "claim_l2": { "is_active": true, "is_halted": false } } } ``` -------------------------------- ### Build and run exit_certificate with parameters.json Source: https://github.com/agglayer/aggkit/blob/develop/tools/exit_certificate/README.md Builds the exit_certificate binary from the repo root and runs it with a JSON config. Requires editing parameters.json with RPC URLs and bridge address before running. ```bash # Build from the repo root — the binary is written to target/exit_certificate make build-exit_certificate # Create your config from the example cp tools/exit_certificate/parameters.json.example parameters.json # Edit parameters.json with your RPC URLs, bridge address, etc. # Then run the tool ./target/exit_certificate --config parameters.json ``` -------------------------------- ### Step E: Handle unclaimed assets (blocking unless ignoreUnclaimed) Source: https://github.com/agglayer/aggkit/blob/develop/tools/exit_certificate/audit/Sigma_Prime_Polygon_Agglayer_Exit_Tool_Security_Assessment_Report_v2_1.pdf Returns success with the certificate if there are no unclaimed assets or if ignoreUnclaimed is set; otherwise returns an error for unclaimed deposits. ```go iflen(unclaimedAssets)==0{ return&StepEResult{FinalCertificate: certificate},nil } ifcfg.Options.IgnoreUnclaimed{ return&StepEResult{FinalCertificate: certificate},nil } return&StepEResult{FinalCertificate:nil},fmt.Errorf("unclaimed deposits not supported ...") ``` -------------------------------- ### Run make lint Source: https://github.com/agglayer/aggkit/blob/develop/tools/force_ger_update/PLAN.md Command to run the repository-wide lint target, expecting 0 issues. ```bash make lint ``` -------------------------------- ### Build production release with make build Source: https://github.com/agglayer/aggkit/blob/develop/README.md Builds a production release of AggKit CLI and AggKit locally. ```bash make build ``` -------------------------------- ### GET /tracker/v1/health Source: https://github.com/agglayer/aggkit/blob/develop/docs/bridgetracker.md Returns health status, instance identity, and build information for the tracker service. ```APIDOC ## GET /tracker/v1/health ### Description Returns health status, instance identity, and build info. ### Method GET ### Endpoint /tracker/v1/health ### Response #### Success Response (200) - **status** (string) - Health status. - **instance** (string) - Instance identity. - **build** (string) - Build info. #### Response Example { "status": "ok", "instance": "tracker-1", "build": "v1.0.0" } ``` -------------------------------- ### Local keystore signer configuration Source: https://github.com/agglayer/aggkit/blob/develop/tools/force_ger_update/README.md Configure a local keystore signer for ForceGERUpdate. The Method field selects the backend, and the Path points to the keystore file. ```toml PrivateKeys = [ { Method = "local", Path = "/app/keystore/force_ger_update.keystore", Password = "testonly" }, ] ``` -------------------------------- ### Recommended asymmetric L1 finality configuration (TOML) Source: https://github.com/agglayer/aggkit/blob/develop/docs/aggsender.md Recommended configuration for ASAP trigger mode: relaxes only the L1InfoTreeSync sync target to LatestBlock/-N while keeping the multidownloader reorg-safety boundary and AggSender proving target at FinalizedBlock. N must stay below the chain's latest-to-finalized lag. This reduces L1→L2 GER injection delay without changing settlement safety. ```toml [L1Multidownloader] BlockFinality = "FinalizedBlock" [L1InfoTreeSync] # N must stay below the chain's latest-to-finalized lag, e.g. "LatestBlock/-12" BlockFinality = "LatestBlock/-N" [AggSender] BlockFinalityForL1InfoTree = "FinalizedBlock" ``` -------------------------------- ### VS Code launch.json for attaching to aggkit in Docker Source: https://github.com/agglayer/aggkit/blob/develop/test/e2e/envs/README.md Debugging configuration for VS Code to attach to the aggkit Docker container using dlv. Requires building with `make build-docker-debug` and uncommenting the `aggkit-001` service in docker-compose.yml. The debugger must be started every time the aggkit Docker starts, otherwise it won't run. ```json { "version": "0.2.0", "configurations": [ { "name": "Attach to aggkit in Docker (dlv)", "type": "go", "request": "attach", "mode": "remote", "host": "127.0.0.1", "port": 40000, "apiVersion": 2, "showLog": true } ] } ``` -------------------------------- ### Run aggkit binary with aggkit run Source: https://github.com/agglayer/aggkit/blob/develop/README.md Runs the aggkit binary with a configuration file and specified components. ```bash cd target/ aggkit run --cfg --components ``` -------------------------------- ### GET /tracker/v1/bridge-address Source: https://github.com/agglayer/aggkit/blob/develop/docs/bridgetracker/API.md Retrieves the bridge address. This endpoint is part of the REST API for the bridge tracker. ```APIDOC ## GET /tracker/v1/bridge-address ### Description Retrieves the bridge address. This endpoint is part of the REST API for the bridge tracker. ### Method GET ### Endpoint /tracker/v1/bridge-address ### Response No response details provided in the source. ``` -------------------------------- ### Run golangci-lint on E2E tests Source: https://github.com/agglayer/aggkit/blob/develop/tools/force_ger_update/PLAN.md Command to run golangci-lint on the E2E test package, expecting 0 issues after the t.Helper() fix. ```bash golangci-lint run --timeout 5m ./test/e2e/... ``` -------------------------------- ### Run exit_certificate with --step flag Source: https://github.com/agglayer/aggkit/blob/develop/tools/exit_certificate/README.md Shows how to run the exit_certificate tool with the --step flag to execute single steps, comma-separated lists, or inclusive ranges. Steps read dependencies from the output directory, spaces around commas are ignored, and execution stops at the first failing step. Open-ended ranges (e.g. g-) run through 'sign' but exclude 'submit' and 'wait'; use '0-wait' to run the entire flow. ```bash #!/bin/bash # Single step ./target/exit_certificate --config parameters.json --step h # Multiple steps (comma-separated, run in the given order) ./target/exit_certificate --config parameters.json --step h,i,sign ./target/exit_certificate --config parameters.json --step "sign, submit" # Ranges (inclusive) ./target/exit_certificate --config parameters.json --step a-c # a, b, c ./target/exit_certificate --config parameters.json --step g- # g, h, i, sign (open range stops at sign) ./target/exit_certificate --config parameters.json --step 0-wait # every step, including submit and wait ``` -------------------------------- ### GET /tracker/v1/network/{network_id}/tx/{tx_hash} Source: https://github.com/agglayer/aggkit/blob/develop/docs/bridgetracker.md Registers (or looks up) the bridge for the given network and transaction hash, and returns its current TrackingData. ```APIDOC ## GET /tracker/v1/network/{network_id}/tx/{tx_hash} ### Description Registers (or looks up) the bridge and returns its current `TrackingData`. ### Method GET ### Endpoint /tracker/v1/network/{network_id}/tx/{tx_hash} ### Parameters #### Path Parameters - **network_id** (string) - Required - The network identifier. - **tx_hash** (string) - Required - The transaction hash of the bridge creation. ### Response #### Success Response (200) - **bridge_status** (object|null) - `null` until the tracker resolves the creating tx. - **event** (object) - Facts from the on-chain `BridgeEvent` log: origin/destination network and address, amount, leaf type. - **block_number** (integer) - Block-level context. - **log_index** (integer) - Block-level context. - **block_timestamp** (string) - Block-level context. - **all_steps** (array|null) - `null` until the tracker resolves the creating tx. - **error** (object|null) - Step-level error on an otherwise-resolved bridge; not terminal. #### Response Example { "bridge_status": { "event": { "origin_network": "1", "destination_network": "2", "origin_address": "0x...", "destination_address": "0x...", "amount": "100", "leaf_type": "0" }, "block_number": 123456, "log_index": 3, "block_timestamp": "2023-01-01T00:00:00Z" }, "all_steps": [], "error": null } ``` -------------------------------- ### GET /bridge/v1/bridge-fee-estimate Source: https://github.com/agglayer/aggkit/blob/develop/docs/bridge_service.md Returns the estimated cost of bridging an asset out of the origin network. The estimate is per bridging mechanism and does not provide a per-token breakdown. ```APIDOC ## [GET] /bridge/v1/bridge-fee-estimate ### Description Returns the estimated cost of `bridgeAsset` out of the origin network. The estimate is per bridging mechanism and does not provide a per-token breakdown. ### Method GET ### Endpoint /bridge/v1/bridge-fee-estimate ### Parameters #### Query Parameters - **network_id** (integer) - Required - The origin network the bridge transaction runs on: `0` for L1, otherwise the instance's L2 network id. Any other value answers 400. - **token_address** (string, 0x-prefixed hex) - Required - The token address on the origin network; `0x0` is the native gas token. ### Request Example ```bash curl 'localhost:8080/bridge/v1/bridge-fee-estimate?network_id=0&token_address=0x0000000000000000000000000000000000000000' curl 'localhost:8080/bridge/v1/bridge-fee-estimate?network_id=1&token_address=0x3355...ff21' ``` ### Response #### Success Response (200) - **network_id** (integer) - The origin network id. - **token_address** (string) - The token address on the origin network. - **mechanism** (string) - The bridging mechanism: `native`, `erc20_lock`, or `wrapped_burn`. - **gas_price** (object) - Gas price details. - **base_fee** (string) - Base fee in wei. - **priority_fee** (string) - Priority fee in wei. - **gas_price** (string) - Total gas price in wei. - **block_number** (integer) - Block number. - **estimate** (object) - The fee estimate. - **gas_units** (integer) - The p90 gasUsed of observed transactions in the bucket, or the maximum when fewer than 10 samples. - **cost** (string) - `gas_units × gas_price.gas_price`, in wei. - **sample_count** (integer) - Number of observed transactions in the bucket. - **source** (string) - Always `mechanism` for this endpoint. - **computed_at** (integer) - Unix timestamp when the estimate was computed. #### Response Example ```json { "network_id": 0, "token_address": "0x0000000000000000000000000000000000000000", "mechanism": "native", "gas_price": { "base_fee": "15000000000", "priority_fee": "2000000000", "gas_price": "17000000000", "block_number": 123 }, "estimate": { "gas_units": 65000, "cost": "1105000000000000", "sample_count": 42, "source": "mechanism" }, "computed_at": 1760000000 } ``` ``` -------------------------------- ### GET /bridge/v1/sync-status Source: https://github.com/agglayer/aggkit/blob/develop/docs/bridge_service.md Returns the sync status of bridge components. The health check details are derived from the exact same computation as this endpoint, so they can never disagree. ```APIDOC ## [GET] /bridge/v1/sync-status ### Description Returns the sync status of bridge components. The health check details are derived from the exact same computation as this endpoint, so they can never disagree. ### Method GET ### Endpoint /bridge/v1/sync-status ### Response #### Success Response (200) - **l1** (object) - L1 bridge syncer status. - **l2** (object) - L2 bridge syncer status. - **l2_ger** (object) - L2 GER syncer status. - **l1_info_tree** (object) - L1 info tree syncer status. - **claim_l1** (object) - L1 claim syncer status. - **claim_l2** (object) - L2 claim syncer status. #### Response Example { "l1": { "is_active": true, "is_synced": false, "is_halted": false }, "l2": { "is_active": true, "is_synced": true, "is_halted": false }, "l2_ger": { "is_active": true, "is_halted": false }, "l1_info_tree": { "is_active": true, "is_halted": false }, "claim_l1": { "is_active": true, "is_halted": false }, "claim_l2": { "is_active": true, "is_halted": false } } ``` -------------------------------- ### Build aggkit binary with make build-aggkit Source: https://github.com/agglayer/aggkit/blob/develop/README.md Builds the aggkit debug binary locally. ```bash make build-aggkit ``` -------------------------------- ### GET /tracker/v1/health Source: https://github.com/agglayer/aggkit/blob/develop/docs/bridge_service.md Returns health status for the bridge tracker, including its own independent api_revision. This endpoint is mentioned as having its own api_revision separate from the bridge service. ```APIDOC ## [GET] /tracker/v1/health ### Description Returns health status for the bridge tracker, including its own independent api_revision. This endpoint is mentioned as having its own api_revision separate from the bridge service. ### Method GET ### Endpoint /tracker/v1/health ### Response #### Success Response (200) - **api_revision** (integer) - Wire API contract version for the bridge tracker. #### Response Example { "api_revision": 1 } ``` -------------------------------- ### GET /tracker/v1/bridge-address/{network_id} Source: https://github.com/agglayer/aggkit/blob/develop/docs/bridgetracker/API.md Retrieves the bridge address for a specific network. This endpoint is part of the REST API for the bridge tracker. ```APIDOC ## GET /tracker/v1/bridge-address/{network_id} ### Description Retrieves the bridge address for a specific network. This endpoint is part of the REST API for the bridge tracker. ### Method GET ### Endpoint /tracker/v1/bridge-address/{network_id} ### Parameters #### Path Parameters - **network_id** (uint32) - Required - Network identifier ### Response No response details provided in the source. ``` -------------------------------- ### Recommendation: Scan Transfer logs to add participants to balance-query set Source: https://github.com/agglayer/aggkit/blob/develop/tools/exit_certificate/audit/Sigma_Prime_Polygon_Agglayer_Exit_Tool_Security_Assessment_Report_v2_1.pdf Recommended fix: scan Transfer(address,address,uint256) logs up to targetBlock and add both indexed participants to the balance-query set before Step B runs. ```go for_,log:=rangetransferLogs{ from:=common.BytesToAddress(common.FromHex(log.Topics[1])[12:]) to:=common.BytesToAddress(common.FromHex(log.Topics[2])[12:]) iffrom!=(common.Address{}){ addCandidate(from) } ifto!=(common.Address{}){ addCandidate(to) } } ``` -------------------------------- ### GET /tracker/v1/activity/from/{from_address} Source: https://github.com/agglayer/aggkit/blob/develop/docs/bridgetracker/API.md Retrieves bridge activity for a given from address. This endpoint is part of the REST API for the bridge tracker. ```APIDOC ## GET /tracker/v1/activity/from/{from_address} ### Description Retrieves bridge activity for a given from address. This endpoint is part of the REST API for the bridge tracker. ### Method GET ### Endpoint /tracker/v1/activity/from/{from_address} ### Parameters #### Path Parameters - **from_address** - Required - Address to filter activity by ### Response No response details provided in the source. ``` -------------------------------- ### GET /tracker/v1/network/{network_id}/tx/{tx_hash}/ws Source: https://github.com/agglayer/aggkit/blob/develop/docs/bridgetracker.md Same bridge as the REST endpoint, but pushes a `status` WebSocket message on every change instead of polling. ```APIDOC ## GET /tracker/v1/network/{network_id}/tx/{tx_hash}/ws ### Description Same bridge as the REST endpoint, but pushes a `status` WebSocket message on every change instead of polling. ### Method GET ### Endpoint /tracker/v1/network/{network_id}/tx/{tx_hash}/ws ### Parameters #### Path Parameters - **network_id** (string) - Required - The network identifier. - **tx_hash** (string) - Required - The transaction hash of the bridge creation. ### Response #### WebSocket Message - **status** (object) - A `TrackingData` object, same structure as the REST response. #### Connection Close - Closes normally (code 1000) once the bridge reaches a terminal state: `Claimed` or the tracker gives up resolving the creating tx. - Step-level errors are not terminal; the engine keeps retrying. #### Response Example { "status": { "bridge_status": { "event": { "origin_network": "1", "destination_network": "2", "origin_address": "0x...", "destination_address": "0x...", "amount": "100", "leaf_type": "0" }, "block_number": 123456, "log_index": 3, "block_timestamp": "2023-01-01T00:00:00Z" }, "all_steps": [], "error": null } } ``` -------------------------------- ### step_e.go: fetchL1BridgeEvents scans from l1StartBlock to latest Source: https://github.com/agglayer/aggkit/blob/develop/tools/exit_certificate/audit/Sigma_Prime_Polygon_Agglayer_Exit_Tool_Security_Assessment_Report_v2_1.pdf fetchL1BridgeEvents() scans from l1StartBlock through the latest block, creating block range jobs that can include post-snapshot deposits. ```go tools/exit_certificate/step_e.go forstart:=fromBlock;start<=l1LatestBlock;start+=uint64(blockRange){ end:=min(start+uint64(blockRange)-1,l1LatestBlock) jobs=append(jobs,blockRangeJob{from: start,to: end}) } ``` -------------------------------- ### GET /bridge/v1/sync-status Source: https://github.com/agglayer/aggkit/blob/develop/docs/bridge_service.md Retrieves the synchronization status of every configured syncer. Each syncer is computed independently, so one syncer's error does not prevent others from being reported. ```APIDOC ## [GET] /bridge/v1/sync-status ### Description Retrieves the synchronization status of every configured syncer. Each syncer is computed independently, so one syncer's error does not prevent others from being reported. ### Method GET ### Endpoint /bridge/v1/sync-status ### Response #### Success Response (200) - **error** (string) - Optional - Set when this syncer's status could not be computed (an RPC or DB call failed). Omitted when there is no error. Redacted: URLs replaced with ``, bare hosts/IPs/DNS names replaced with ``. Database errors pass through unchanged. - **contract_deposit_count** (integer) - Present for `l1_info`/`l2_info` entries. Meaningless when `error` is set (shows `0` as zero value). - **synchronized_deposit_count** (integer) - Present for `l1_info`/`l2_info` entries. Meaningless when `error` is set (shows `0` as zero value). - **last_processed_block** (integer) - Optional - Absent means nothing has been processed yet (not an error). Applies to `l1_info_tree_info` and claimsync entries. - **is_halted** (boolean) - Indicates whether the syncer is halted. #### Response Example { "l1_info": { "error": ": dial tcp : connect: connection refused", "contract_deposit_count": 0, "synchronized_deposit_count": 0, "is_halted": false }, "l2_info": { "contract_deposit_count": 123, "synchronized_deposit_count": 120, "last_processed_block": 456789, "is_halted": false } } ### Error Handling This endpoint always answers HTTP 200. If a syncer's status could not be computed, its own `error` field is set, and the request never fails as a whole. Callers must inspect per-entry `error`/`is_halted` fields instead of relying on non-2xx responses. ``` -------------------------------- ### step_e.go: Recommended L1 end block check Source: https://github.com/agglayer/aggkit/blob/develop/tools/exit_certificate/audit/Sigma_Prime_Polygon_Agglayer_Exit_Tool_Security_Assessment_Report_v2_1.pdf Recommendation to require an explicit L1 end block for Step E, failing if not set, and scanning only up to that block. ```go ifcfg.Options.L1EndBlock==0{ returnnil,fmt.Errorf("l1EndBlock is required for Step E") } l1Deposits,err:=fetchL1BridgeEvents(ctx,cfg,cfg.Options.L1EndBlock) ``` -------------------------------- ### Run full exit certificate pipeline Source: https://github.com/agglayer/aggkit/blob/develop/tools/exit_certificate/README.md Executes all default steps sequentially: CHECK → 0 → A → B → C → D → E → F → G → H → I → SIGN (if signerConfig is set). Produces and signs the certificate but does not submit it. ```bash ./target/exit_certificate --config parameters.json ``` -------------------------------- ### Run backward-forward-let with config file Source: https://github.com/agglayer/aggkit/blob/develop/tools/backward_forward_let/README.md Main recovery command that diagnoses and, after confirmation, executes recovery using the specified config file. ```bash backward-forward-let --cfg aggkit-config.toml ``` -------------------------------- ### Minimal config diff for full node usage Source: https://github.com/agglayer/aggkit/blob/develop/docs/usage_ethereum_full_node.md Set the InitialLER configuration key to the initial LER hash for your rollup. Ensure the instance does not include 'bridge' in its component list. ```toml [L2NetworkConfig] InitialLER = "" ``` -------------------------------- ### Run tests for exit_certificate_claimer Source: https://github.com/agglayer/aggkit/blob/develop/tools/exit_certificate_claimer/README.md Runs all tests in the exit_certificate_claimer tool package using Go's test command. ```bash go test ./tools/exit_certificate_claimer/... ```