Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

This README is DEPRECATED. It describes an experimental setup based on Optimism, which isn't used anymore.

Lestnet

Build and Deploy on Google Cloud Machine (recommended)

All following commands are to be run from the lestnetserver SSH terminal.

  1. ssh to the google cloud VM lestnetserver
  2. Make sure that the necessary software installed, check at https://docs.optimism.io/builders/chain-operators/tutorials/create-l2-rollup#software-dependencies, install missing software
  3. Log into gcloud from the lestnetserver SSH terminal, https://cloud.google.com/sdk/gcloud/reference/auth/login
  4. Clone this repository
    git clone https://github.com/smart-transaction/lestnet.git
    cd lestnet
    
  5. Install docker, you need it just once
    ./install_docker.sh
    
  6. Run the build script
    ./build.sh tutorials/chain
    
  7. Run the deploy script
    ./deploy.sh
    

Build and Deploy on Local Workstation

Build

[!IMPORTANT] Currently the build is to be done on Linux machines only due to geth build process restrictions. It doesn't support cross platform build.

  1. Install gcloud CLI on your workstation, https://cloud.google.com/sdk/docs/install
  2. Login to gcloud, https://cloud.google.com/sdk/gcloud/reference/auth/login
  3. Install Docker on your workstation, https://docs.docker.com/engine/install/
  4. Make sure that the necessary software installed, check at https://docs.optimism.io/builders/chain-operators/tutorials/create-l2-rollup#software-dependencies
  5. Clone this repository
    git clone https://github.com/smart-transaction/lestnet.git
    
  6. Run the build script
    ./build.sh tutorials/chain
    

Deploy

All following commands are to be run from the lestnetserver SSH terminal.

  1. ssh into the google cloud VM lestnetserver
  2. Copy scripts install_docker.sh and deploy.sh on the gcloud vm "lestnetserver", into the home directory (there are different ways to copy files to gcloud VM, not described here)
  3. Run ./install_docker.sh (only first time, no need to rerun at each deployment)
  4. Run ./deploy.sh

Configure https and wss proxy

The proxy configuration with certificates is located on the lestnetserver machine in the directory /etc/nginx/conf.d.

Connect with Metamask

There is a connection data:

Name: Lestnet
Address: https://service.lestnet.org
Chain ID: 21363

Chain ID is to be replaced with 21363.

Blockscout

There is no need to build Blockscout, it's deployed from original Docker images. We only need to customize some config parameters.

Deploy Blockscout on Google Cloud Machine

  1. ssh to the google cloud VM lestnetserver
  2. Clone this repository
    git clone https://github.com/smart-transaction/lestnet.git
    cd lestnet
    
  3. Install docker, you need it just once
    ./install_docker.sh
    
  4. Make sure docker.sock provides "all" read/write access
    sudo chmod a+rw /var/run/docker.sock
    
  5. Run the deploy_blockscout.ch script.
    ./deploy_blockscout.sh
    

L1 Deployment

We need to deploy L1 contracts rarely, when a new version is issued. The current version is op-contracts/v1.5.0

  1. Check out contracts deployment documentation, https://docs.optimism.io/builders/chain-operators/deploy/smart-contracts
  2. Check software dependencies, https://docs.optimism.io/builders/chain-operators/deploy/overview#software-dependencies
  3. Make sure the gcloud CLI is installed on your workstation, https://cloud.google.com/sdk/docs/install
  4. Login to gcloud, https://cloud.google.com/sdk/gcloud/reference/auth/login
  5. Set and export env variables
    GS_ADMIN_ADDRESS=0x07FcC5862EB168711fb0A8fD259b4318E5b94B1b
    GS_BATCHER_ADDRESS=0x44864Bdda3C02845787e0E10C8455556Cd0b6ff5
    GS_PROPOSER_ADDRESS=0x8AB2032dF58ba3eC04a173fc1B76e930D8291fA7
    GS_SEQUENCER_ADDRESS=0xc78Af82ECD90d8A08Fef3bec2C920f4719B40742
    L1_BLOCK_TIME=12
    L1_CHAIN_ID=11155111
    L1_RPC_KIND=alchemy
    L1_RPC_URL=https://eth-sepolia.g.alchemy.com/v2/ICXxRS_FHofIsVaTe_LxtU9Uaqfxw8Rc
    L2_BLOCK_TIME=2
    L2_CHAIN_ID=21363
    
  6. Generate IMPL_SALT
    export IMPL_SALT=$(openssl rand -hex 32)
    
  7. Make sure the following accounts have enough Sepolia ETH for deployment on the Sepolia Testnet :
    Account Value
    GS_ADMIN_ADDRESS 0.5 Sepolia ETH
    GS_PROPOSER_ADDRESS 0.2 Sepolia ETH
    GS_BATCHER_ADDRESS 0.1 Sepolia ETH
  8. Clone optimism repository
    git clone https://github.com/ethereum-optimism/optimism.git
    cd optimism
    
  9. Generate deployment configuration
    cd packages/contracts-bedrock
    ./scripts/getting-started/config.sh
    
    It will save the configuration into the deploy-config/getting-started.json
  10. Checkout the latest verified contracts branch. Not it's op-contracts/v1.5.0
    git checkout op-contracts/v1.5.0
    
  11. Export deployment env vars
    export DEPLOY_CONFIG_PATH=$(pwd)/deploy-config/getting-started.json
    export DEPLOY_ETH_RPC_URL=https://eth-sepolia.g.alchemy.com/v2/ICXxRS_FHofIsVaTe_LxtU9Uaqfxw8Rc
    export DEPLOY_PRIVATE_KEY=$(gcloud secrets versions access 1 --secret="GS_ADMIN_PRIVATE_KEY")
    
  12. Run contracts deployment
    pnpm build
    ./scripts/deploy.sh
    
  13. Save contracts deployment output addresses to the lestnet repo
    cp deployments/11155111-deploy.json <Lestnet Repo Directory>/getting-started-patch/.deploy
    
  14. Don't forget to push a new .deploy to lestnet repo