### Run Flamescope Source: https://github.com/chainsafe/lodestar/blob/unstable/docs/pages/contribution/tools/flamegraphs.md Move the `perf.out` file to the Flamescope examples directory and start the development server using `pnpm dev`. Access the analysis tool via your browser. ```sh mv /some_temp_dir/perf.out /path/to/flamescope/examples pnpm dev ``` -------------------------------- ### Example Keystore Copy Command Source: https://github.com/chainsafe/lodestar/blob/unstable/docs/pages/run/getting-started/quick-start-custom-guide.md An example of copying a keystore file to the lodestar-quickstart keystores directory. ```bash cp /home/user/validator_keys/keystore-x.json ~/lodestar-quickstart/keystores ``` -------------------------------- ### Install heaptrack-gui on Linux Source: https://github.com/chainsafe/lodestar/blob/unstable/docs/pages/contribution/tools/heap-dumps.md Install the heaptrack-gui using apt-get. This command updates package lists and installs the GUI package. ```sh sudo apt-get update sudo apt-get install -y heaptrack-gui ``` -------------------------------- ### Install Docker Engine Source: https://github.com/chainsafe/lodestar/blob/unstable/docs/pages/run/getting-started/quick-start-custom-guide.md Installs the Docker Engine, CLI, containerd.io, and necessary plugins. ```bash sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin ``` -------------------------------- ### Install Dependencies, Build, and Run Help Source: https://github.com/chainsafe/lodestar/blob/unstable/README.md This bash script installs project dependencies using pnpm, builds the project, and then displays the help message for the lodestar CLI. Ensure you have Node.js (LTS) and pnpm installed. ```bash pnpm install pnpm build ./lodestar --help ``` -------------------------------- ### Install heaptrack Source: https://github.com/chainsafe/lodestar/blob/unstable/docs/pages/contribution/tools/heap-dumps.md Installs the heaptrack profiling tool. This is a prerequisite for collecting heap dumps. ```sh # Install heaptrack $ sudo apt-get update $ sudo apt-get -y install heaptrack ``` -------------------------------- ### Install prerequisites for Docker Source: https://github.com/chainsafe/lodestar/blob/unstable/docs/pages/run/getting-started/quick-start-custom-guide.md Installs necessary packages for adding Docker's official GPG key and repository. Run each line individually. ```bash sudo apt-get install ca-certificates curl gnupg ``` -------------------------------- ### Install Dependencies Source: https://github.com/chainsafe/lodestar/blob/unstable/CONTRIBUTING.md Install all project dependencies using pnpm. This step is crucial after cloning the repository or making changes to package configurations. ```bash pnpm ``` -------------------------------- ### Install and Run Lodestar Beacon Node Source: https://context7.com/chainsafe/lodestar/llms.txt Commands to install Lodestar via script or Docker, generate a JWT secret, and start a beacon node on mainnet with or without checkpoint sync. Includes an example of expected synced output. ```bash # Install Lodestar via script curl -fsSL https://chainsafe.github.io/lodestar/install | bash ``` ```bash # Or via Docker docker pull chainsafe/lodestar ``` ```bash # Generate JWT secret for execution client authentication openssl rand -hex 32 > /path/to/jwtsecret.hex ``` ```bash # Start beacon node on mainnet ./lodestar beacon \ --network mainnet \ --jwtSecret /path/to/jwtsecret.hex \ --execution.urls http://localhost:8551 ``` ```bash # Start with checkpoint sync for faster initial sync ./lodestar beacon \ --network mainnet \ --jwtSecret /path/to/jwtsecret.hex \ --execution.urls http://localhost:8551 \ --checkpointSyncUrl https://beaconstate.ethstaker.cc ``` ```bash # Start beacon node on Hoodi testnet with metrics enabled ./lodestar beacon \ --network hoodi \ --jwtSecret /path/to/jwtsecret.hex \ --execution.urls http://localhost:8551 \ --metrics \ --metrics.address 127.0.0.1 \ --metrics.port 8008 ``` ```bash # Expected output when synced: # Jul-31 13:39:05.001[] info: Synced - slot: 9634093 - head: 0x35de...1f0e - exec-block: valid(20426886 0x10ff...) - finalized: 0x88f8...5375:301063 - peers: 70 ``` -------------------------------- ### Build Project Source: https://github.com/chainsafe/lodestar/blob/unstable/CLAUDE.md Use this command to build the entire project. ```bash pnpm build ``` -------------------------------- ### Start Testnet with Custom Configuration Source: https://github.com/chainsafe/lodestar/blob/unstable/docs/pages/contribution/testing/kurtosis.md Starts a testnet using a custom YAML configuration file. First, copy the default configuration and edit it. ```bash # Create a custom config cp lodestar.yaml my-custom-config.yaml # Edit my-custom-config.yaml # Run with custom config ./run.sh start my-custom-config.yaml ``` -------------------------------- ### Startup Mainnet Beacon Node with Nethermind (Detached) Source: https://github.com/chainsafe/lodestar/blob/unstable/docs/pages/run/getting-started/quick-start-custom-guide.md Starts a Mainnet beacon node with a Nethermind execution client in detached mode. Recommended after verifying initial setup. ```bash ./setup.sh --dataDir mainnet-data --elClient nethermind --network mainnet --dockerWithSudo --detached ``` -------------------------------- ### Example: Builder Boost Factor Calculation Source: https://github.com/chainsafe/lodestar/blob/unstable/docs/pages/run/validator-management/vc-configuration.md Example demonstrating how to calculate the `--builder.boostFactor` when accepting a builder block with 25% more value than a local execution block. ```text 10000/(100+25) = 80 ``` -------------------------------- ### Run Prover as a Proxy Server via CLI Source: https://context7.com/chainsafe/lodestar/llms.txt Installs and starts the Lodestar prover as a proxy server. Connect any Web3 application to the specified port to have RPC calls automatically verified. ```bash # Install globally npm install -g @lodestar/prover # Start prover proxy lodestar-prover proxy \ --network sepolia \ --executionRpcUrl https://lodestar-sepoliarpc.chainsafe.io \ --beaconUrls https://lodestar-sepolia.chainsafe.io \ --port 8080 # Now connect any Web3 application to http://localhost:8080 # All supported RPC calls will be automatically verified # Supported verified methods: # - eth_getBlockByHash, eth_getBlockByNumber # - eth_call, eth_estimateGas # - eth_getBalance, eth_getCode ``` -------------------------------- ### Manage Lodestar Validator Client Operations Source: https://context7.com/chainsafe/lodestar/llms.txt Commands for importing validator keystores, listing validators, and starting the validator client with fee recipient configuration or builder integration (MEV). Includes an example of expected output. ```bash # Import validator keystores from staking-deposit-cli ./lodestar validator import \ --importKeystores ./validator_keys \ --importKeystoresPassword ./password.txt ``` ```bash # List imported validators ./lodestar validator list ``` ```bash # Start validator client with fee recipient ./lodestar validator \ --network mainnet \ --suggestedFeeRecipient 0xYourEthereumAddress \ --beaconNodes http://localhost:9596 ``` ```bash # Start validator with builder integration (MEV) ./lodestar validator \ --network mainnet \ --suggestedFeeRecipient 0xYourEthereumAddress \ --builder.selection maxprofit \ --builder.boostFactor 100 ``` ```bash # Import and start in one command ./lodestar validator \ --network mainnet \ --importKeystores ./validator_keys \ --importKeystoresPassword ./password.txt \ --suggestedFeeRecipient 0xYourEthereumAddress ``` ```bash # Expected output: # Mar-31 15:27:22.472[] info: Validator statuses active=2, total=2 # Mar-31 15:27:31.162[] info: Published attestations slot=3961037, head=0x2c06...feed, count=2 ``` -------------------------------- ### Download and Run Spec Tests Source: https://github.com/chainsafe/lodestar/blob/unstable/CLAUDE.md First, download the specification tests, then run them. ```bash pnpm download-spec-tests ``` ```bash pnpm test:spec ``` -------------------------------- ### Start Second Node and Connect to Bootnode Source: https://github.com/chainsafe/lodestar/blob/unstable/docs/pages/contribution/advanced-topics/setting-up-a-testnet.md Start the second beacon node without validators and connect it to the first node using its ENR. Ensure --genesisValidators and --genesisTime match the first node. Set --network.connectToDiscv5Bootnodes to true for local devnet connections. ```bash ./lodestar dev \ --genesisValidators 8 \ --genesisTime 1669713528 \ --dataDir \ --port 9001 \ --rest.port 9597 \ --network.connectToDiscv5Bootnodes true \ --bootnodes \ --reset ``` -------------------------------- ### Run State Transition on Block Source: https://github.com/chainsafe/lodestar/blob/unstable/packages/state-transition/README.md Import necessary functions and types from the @lodestar/state-transition package. This example demonstrates how to initialize a pre-state and a block, then run the state transition to get the post-state. Ensure you have dummy test data or actual state and block objects. ```typescript import {CachedBeaconStateAllForks, stateTransition} from "@lodestar/state-transition"; import {ssz} from "@lodestar/types"; import {generateState} from "./test/utils/state.js"; // dummy test state const preState: CachedBeaconStateAllForks = generateState() as CachedBeaconStateAllForks; // dummy test block const block = ssz.phase0.SignedBeaconBlock.defaultValue(); // Run state transition on block const postState = stateTransition(preState, block); ``` -------------------------------- ### Install Monorepo Packages with pnpm Source: https://github.com/chainsafe/lodestar/blob/unstable/docs/pages/run/getting-started/installation.md Installs all dependencies for the Lodestar monorepo. Requires pnpm to be installed globally. ```bash pnpm install ``` -------------------------------- ### Start Local Development Docker Environment Source: https://github.com/chainsafe/lodestar/blob/unstable/CONTRIBUTING.md Launches a local development environment including a beacon node with metrics enabled, Prometheus, and Grafana. Assumes dashboards are available in the ./dashboards directory. ```shell ./docker/docker-compose.local_dev.sh ``` -------------------------------- ### Startup Sepolia Beacon Node with Geth Source: https://github.com/chainsafe/lodestar/blob/unstable/docs/pages/run/getting-started/quick-start-custom-guide.md Launches a Sepolia beacon node with a Geth execution client, using terminals for attached output. This is useful for initial setup and debugging. ```bash ./setup.sh --dataDir sepolia-data --elClient geth --network sepolia --dockerWithSudo --withTerminal "gnome-terminal --disable-factory --" ``` -------------------------------- ### Install Lodestar Binary Source: https://github.com/chainsafe/lodestar/blob/unstable/docs/pages/run/getting-started/installation.md Installs the latest version of Lodestar using a curl script. Ensure you have bash and curl installed. ```bash curl -fsSL https://chainsafe.github.io/lodestar/install | bash ``` -------------------------------- ### Test Docker installation Source: https://github.com/chainsafe/lodestar/blob/unstable/docs/pages/run/getting-started/quick-start-custom-guide.md Runs a test container to verify that Docker is installed and functioning correctly. A success message indicates the installation is working. ```bash sudo docker run hello-world ``` -------------------------------- ### Create Keystore Directory Source: https://github.com/chainsafe/lodestar/blob/unstable/docs/pages/run/getting-started/quick-start-custom-guide.md Use this command to create a directory for storing keystore files. ```bash mkdir keystores ``` -------------------------------- ### Install @lodestar/params Source: https://github.com/chainsafe/lodestar/blob/unstable/packages/params/README.md Install the lodestar-params package using npm. ```sh npm install @lodestar/params ``` -------------------------------- ### Install @lodestar/config Source: https://github.com/chainsafe/lodestar/blob/unstable/packages/config/README.md Install the lodestar-config package using npm. ```sh npm install @lodestar/config ``` -------------------------------- ### Bootstrap Development Environment Source: https://github.com/chainsafe/lodestar/blob/unstable/packages/cli/README.md Quickly sets up a beacon node and multiple validators, ideal for development and testing purposes. Use this for rapid prototyping. ```bash ./bin/lodestar dev ``` -------------------------------- ### Check Docker Installation Source: https://github.com/chainsafe/lodestar/blob/unstable/docs/pages/run/getting-started/installation.md Verifies if Docker is installed on your system. This command should output the Docker version. ```bash docker -v ```