Update blsync documentation with dynamic fetching. (Fixes Issue #31980 )

This commit is contained in:
shantichanal 2025-06-16 15:42:06 +02:00
parent e92bca1c49
commit 9087111e75

View file

@ -9,7 +9,26 @@ description: Running geth with integrated beacon light client
## Usage ## Usage
### Integrated mode ### Using Dynamic Checkpoint Fetch
This will automatically fetch the latest finalized checkpoint and launch Geth in snap sync mode with light client support (blsync).
Replace `<domain>` with your select beacon api provider from the provided list of [lightsync endpoints](https://s1na.github.io/light-sync-endpoints/). Replace `<checkpoint>` with a url from the list of maintained [checkpoint sync endpoints](https://eth-clients.github.io/checkpoint-sync-endpoints/). The following command can be used to run geth client with blsync directly.
```terminal
export BEACON=<beacon> && \
export CHECKPOINT=<checkpoint> && \
geth --beacon.api=$BEACON --beacon.checkpoint=$(curl -s $CHECKPOINT/checkpointz/v1/status | jq -r '.data.finality.finalized.root')
```
#### Example
```terminal
export BEACON=https://lodestar-sepolia.chainsafe.io && \
export CHECKPOINT=https://sepolia.beaconstate.info && \
geth --sepolia --beacon.api=$BEACON --beacon.checkpoint=$(curl -s $CHECKPOINT/checkpointz/v1/status | jq -r '.data.finality.finalized.root')
```
### Running with Manual Checkpoint Fetch
To run blsync as part of Geth, you need to specify a public HTTP endpoint and a checkpoint: To run blsync as part of Geth, you need to specify a public HTTP endpoint and a checkpoint:
@ -29,6 +48,7 @@ A checkpoint is the block root of the first proposed slot of a finalized beacon
- Copy the block root field. - Copy the block root field.
![Copy the block root](/images/docs/blsync3.png) ![Copy the block root](/images/docs/blsync3.png)
## Testing a Beacon API Endpoint ## Testing a Beacon API Endpoint
To verify that your Beacon API is reachable and returning valid data, you can use a simple `curl` command to request the light client bootstrap header for a given block root. To verify that your Beacon API is reachable and returning valid data, you can use a simple `curl` command to request the light client bootstrap header for a given block root.