### Install Nix (Single-user) Source: https://github.com/layr-labs/hello-world-avs/blob/master/docs/nix-setup-guide.md Command to download and run the Nix installer script for a single-user (local) setup. ```bash sh <(curl -L https://nixos.org/nix/install) --no-daemon ``` -------------------------------- ### Install Nix (Multi-user) Source: https://github.com/layr-labs/hello-world-avs/blob/master/docs/nix-setup-guide.md Command to download and run the Nix installer script for a multi-user (system-wide) setup, which is the recommended approach. ```bash sh <(curl -L https://nixos.org/nix/install) --daemon ``` -------------------------------- ### Specify System for Nix Command (Apple Silicon) Source: https://github.com/layr-labs/hello-world-avs/blob/master/docs/nix-setup-guide.md Example command showing how to explicitly target the `x86_64-darwin` system when running Nix commands (`develop`, `build`, `run`, `check`) on Apple Silicon. ```bash nix (develop|build|run|check) --system x86_64-darwin # Will use the x86_64-darwin derivation ``` -------------------------------- ### Launching VSCode from Nix Shell Source: https://github.com/layr-labs/hello-world-avs/blob/master/docs/nix-setup-guide.md Starts a VSCode development session from within the Nix development shell, ensuring VSCode has access to the shell's environment, paths, and tools. ```bash nix develop --command code ``` -------------------------------- ### Use Default System for Nix Command (Apple Silicon) Source: https://github.com/layr-labs/hello-world-avs/blob/master/docs/nix-setup-guide.md Example command showing how to use the default `aarch64-darwin` system when running Nix commands on Apple Silicon, if an `aarch64-darwin` derivation is available. ```bash nix (develop|build|run|check) # Will use the aarch64-darwin derivation, if available ``` -------------------------------- ### Entering Nix Development Shell Source: https://github.com/layr-labs/hello-world-avs/blob/master/docs/nix-setup-guide.md Enters the standard Nix development shell for the project, providing all necessary dependencies and tools defined in the project's Nix configuration. ```bash nix develop ``` -------------------------------- ### Configure Extra Platforms/Paths (Apple Silicon) Source: https://github.com/layr-labs/hello-world-avs/blob/master/docs/nix-setup-guide.md Configuration lines to add `x86_64-darwin` to `extra-platforms` and specify necessary `extra-sandbox-paths` in `/etc/nix/nix.conf` or `~/.config/nix/nix.conf` for better compatibility on Apple Silicon. ```txt extra-platforms = x86_64-darwin aarch64-darwin extra-sandbox-paths = /System/Library/Frameworks /System/Library/PrivateFrameworks /usr/lib /private/tmp /private/var/tmp /usr/bin/env ``` -------------------------------- ### Enable Nix Flakes (non-NixOS) Source: https://github.com/layr-labs/hello-world-avs/blob/master/docs/nix-setup-guide.md Configuration line to add `nix-command` and `flakes` to the `experimental-features` list in `/etc/nix/nix.conf` or `~/.config/nix/nix.conf` on non-NixOS systems to enable Nix flakes. ```txt experimental-features = nix-command flakes ``` -------------------------------- ### Install Dependencies and Start Anvil (Shell) Source: https://github.com/layr-labs/hello-world-avs/blob/master/README.md Installs Node.js dependencies using npm and then starts a local Anvil chain instance, which serves as the blockchain environment for local development. ```sh npm install # Start local anvil chain npm run start:anvil ``` -------------------------------- ### Enable Nix Flakes (NixOS) Source: https://github.com/layr-labs/hello-world-avs/blob/master/docs/nix-setup-guide.md NixOS option setting to enable `nix-command` and `flakes` experimental features, required for using Nix flakes on NixOS. ```nix nix.settings.experimental-features = [ "nix-command" "flakes" ]; ``` -------------------------------- ### Reload Nix Daemon (macOS) Source: https://github.com/layr-labs/hello-world-avs/blob/master/docs/nix-setup-guide.md Commands to stop and start the Nix daemon using `launchctl` on macOS, necessary for configuration changes in `/etc/nix/nix.conf` or `~/.config/nix/nix.conf` to take effect. Requires `sudo`. ```bash sudo launchctl stop org.nixos.nix-daemon ``` ```bash sudo launchctl start org.nixos.nix-daemon ``` -------------------------------- ### Deploy Contracts and Start Operator (Shell) Source: https://github.com/layr-labs/hello-world-avs/blob/master/README.md Sets up environment files, builds contracts using forge, deploys EigenLayer and Hello World AVS contracts, optionally updates ABIs, and finally starts the Operator application. ```sh # Setup .env file cp .env.example .env cp contracts/.env.example contracts/.env # Updates dependencies if necessary and builds the contracts npm run build:forge # Deploy the EigenLayer contracts npm run deploy:core # Deploy the Hello World AVS contracts npm run deploy:hello-world # (Optional) Update ABIs npm run extract:abis # Start the Operator application npm run start:operator ``` -------------------------------- ### Entering Nix Shell (Apple Silicon) Source: https://github.com/layr-labs/hello-world-avs/blob/master/docs/nix-setup-guide.md Enters the Nix development shell specifically targeting the x86_64-darwin system, which is necessary when a native shell is not available on Apple Silicon hardware. ```bash nix develop --system x86_64-darwin ``` -------------------------------- ### Deploy, Create, and Claim Manual Distribution (Shell) Source: https://github.com/layr-labs/hello-world-avs/blob/master/README.md Starts a new Anvil instance, deploys core and AVS contracts, creates distribution roots for manual claiming, and then claims the created distributions. ```sh # Start anvil npm run start:anvil # Deploy the EigenLayer contracts npm run deploy:core # Deploy the Hello World AVS contracts npm run deploy:hello-world # Create distribution roots npm run create-distributions-root # Claim created distribution npm run claim-distributions ``` -------------------------------- ### Add Trusted Group (non-NixOS) Source: https://github.com/layr-labs/hello-world-avs/blob/master/docs/nix-setup-guide.md Configuration line to add a group (e.g., `wheel`) to the `trusted-users` list in `/etc/nix/nix.conf` on non-NixOS systems, allowing all members of the group access to the binary cache. ```txt trusted-users = @wheel root ``` -------------------------------- ### Add Trusted User (non-NixOS) Source: https://github.com/layr-labs/hello-world-avs/blob/master/docs/nix-setup-guide.md Configuration line to add a specific user to the `trusted-users` list in `/etc/nix/nix.conf` on non-NixOS systems, necessary for accessing the binary cache. Replace `USER` with the actual username. ```txt trusted-users = USER root ``` -------------------------------- ### Start Rust Challenger (sh) Source: https://github.com/layr-labs/hello-world-avs/blob/master/README.md Starts the Rust-based Challenger component, which monitors tasks and verifies operator responses on the local chain. ```sh make start-rust-challenger ``` -------------------------------- ### Start Local Anvil Chain (sh) Source: https://github.com/layr-labs/hello-world-avs/blob/master/README.md Starts a local Anvil development blockchain instance in a terminal window. ```sh anvil ``` -------------------------------- ### Start Rust Operator (sh) Source: https://github.com/layr-labs/hello-world-avs/blob/master/README.md Starts the Rust-based Operator component, which listens for tasks and provides responses on the local chain. ```sh make start-rust-operator ``` -------------------------------- ### Start Task Creation Application (Shell) Source: https://github.com/layr-labs/hello-world-avs/blob/master/README.md Executes the application responsible for creating new tasks for the Hello World AVS, simulating user requests and generating traffic. ```sh # Start the createNewTasks application npm run start:traffic ``` -------------------------------- ### Stopping Nix Daemon Service Source: https://github.com/layr-labs/hello-world-avs/blob/master/docs/nix-setup-guide.md Stops the Nix daemon service using systemctl. This command is often used to restart the daemon after making configuration changes or when troubleshooting cache issues. ```bash sudo systemctl stop nix-daemon.service ``` -------------------------------- ### Build Anvil State for Testing (sh) Source: https://github.com/layr-labs/hello-world-avs/blob/master/README.md Builds contracts and starts Anvil in the background to deploy contracts and dump the state to a JSON file for use in tests. ```sh # Build contracts make build-contracts # Starts anvil in the background with the --dump-state flag, builds and deploys the # contracts, and generates a state.json file for use in tests. make build-anvil-state-with-deployed-contracts ``` -------------------------------- ### Spam Rust Tasks (sh) Source: https://github.com/layr-labs/hello-world-avs/blob/master/README.md Starts the Spammer component to generate and send random tasks to the AVS on the local chain. ```sh make spam-rust-tasks ``` -------------------------------- ### Deploy EigenLayer and AVS Contracts (sh) Source: https://github.com/layr-labs/hello-world-avs/blob/master/README.md Copies environment files, builds smart contracts using Make, and deploys EigenLayer and Hello World AVS contracts to the local Anvil chain. ```sh cp .env.example .env cp contracts/.env.example contracts/.env # Builds the contracts make build-contracts # Deploy the EigenLayer contracts make deploy-eigenlayer-contracts # Deploy the Hello World AVS contracts make deploy-helloworld-contracts ``` -------------------------------- ### Enter Nix Development Shell (Nix) Source: https://github.com/layr-labs/hello-world-avs/blob/master/README.md Enters the project's Nix development shell, providing the necessary dependencies and environment for building and running the project on Nix platforms. ```sh nix develop ``` -------------------------------- ### Create and Claim Operator Directed Distribution (Shell) Source: https://github.com/layr-labs/hello-world-avs/blob/master/README.md Creates distribution roots specifically for operator-directed rewards and then claims these distributions. ```sh #Create distribution roots npm run create-operator-directed-distributions-root # Claim created rewards distribution npm run claim-distributions ``` -------------------------------- ### Redeploy Contracts for Debugging (sh) Source: https://github.com/layr-labs/hello-world-avs/blob/master/README.md Redeploys core and hello-world contracts using debug flags via npm scripts for troubleshooting local Anvil tests. ```sh npm run deploy:core-debug && npm run deploy:hello-world-debug ``` -------------------------------- ### Run Rust Tests (rust) Source: https://github.com/layr-labs/hello-world-avs/blob/master/README.md Executes all tests within the Rust workspace using the Cargo build tool. ```rust cargo test --workspace ``` -------------------------------- ### Verify Contract on Holesky (sh) Source: https://github.com/layr-labs/hello-world-avs/blob/master/README.md Verifies a smart contract on the Holesky testnet using the Forge command-line tool. ```sh forge verify-contract --chain-id 17000 --num-of-optimizations 200 src/YourContract.sol:YourContract YOUR_CONTRACT_ADDRESS ``` -------------------------------- ### Trace Transaction with Cast (sh) Source: https://github.com/layr-labs/hello-world-avs/blob/master/README.md Uses the Cast command-line tool to replay and trace a specific transaction hash for debugging purposes. ```sh cast call --trace "trace_replayTransaction(0xTransactionHash)" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.