From 8826e1a960277f9b288a5c550d76d35530ddeb63 Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Tue, 30 Jul 2024 17:01:57 +0100 Subject: [PATCH] docs: update prover and light client documentation (#6983) * Update lc cli flags to use camelCase * Update reference to light client beacon api spec * Fix browser bundle reference and min version * Update prover readme title * Remove redundancy in docs sidebar * Remove v0 lodestar-specific route * Add references to beacon api explorer --- docs/sidebars.ts | 7 +++++-- packages/light-client/README.md | 19 +++++++++---------- packages/prover/README.md | 2 +- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/docs/sidebars.ts b/docs/sidebars.ts index 16bd9586d1a1..d9a4839a90c4 100644 --- a/docs/sidebars.ts +++ b/docs/sidebars.ts @@ -53,12 +53,15 @@ const sidebars: SidebarsConfig = { { type: "category", label: "Light Client", - items: ["libraries/lightclient-prover/lightclient-cli", "libraries/lightclient-prover/lightclient"], + items: [ + {type: "doc", label: "Getting Started", id: "libraries/lightclient-prover/lightclient"}, + "libraries/lightclient-prover/lightclient-cli", + ], }, { type: "category", label: "Prover", - items: ["libraries/lightclient-prover/prover"], + items: [{type: "doc", label: "Getting Started", id: "libraries/lightclient-prover/prover"}], }, ], }, diff --git a/packages/light-client/README.md b/packages/light-client/README.md index 5d5e480afd08..cd3a0265008a 100644 --- a/packages/light-client/README.md +++ b/packages/light-client/README.md @@ -18,13 +18,12 @@ The evolution of light clients is emblematic of the broader trajectory of Ethere ## Requirements for Running a Light-Client -Access to an beacon node that supports the light client specification is necessary. The client must support the following routes from the [consensus API spec](https://github.com/ethereum/consensus-specs/tree/dev): +Access to an beacon node that supports the light client specification is necessary. The client must support the following routes from the [consensus API spec](https://github.com/ethereum/beacon-APIs/tree/v2.5.0/apis/beacon/light_client): -- `/eth/v1/beacon/light_client/updates` -- `/eth/v1/beacon/light_client/optimistic_update` -- `/eth/v1/beacon/light_client/finality_update` -- `/eth/v1/beacon/light_client/bootstrap/{block_root}` -- `/eth/v0/beacon/light_client/committee_root` +- [`GET /eth/v1/beacon/light_client/updates`](https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.5.0#/Beacon/getLightClientUpdatesByRange) +- [`GET /eth/v1/beacon/light_client/optimistic_update`](https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.5.0#/Beacon/getLightClientOptimisticUpdate) +- [`GET /eth/v1/beacon/light_client/finality_update`](https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.5.0#/Beacon/getLightClientFinalityUpdate) +- [`GET /eth/v1/beacon/light_client/bootstrap/{block_root}`](https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.5.0#/Beacon/getLightClientBootstrap) System requirements are quite low so its possible to run a light client in the browser as part of a website. There are a few examples of this on github that you can use as reference, our [prover](https://chainsafe.github.io/lodestar/libraries/lightclient-prover/prover) being one of them. @@ -42,8 +41,8 @@ It is possible to start up the light-client as a standalone process. ```bash lodestar lightclient \ --network sepolia \ - --beacon-api-url https://lodestar-sepolia.chainsafe.io \ - --checkpoint-root "0xccaff4b99986a7b05e06738f1828a32e40799b277fd9f9ff069be55341fe0229" + --beaconApiUrl https://lodestar-sepolia.chainsafe.io \ + --checkpointRoot "0xccaff4b99986a7b05e06738f1828a32e40799b277fd9f9ff069be55341fe0229" ``` ## Light-Client Programmatic Example @@ -93,12 +92,12 @@ lightclient.emitter.on(LightclientEvent.lightClientOptimisticHeader, async (opti ## Browser Integration -If you want to use Lightclient in browser and facing some issues in building it with bundlers like webpack, vite. We suggest to use our distribution build. The support for single distribution build is started from `1.19.0` version. +If you want to use Lightclient in browser and facing some issues in building it with bundlers like webpack, vite. We suggest to use our distribution build. The support for single distribution build is started from `1.20.0` version. Directly link the dist build with the `