### Deploy EigenDA Proxy Source: https://github.com/layr-labs/eigenda/blob/master/api/proxy/README.md Instructions for deploying the EigenDA proxy, including copying an example environment file, populating it with necessary values, and starting the proxy binary. ```bash cp .env.example .env # Populate your .env file with required values. ENV_PATH=.env ./bin/eigenda-proxy --addr 127.0.0.1 --port 3100 ``` -------------------------------- ### Example: Initialize and Use LittDB - Go Source: https://github.com/layr-labs/eigenda/blob/master/litt/README.md Demonstrates the basic workflow of using LittDB: configuring and building the database, getting a table, writing a key-value pair, flushing the data to disk, and reading the value back. It utilizes the littbuilder package and context. ```go // Configure and build the database. config, err := littbuilder.DefaultConfig("path/to/where/data/is/stored") if err != nil { return err } db, err := config.Build(context.Background()) if err != nil { return err } myTable, err := db.GetTable("my-table") // this code works if the table is new or if the table already exists if err != nil { return err } // Write a key-value pair to the table. key := []byte("this is a key") value := []byte("this is a value") err = myTable.Put(key, value) if err != nil { return err } // Flush the data to disk. err = myTable.Flush() if err != nil { return err } // Congratulations! Your data is now durable on disk. // Read the value back. This works before or after a flush. val, ok, err := myTable.Get(key) if err != nil { return err } ``` -------------------------------- ### Go Function Documentation Example Source: https://github.com/layr-labs/eigenda/blob/master/docs/style-guide.md Demonstrates how to document exported functions in Go according to EigenDA's style guide. It emphasizes providing detailed explanations beyond the function name, including inputs, restrictions, return values, side effects, and performance implications. Common parameters like context, testing, and logger are generally exempt unless used unusually. ```go // This preceding comment describes the function in detail, and isn't simply a rephrasing of the function name // // It contains the sort of information listed in `3.4`. // // It describes what is returned. func FunctionName( // common parameters like context, testing, and logger don't require documentation, // unless they're being used in an unusual way ctx context.Context, // similarly, documentation *may* be omitted for parameters with blatantly obvious purpose enabled bool, // parameters without blatantly obvious purpose should contain helpful documentation which isn't just a // rephrasing of the parameter name param1 int, ) error { // ... } ``` -------------------------------- ### Download ptau Challenge File Source: https://github.com/layr-labs/eigenda/blob/master/tools/srs-utils/README.md Downloads the initial ptau challenge file from an S3 bucket. This file is the starting point for generating SRS files from the original trusted setup. ```bash wget https://pse-trusted-setup-ppot.s3.eu-central-1.amazonaws.com/challenge_0085 ``` -------------------------------- ### Example of Parsing Config with ParseConfig (Go) Source: https://github.com/layr-labs/eigenda/blob/master/common/config/README.md This example demonstrates how to use ParseConfig to load application configuration. It defines a configuration struct, a default constructor, and specifies an environment variable prefix and configuration file paths. ```Go // All environment variables will start with "MYAPP_". const MyAppPrefix = "MYAPP" type MyConfig struct { // ... } func DefaultMyConfig() *MyConfig { return ... } cfg, err := config.ParseConfig(DefaultMyConfig, MyAppPrefix, "path/to/config1.toml", ..., "path/to/configN.toml") // cfg is an instance of MyConfig that now contains all loaded config ``` -------------------------------- ### Install and Initialize Subgraph with Graph CLI Source: https://github.com/layr-labs/eigenda/blob/master/subgraphs/README.md Installs the Graph CLI globally using yarn or npm and then initializes a new subgraph by specifying the contract address and ABI file. ```shell # install on Linux yarn global add @graphprotocol/graph-cli # install if u haven't # or install on MacOS npm install -g @graphprotocol/graph-cli graph init --from-contract --abi abis/Contract.json ``` -------------------------------- ### TOML Configuration File Example Source: https://github.com/layr-labs/eigenda/blob/master/common/config/README.md This example shows how a TOML file can map to nested Go structs. The structure of the TOML file mirrors the struct definition, allowing for straightforward parsing of configuration values. ```TOML X = 1234 Y = 3.14159265359 Z = "this is a string" Bar.A = "this is another string" Bar.B = "5s" Bar.C.ValueStoredInAVariableWithALongName = "yet another string" ``` -------------------------------- ### Install Dependencies and Build Subgraph Source: https://github.com/layr-labs/eigenda/blob/master/subgraphs/README.md Installs project dependencies, prepares the pre-production environment, generates code from the schema, and builds the subgraph. ```shell yarn install yarn prepare:preprod-hoodi yarn codegen yarn build ``` -------------------------------- ### Start EigenDA Proxy with Environment Variables Source: https://github.com/layr-labs/eigenda/blob/master/api/proxy/README.md This command starts the EigenDA proxy binary after sourcing environment variables from a .env file. It ensures that all variables defined in the .env file are available to the proxy process. ```bash set -a; source ./.env; set +a; ./bin/eigenda-proxy ``` -------------------------------- ### Reduce Nesting with Early-Out Logic in Go Source: https://github.com/layr-labs/eigenda/blob/master/docs/style-guide.md Demonstrates how to reduce code nesting depth in Go functions by implementing an 'early-out' pattern. This improves readability by minimizing block indentation. The example shows a before and after state of the code. ```go if success { for _, item := range items { processItem(item) // <-- nesting here is 2 blocks deep } return nil } return error ``` ```go if !success { // early-out return error } for _, item := range items { processItem(item) // <-- now it's only 1 block deep } return nil ``` -------------------------------- ### Install and Run Mise Hooks (Bash) Source: https://github.com/layr-labs/eigenda/blob/master/README.md Installs all development tools required by EigenDA using 'mise' and sets up git pre-commit hooks for code quality checks. Ensures consistency between CI and local environments. ```bash mise install mise run install-hooks ``` -------------------------------- ### Manual Installation of Pre-commit Hooks (Bash) Source: https://github.com/layr-labs/eigenda/blob/master/README.md Manually installs or updates the pre-commit hooks for the EigenDA project. These hooks perform linting, go mod tidy checks, and format checking before each commit. ```bash ./scripts/install-hooks.sh ``` -------------------------------- ### Install mdbook-mermaid Dependencies Source: https://github.com/layr-labs/eigenda/blob/master/docs/spec/README.md This command installs the necessary JavaScript files for rendering Mermaid diagrams within the mdBook. These files are required for the diagrams to be displayed correctly in the built book. The command is executed with a specific version of mdbook-mermaid. ```bash mdbook-mermaid install . ``` -------------------------------- ### Query Pending Reservations using GraphQL Source: https://github.com/layr-labs/eigenda/blob/master/subgraphs/eigenda-payments/QUERY_EXAMPLES.md Filters and retrieves reservations that are scheduled to start in the future. This query uses a provided current Unix timestamp to identify reservations whose start timestamp is greater than the current time. Requires a current Unix timestamp. ```graphql query PendingReservations($currentTime: BigInt!) { reservations( where: { startTimestamp_gt: $currentTime } ) { account startTimestamp endTimestamp symbolsPerSecond } } ``` -------------------------------- ### Query Active Reservations using GraphQL Source: https://github.com/layr-labs/eigenda/blob/master/subgraphs/eigenda-payments/QUERY_EXAMPLES.md Filters and retrieves currently active reservations by comparing the provided current Unix timestamp with the reservation's start and end timestamps. Active reservations are those where the current time is after the start time and before the end time. Requires a current Unix timestamp. ```graphql query ActiveReservations($currentTime: BigInt!) { reservations( where: { startTimestamp_lte: $currentTime, endTimestamp_gt: $currentTime } ) { account symbolsPerSecond startTimestamp endTimestamp quorumNumbers quorumSplits } } ``` -------------------------------- ### Run LittDB Benchmark with Configuration Source: https://github.com/layr-labs/eigenda/blob/master/litt/docs/littdb_cli.md The `litt benchmark` command launches a performance benchmark for LittDB. It requires a path to a JSON configuration file that specifies storage paths, maximum throughput, and logging intervals. This helps in evaluating hardware capabilities and LittDB performance. ```json { "LittConfig": { "Paths": ["~/benchmark/volume1", "~/benchmark/volume2", "~/benchmark/volume3"], }, "MaximumWriteThroughputMB": 1024, "MetricsLoggingPeriodSeconds": 1 } ``` -------------------------------- ### Build and Run EigenDA Integration Utils Source: https://github.com/layr-labs/eigenda/blob/master/tools/integration_utils/README.md Commands to build the integration utilities tool and run its various functionalities, including parsing certificates, estimating gas, and validating the CertVerifier contract. This section covers common CLI operations and provides placeholders for necessary arguments. ```bash make build ./bin/integration_utils --help ./bin/integration_utils parse-altdacommitment --hex ./bin/integration_utils gas-exhaustion-cert-meter --help ./bin/integration_utils validate-cert-verifier \ --eigenda-network hoodi_testnet \ --json-rpc-url \ --signer-auth-key \ --cert-verifier-address ``` -------------------------------- ### Install EigenDA Contracts Dependencies (Shell) Source: https://github.com/layr-labs/eigenda/blob/master/contracts/README.md Installs project dependencies for EigenDA contracts using Yarn and Foundry. Ensure Foundry nightly and Yarn are installed beforehand. Navigate to the 'contracts' directory before running these commands. ```shell cd contracts yarn install forge install ``` -------------------------------- ### Optimism Routes - GET /get/ Source: https://github.com/layr-labs/eigenda/blob/master/api/proxy/README.md Retrieves preimage bytes using the hex-encoded commitment. This is a common GET route for both altda commitment forms. ```APIDOC ## GET /get/ ### Description Retrieves the preimage bytes associated with a given hex-encoded commitment. This GET route works for both altda commitment forms. ### Method GET ### Endpoint `/get/` ### Parameters #### Path Parameters - **hex_encoded_commitment** (string) - Required - The hex-encoded commitment to retrieve the preimage for. ### Response #### Success Response (200) - **Body** (application/octet-stream) - Required - The raw preimage bytes. ``` -------------------------------- ### Serve EigenDA Spec Locally with Make Source: https://github.com/layr-labs/eigenda/blob/master/docs/spec/README.md This command serves the EigenDA specification locally for previewing. It starts a local web server and automatically opens the default browser to the specified address. No external dependencies are explicitly mentioned beyond the 'make' utility. ```bash make serve ``` -------------------------------- ### Build LittDB CLI Binary (Makefile) Source: https://github.com/layr-labs/eigenda/blob/master/litt/docs/benchmark-data/8-27-2025/README.md This command sequence outlines the steps to build the LittDB Command Line Interface (CLI) binary using Make. It requires Go 1.24 and cloning the Eigenda repository. The resulting binary can be installed or invoked directly for benchmarking. ```bash git clone https://github.com/Layr-Labs/eigenda.git cd eigenda/litt && make build ``` -------------------------------- ### Construct DA Certificate from BlobStatusReply (Python Pseudocode) Source: https://github.com/layr-labs/eigenda/blob/master/docs/spec/src/integration/spec/5-lifecycle-phases.md Pseudocode demonstrating the construction of a DACert object from a BlobStatusReply, using an OperatorStateRetriever contract to fetch necessary on-chain data. It includes validation steps and extraction of required fields. ```python class DACert: batch_header: any blob_verification_proof: any nonsigner_stake_sigs: any cert_version: uint8 signedQuorumNumbers: bytes def get_da_cert(blob_header_hash, operator_state_retriever, cert_version_uint8) -> DACert: """ DA Cert construction pseudocode with OperatorStateRetriever @param blob_header_hash: key used for referencing blob status from disperser @param operator_state_retriever: ABI contract binding for retrieving operator state data @param cert_version_uint8: uint8 version of the certificate format to use @return DACert: EigenDA certificate used by rollup """ # Call the disperser for the info needed to construct the cert blob_status_reply = disperser_client.get_blob_status(blob_header_hash) # Validate the blob_header received, since it uniquely identifies # an EigenDA dispersal. blob_header_hash_from_reply = blob_status_reply.blob_verification_info.blob_certificate.blob_header.Hash() if blob_header_hash != blob_header_hash_from_reply: throw/raise/panic # Extract first 2 cert fields from blob status reply batch_header = blob_status_reply.signed_batch.batch_header blob_verification_proof = blob_status_reply.blob_verification_info # Get the reference block number from the batch header reference_block_number = batch_header.reference_block_number # Get quorum IDs from the blob header quorum_numbers = blob_verification_info.blob_certificate.blob_header.quorum_numbers # Retrieve operator state data directly from the OperatorStateRetriever contract operator_states = operator_state_retriever.getOperatorState( reference_block_number, quorum_numbers, blob_status_reply.signed_batch.signatures ) # Construct NonSignerStakesAndSignature using the operator state data nonsigner_stake_sigs = construct_nonsigner_stakes_and_signature( operator_states, blob_status_reply.signed_batch.signatures ) signed_quorum_numbers = blob_status_reply.signed_batch.quorum_numbers return DACert(batch_header, blob_verification_proof, nonsigner_stake_sigs, cert_version_uint8, signed_quorum_numbers) ``` -------------------------------- ### Parse Configuration from Files and Environment (Go) Source: https://github.com/layr-labs/eigenda/blob/master/common/config/README.md ParseConfig loads configuration from specified files and environment variables. Later files override earlier ones, and environment variables override file values. An environment prefix can filter which environment variables are considered. ```Go package config // ParseConfig loads data from configuration files and environment variables. // It takes a constructor function for the config type, an environment variable prefix, and a list of config file paths. // Later config files override earlier ones, and environment variables override config file values. func ParseConfig[T VerifiableConfig](constructor func() T, envPrefix string, configPaths ...string) (T, error) ``` -------------------------------- ### Display LittDB Table Information Source: https://github.com/layr-labs/eigenda/blob/master/litt/docs/littdb_cli.md The `litt table-info` utility displays information about the data contained within a LittDB table. It requires source directory paths and the table name as input. The output includes key count, size, snapshot status, and segment age details. ```bash $ litt table-info --src /data0 --src /data1 --src /data2 tableA Jun 18 11:32:11.236 INF cli/table_info.go:76 Table: tableA Jun 18 11:32:11.236 INF cli/table_info.go:77 Key count: 95 Jun 18 11:32:11.236 INF cli/table_info.go:78 Size: 190.01 MiB Jun 18 11:32:11.236 INF cli/table_info.go:79 Is snapshot: false Jun 18 11:32:11.236 INF cli/table_info.go:80 Oldest segment age: 1.05 hours Jun 18 11:32:11.236 INF cli/table_info.go:81 Oldest segment seal time: 2025-06-18T10:29:02-05:00 Jun 18 11:32:11.236 INF cli/table_info.go:82 Newest segment age: 50.88 minutes Jun 18 11:32:11.236 INF cli/table_info.go:83 Newest segment seal time: 2025-06-18T10:41:18-05:00 Jun 18 11:32:11.236 INF cli/table_info.go:84 Segment span: 12.27 minutes Jun 18 11:32:11.236 INF cli/table_info.go:85 Lowest segment index: 0 Jun 18 11:32:11.236 INF cli/table_info.go:86 Highest segment index: 95 Jun 18 11:32:11.236 INF cli/table_info.go:87 Key map type: LevelDBKeymap ``` -------------------------------- ### Get Memstore Configuration via REST API Source: https://github.com/layr-labs/eigenda/blob/master/api/proxy/store/generated_key/memstore/README.md Retrieves the current configuration of the Memstore backend using a GET request to the '/memstore/config' endpoint. The output is typically formatted as JSON, and 'jq' is used here for pretty-printing the response. This allows inspection of settings like blob size, expiration, and latency. ```bash curl http://localhost:3100/memstore/config | jq ``` -------------------------------- ### Configuration Options Source: https://github.com/layr-labs/eigenda/blob/master/api/proxy/README.md Overview of configuration options (flags and environment variables) for the eigenda-proxy. ```APIDOC ## Features and Configuration Options Below is a list of the main high-level features offered for configuring the eigenda-proxy. These features are controlled via flags and/or env vars. To view the extensive list of available flags/env-vars to configure a given version of eigenda-proxy, run `eigenda-proxy --help`. ``` -------------------------------- ### Parse Configuration from CLI Arguments (Go) Source: https://github.com/layr-labs/eigenda/blob/master/common/config/README.md ParseConfigFromCLI provides an alternative to ParseConfig by assuming command-line arguments are configuration file paths. This method simplifies configuration loading by consolidating file path discovery into the config framework itself. ```Go package config // ParseConfigFromCLI loads configuration, assuming command-line arguments are file paths. // It takes a constructor function for the config type and an environment variable prefix. // This is functionally equivalent to parsing CLI args for file paths and then calling ParseConfig. func ParseConfigFromCLI[T VerifiableConfig](constructor func() T, envPrefix string) (T, error) ``` -------------------------------- ### Database Operations Source: https://github.com/layr-labs/eigenda/blob/master/litt/README.md Interface for database-level operations such as getting tables, dropping tables, and stopping the database. ```APIDOC ## Database Interface ### Description Provides methods for interacting with the database as a whole. ### Methods - **GetTable**(name string) (Table, error) - Description: Retrieves a specific table by its name. If the table does not exist, it will be created. - **DropTable**(name string) error - Description: Deletes a table and all its associated data from the database. - **Stop**() error - Description: Gracefully stops the database, ensuring all pending operations are completed. - **Destroy**() error - Description: Permanently destroys the database and all its data. Use with caution. ``` -------------------------------- ### Get Blob Status Source: https://github.com/layr-labs/eigenda/blob/master/inabox/README.md Retrieves the current processing status of a previously dispersed blob using its request ID. ```APIDOC ## POST /disperser.Disperser/GetBlobStatus ### Description Checks the status of a blob that has been previously submitted for dispersal. ### Method POST ### Endpoint localhost:32003 disperser.Disperser/GetBlobStatus ### Parameters #### Request Body - **requestId** (string) - Required - The unique identifier for the dispersal request, obtained from the DisperseBlob response. ### Request Example ```json { "request_id": "$REQUEST_ID" } ``` ### Response #### Success Response (200) - **status** (string) - The current status of the blob (e.g., "CONFIRMED", "PROCESSING", "FAILED"). - **details** (string) - Additional details about the blob's status. ``` -------------------------------- ### Migration from EigenDA V1 to V2 Source: https://github.com/layr-labs/eigenda/blob/master/api/proxy/README.md Instructions for migrating from EigenDA V1 to V2 using either an on-the-fly approach or a service restart. ```APIDOC ## Migrating from EigenDA V1 to V2 There are two approaches for migrating from EigenDA V1 to V2: on-the-fly migration using runtime configuration, and migration with a service restart. Choose the approach that best fits your operational requirements. ### On-the-Fly Migration This approach allows you to switch from V1 to V2 while the proxy is running, without any service interruption: 1. **Configure Both V1 and V2 Backends** * Use a configuration file that includes settings for both V1 and V2 backends * See `.env.example` for an example configuration * Set `EIGENDA_PROXY_STORAGE_DISPERSAL_BACKEND=V1` in your configuration * This ensures that the proxy will continue dispersing to the V1 backend, until it's time to migrate * Set `EIGENDA_PROXY_API_ENABLED=admin` to expose the admin API * This allows runtime switching between V1 and V2 without service restart 2. **Runtime Migration** * When ready to migrate to V2, use the admin endpoint to switch dispersal targets: ```json { "eigenDADispersalBackend": "v2" } ``` * **Endpoint:** `PUT /admin/eigenda-dispersal-backend` * **Method:** `PUT` * **Request Body:** * `eigenDADispersalBackend` (string) - Required - The target dispersal backend ('v1' or 'v2'). This migration path allows for a seamless transition from V1 to V2 without service downtime and provides the ability to roll back to V1 if needed. ### Migration With Service Restart If you prefer a more controlled migration with explicit service updates, follow this approach: 1. **Initial Configuration (V1 Only)** * Start proxy with a V1-only configuration * See `.env.example` for an example configuration 2. **Prepare V2 Configuration** * Prepare a configuration file that includes settings for both V1 and V2 backends * See `.env.example` for an example configuration * Set `EIGENDA_PROXY_STORAGE_DISPERSAL_BACKEND=V2`, so that the proxy started with this config will immediately enable V2 dispersal 3. **Scheduled Migration** * During a planned migration window, stop the V1-only proxy service * Restart the proxy service, using the prepared V2 configuration. ```