mirror of
https://github.com/ChainSafe/lodestar.git
synced 2026-01-09 15:48:08 -05:00
**Motivation** - Support the latest LTS **Description** - support node 24 --------- Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2.1 KiB
2.1 KiB
Lodestar Eth Consensus API
This package is part of ChainSafe's Lodestar project
Typescript REST client for the Ethereum Consensus API
Usage
The REST client extends the native Fetch API, it behaves very similar in terms of error and response handling. It returns the same Response object with additional methods to simplify usage and it allows to override all Request options if needed.
import {getClient} from "@lodestar/api";
import {config} from "@lodestar/config/default";
const api = getClient({baseUrl: "http://localhost:9596"}, {config});
const res = await api.beacon.getStateValidator({stateId: "head", validatorId: 0});
const validator = res.value();
console.log("The validator balance is: ", validator.balance);
Prerequisites
What you need
You will need to go over the specification.
Getting started
- Follow the installation guide to install Lodestar.
- Quickly try out the whole stack by starting a local testnet.
Contributors
Read our contributors document, submit an issue or talk to us on our discord!
License
Apache-2.0 ChainSafe Systems