Skip to content

Instantly share code, notes, and snippets.

@zsfelfoldi
Created May 18, 2022 07:58
Show Gist options
  • Save zsfelfoldi/90b235b9879beb7ab8b99fc6ccbe99c3 to your computer and use it in GitHub Desktop.
Save zsfelfoldi/90b235b9879beb7ab8b99fc6ccbe99c3 to your computer and use it in GitHub Desktop.
Instructions for testing LES/5 (proof-of-stake light client) on the Kiln testnet
- build the geth branch:
git clone https://github.com/zsfelfoldi/go-ethereum.git -b les5
- build the latest master version of lodestar:
git clone https://github.com/ChainSafe/lodestar.git
yarn && yarn build
- build instructions:
https://github.com/ChainSafe/lodestar/
- pull the merge testnet configs repo:
git clone https://github.com/eth-clients/merge-testnets.git
- start up a server config (adjust the paths appropriately):
geth --datadir "~/.kiln_geth" init "/home/zsfelfoldi/merge-testnets/kiln/genesis.json"
geth --datadir "~/.kiln_geth" --http --http.api="engine,eth,web3,net,debug" --http.corsdomain "*" --networkid=1337802 --syncmode=full --light.serve=50 --beacon.config="/home/zsfelfoldi/merge-testnets/kiln/config.yaml" --beacon.api "http://127.0.0.1:9596" console
lodestar beacon --rootDir="/home/zsfelfoldi/.kiln_lodestar" --paramsFile="/home/zsfelfoldi/merge-testnets/kiln/config.yaml" --genesisStateFile="/home/zsfelfoldi/merge-testnets/kiln/genesis.ssz" --network.discv5.bootEnrs="enr:-Iq4QMCTfIMXnow27baRUb35Q8iiFHSIDBJh6hQM5Axohhf4b6Kr_cOCu0htQ5WvVqKvFgY28893DHAg8gnBAXsAVqmGAX53x8JggmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk" --eth1.enabled=true --execution.urls="http://127.0.0.1:8545" --network.connectToDiscv5Bootnodes --network.discv5.enabled=true --api.rest.api "*"
- wait for them to sync up (might take several hours, using a weak subjectivity checkpoint might make it quicker)
- run the light client:
geth --datadir "~/.kiln_light" init "/home/zsfelfoldi/merge-testnets/kiln/genesis.json"
geth --datadir "~/.kiln_light" --syncmode "light" --nodiscover --port 30304 --networkid=1337802 --beacon.config="/home/zsfelfoldi/merge-testnets/kiln/config.yaml" --beacon.checkpoint="0x344b0b6350b28ad95af5c0b46bfd7c475eda6146de2e424186d819476fc7e562" console
- the checkpoint shown above is slot 200000 of the kiln beacon chain; this checkpoint needs to be located at or after the server's checkpoint if it was not synced from genesis
- manually addPeer your server
- try a few basic commands (block and state retrievals should work):
eth.getBalance("0x82415db940760e5b84e8dd23a94a92d3b10dbdbf")
eth.getTransaction("0xdd5b9a9382c17a2356575d3df836b179106818b0248130e0c1e63c90256a2c4b")
eth.gasPrice
eth.getBlock("latest")
eth.getBlock(160000)
eth.getBlock("0xf900549bfde3d3a9b4efc47877418b7652eef5a9711265954d46a71d613e3657")
eth.getBlock("pending")
- in this version this returns the finalized block (just for testing)
- notes on limited functionality:
- transition is not handled properly, the lightchain and API backend parts are hacky, this branch only works with PoS
- filters do not work
- EVM does not work
- light transaction pool might or might not work, have not tested it in the absence of kiln ether
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment