Skip to content
Eunsoo Park edited this page Feb 15, 2024 · 5 revisions

Intro

This repository is forked from ChainSafe/lodestar to support ICON BTP

Added features

RPC APIs

/eth/v0/beacon/icon/proof/state/{stated_id}?gindex={gindex}

Returns proof data of BeaconState + gindex at state_id. Refer to gindex

/eth/v0/beacon/icon/proof/state/receiptsRoot/{slot}

Returns proof data of BeaconState.latest_execution_payload_header.receipt_root at given slot. Proof data format is TreeOffsetsProof

Run a beacon node with Docker

  • Generate a secret key
  • Configure docker-compose.yml
  • Configure lodestar environment
  • Run execution client
  • Run consensus client

Generate a secret key

Refer chainSafe/lodestar Generate a secret key

Configure docker-compose.yml

https://github.com/icon-project/lodestar/blob/icon/docker-compose.yml

  geth_docker:
    image: ethereum/client-go:stable
    restart: always
    volumes:
      - geth_docker:/data
      - "./jwtsecret:/data/jwtsecret"
    command: --sepolia --datadir /data --http --http.addr "0.0.0.0" --http.api "eth,net,web3,admin" --cache 2048 --maxpeers 30 --authrpc.addr localhost --authrpc.port 8551 --authrpc.vhosts localhost --authrpc.jwtsecret /data/jwtsecret
    network_mode: host
    container_name: geth_docker

  beacon_node:
    image: iconloop/lodestar:stable
    restart: always
    volumes:
      - beacon_sepolia:/data
      - logs:/logs
      - "./jwtsecret:/data/jwtsecret"
    env_file: lodestar_env
    network_mode: host
    command: beacon --dataDir /data --rest --execution.urls http://127.0.0.1:8551 --rest.address 0.0.0.0 --metrics --logFile /logs/beacon.log --logFileLevel debug --logFileDailyRotate 5 --jwt-secret /data/jwtsecret --rest.namespace *

geth_docker

Secret key

  • - "./jwtsecret:/data/jwtsecret" in volumes
  • --authrpc.jwtsecret /data/jwtsecret in command

Target Network

  • --sepolia in command

beacon_node

Secret key

  • - "./jwtsecret:/data/jwtsecret" in volumes
  • --jwt-secret /data/jwtsecret in command

env_file

env_file: lodestar_env

Checkpoint sync

  • If you want to sync with checkpoint, add --checkpointSyncUrl https://beaconstate-sepolia.chainsafe.io to command

CAUTION : Do not use --checkpointSyncUrl with a running node

Configure lodestar environment

copy env file and modify LODESTAR_NETWORK

$ cp .env loadstar_env
$ cat loadstar_env
# To specify a specific network (defaults to mainnet) set this value.
# Allowed values are: mainnet, gnosis, goerli, ropsten, sepolia and chiado. Source for currently supported networks: https://github.com/ChainSafe/lodestar/blob/unstable/packages/cli/src/networks/index.ts#L19
LODESTAR_NETWORK=sepolia

# Set a custom admin password to prevent having to signup.
# Otherwise Grafana will invite you to change the default password 'admin'
GF_SECURITY_ADMIN_PASSWORD=admin

run execution client

$ docker-compose up -d geth_docker

run consensus client

$ docker-compose up -d beacon_node