Simple Lido keys and validators HTTP API.
You can familiarize yourself with the REST API by accessing it here.
$ yarn install
$ yarn typechain
$ yarn start:dev
For running locally in container run
docker-compose -f docker-compose.yml build
docker-compose -f docker-compose.yml up
For running KAPI, one can also use the image from this page https://docs.lido.fi/guides/tooling#keys-api. Please always use the SHA256 hash of the Docker image for the latest release: lidofinance/lido-keys-api@
To launch Prometheus, Grafana, and Alertmanager, execute the following command:
docker-compose -f docker-compose.metrics.yml up
For configuring Grafana, navigate to http://localhost:8000/dashboards. Here, you can import dashboards from the ./grafana folder.
To view the list of alerts in Prometheus, visit http://localhost:9090/alerts. For checking the list of fired alerts in Alertmanager, go to http://localhost:9093/#/alerts.
Clone CSM repo
git clone https://github.com/lidofinance/community-staking-module
cd community-staking-module
Execute the command in the CSM module repository
forge build --force
Copy CSModule.json
cp community-staking-module/out/CSModule.sol/CSModule.json ./artifacts/CSMModule.json
Execute the ABI preparation command
yarn prepare:csm
$ yarn test:e2e:docker
Check sample.env
file.
Pay attention that API by default running job for fetching and updating Validators. If you are not planning to use validators
endpoints, you could disable this job by setting VALIDATOR_REGISTRY_ENABLE=false
.
For running KAPI on fork setup environment variables:
CHAIN_ID=1
CHRONIX_PROVIDER_MAINNET_URL=YOUR-MAINNET-PROVIDER
CHRONIX_SESSION_PORT=8002
PROVIDERS_URLS = http://127.0.0.1:8002
yarn chronix:start
yarn fork:init
Keep in mind PROVIDERS_URLS
should contain chronix session url.
This part of document outlines running benchmarks and collecting Prometheus metrics using K6.
At first install k6.
Run yarn build
.
Run KAPI yarn start:dev
.
Running Benchmarks: Execute this command to run benchmarks and save results in benchmarks/output.json:
k6 run -e PORT=<KAPI-PORT> --out json=benchmarks/output.json --tag testid=<UNIQUE-ID> dist/benchmarks/<TEST-NAME>.script.js
Replace
Collecting Prometheus Metrics: For collecting benchmarks' Prometheus metrics, set the Prometheus server URL:
export K6_PROMETHEUS_RW_SERVER_URL=http://<PROMETHEUS-SERVER-URL>/api/v1/write
Replace
k6 run -e PORT=<KAPI-PORT> --out json=benchmarks/output.json -o experimental-prometheus-rw --tag testid=<UNIQUE-ID> dist/benchmarks/<TEST-NAME>.script.js
Once again, use
To create a new release:
main
branch.Prepare release draft
action will run automatically. When the action is complete, a release draft is created.Latest Published
.API Template is MIT licensed.