Skip to content

lidofinance/lido-local-devnet

Repository files navigation

Lido Local DevNet

A project for launching a DevNet with the Lido protocol locally. The project includes starting a new network, launching a block explorer, and deploying Lido smart contracts.

Warning

This is an alpha version of the project. Stay tuned for updates.


Requirements


Getting Started

Follow these steps to spin up the DevNet:

  1. Start the Kurtosis instance
    This is required for launching Ethereum nodes:

    kurtosis engine start
  2. Install project dependencies:

    yarn && yarn submodule
  3. Install subdependencies of the project:

    ./bin/run.js install
  4. Launch the environment and deploy Lido smart contracts:

    ./bin/run.js up --full

    Optionally, use the --verify flag to deploy smart contracts with verification on the block explorer:

    ./bin/run.js up --full --verify
  5. Initiate aragon voting that enables Pectra supporting in the Lido protocol

    Since the voting scripts use Python and Brownie, install the required dependencies:

    ./bin/run.js voting install

    If you encounter errors, install additional modules as prompted.

    Next, add an account. Unfortunately, Brownie cannot fetch account settings automatically, but we provide an easy-to-use console interface for automation. Simply run the following command and enter the private key displayed in the logs:

    ./bin/run.js voting add-account

    After adding the account, initiate the first stage of transitioning the protocol to the Pectra hard fork:

    ./bin/run.js voting enact-before-pectra

    Once the initial stage is complete, finalize the transition by executing the second stage of the voting process after the Pectra hard fork:

    ./bin/run.js voting enact-after-pectra
  6. Launch validators

    After completing the up command, launch the validators with:

    ./bin/run.js validator up

    Ensure the validators have started without issues by checking the logs:

    ./bin/run.js validator logs

    On Linux, you may encounter access issues with the validator keys. To fix this, run:

    chown -R 1000:1000 artifacts/validator

    This issue will be resolved in a future release.

  7. Done!
    You have successfully launched the network, infrastructure, and protocol locally.


Stopping the DevNet

To stop the DevNet, run the following commands:

./bin/run.js validator down
./bin/run.js kapi down
./bin/run.js oracles down
./bin/run.js stop

These commands will properly delete the state of all services and restart them.


Available Services

To get the current links to available services, run:

./bin/run.js network info

This will provide the most up-to-date information on available network services.


Voluntary Exit Command

To initiate a voluntary exit for a validator from the protocol, use the following command:

./bin/run.js validator exit --mtype <MNEMONIC_TYPE> --index <VALIDATOR_INDEX>

Flags

  • --mtype: (required) Specifies the mnemonic type to use. Options:

    • genesis - Use the mnemonic from the genesis configuration.
    • generated - Use a newly generated mnemonic.
  • --index: (required) Specifies the index of the validator to exit.

Example Usage

If you want to exit a validator with index 42 using the genesis mnemonic, run:

./bin/run.js validator exit --mtype genesis --index 42

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •