Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

Pier-Two/Beacon-Chain-Light-Client-Prototype

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lantern.

This is a C# implementation of the Altair Minimal Light Client Specification, also known as a light client for the consensus layer. If interested in learning more about light clients in Ethereum, I have written an introductory article, explaining how they work.

Functionality

Currently, the prototype can track the latest block header in the beacon chain. It achieves this by initializing from a trusted snapshot to know the current sync committee. The snapshot is verified by checking whether the current sync committee branch is valid. It then trustlessly verifies the upcoming block headers by checking if the sync committee signature is valid and enough validators had signed.

Requirements

Before Running

To initialize and sync with the beacon chain, the light client requires a local server to send REST-API requests. The server is a modified version of the Lodestar beacon chain client, available to download from the Light-Client-Server repository. Enter the following commands in the command prompt to initilialise the server:

yarn install
node --trace-deprecation --max-old-space-size=6144 packages/cli/bin/lodestar beacon --eth1.enabled false --network mainnet --weakSubjectivityServerUrl https://21qajKWbOdMuXWCCPEbxW1bVPrp:5e43bc9d09711d4f34b55077cdb3380a@eth2-beacon-mainnet.infura.io --weakSubjectivitySyncLatest true --api.rest.api "lightclient" "beacon"

After it has subscribed to gossip core topics and reached Synced status, follow the commands below to initialize the light client.

Installation & Running

git clone https://github.com/uink45/Beacon-Chain-Light-Client-Prototype.git
cd Beacon-Chain-Light-Client-Prototype/Lantern
dotnet build
dotnet run

After running the commands above, head to https://localhost:5001/.

About

A C# implementation of the Altair Minimal Light Client, also known as a Beacon Chain Light Client.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 97.9%
  • HTML 1.3%
  • Other 0.8%