mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-17 12:58:31 +00:00
Markdown linter (#5494)
* linter * Add markdown linter * add env * only check markdown * Add token * Update .github/workflows/test-suite.yml * Markdown linter * Exit code * Update script * rename * mdlint * Add an empty line after end of file * Testing disable * add text * update mdlint.sh * ori validator inclusion * Add config yml file * Remove MD041 and fix advanced-datadir file * FIx validator inclusion file conflict * Merge branch 'unstable' into markdown-linter * change files * Merge branch 'markdown-linter' of https://github.com/chong-he/lighthouse into markdown-linter * mdlint * Remove MD025 * Remove MD036 * Remove MD045 * Removr MD001 * Set MD028 to false * Remove MD024 * Remove MD055 * Remove MD029 * Remove MD040 * Set MD040 to false * Set MD033 to false * Set MD013 to false * Rearrange yml file * Update mdlint.sh and test * Test remove fix * Test with fix * Test with space * Fix summary indentation * Test mdlint.sh * Update mdlint.sh * Test * Update * Test fix * Test again * Fix * merge into check-code * Update scripts/mdlint.sh Co-authored-by: Mac L <mjladson@pm.me> * Update scripts/mdlint.sh Co-authored-by: Mac L <mjladson@pm.me> * Remove set -e * Add comment * Merge pull request #7 from chong-he/unstable Merge unstable to markdown branch * mdlint * Merge branch 'unstable' into markdown-linter * mdlint
This commit is contained in:
@@ -2,27 +2,27 @@
|
||||
|
||||
## Endpoints
|
||||
|
||||
HTTP Path | Description |
|
||||
| HTTP Path | Description |
|
||||
| --- | -- |
|
||||
[`GET /lighthouse/version`](#get-lighthouseversion) | Get the Lighthouse software version.
|
||||
[`GET /lighthouse/health`](#get-lighthousehealth) | Get information about the host machine.
|
||||
[`GET /lighthouse/ui/health`](#get-lighthouseuihealth) | Get information about the host machine. Focused for UI applications.
|
||||
[`GET /lighthouse/spec`](#get-lighthousespec) | Get the Ethereum proof-of-stake consensus specification used by the validator.
|
||||
[`GET /lighthouse/auth`](#get-lighthouseauth) | Get the location of the authorization token.
|
||||
[`GET /lighthouse/validators`](#get-lighthousevalidators) | List all validators.
|
||||
[`GET /lighthouse/validators/:voting_pubkey`](#get-lighthousevalidatorsvoting_pubkey) | Get a specific validator.
|
||||
[`PATCH /lighthouse/validators/:voting_pubkey`](#patch-lighthousevalidatorsvoting_pubkey) | Update a specific validator.
|
||||
[`POST /lighthouse/validators`](#post-lighthousevalidators) | Create a new validator and mnemonic.
|
||||
[`POST /lighthouse/validators/keystore`](#post-lighthousevalidatorskeystore) | Import a keystore.
|
||||
[`POST /lighthouse/validators/mnemonic`](#post-lighthousevalidatorsmnemonic) | Create a new validator from an existing mnemonic.
|
||||
[`POST /lighthouse/validators/web3signer`](#post-lighthousevalidatorsweb3signer) | Add web3signer validators.
|
||||
[`GET /lighthouse/logs`](#get-lighthouselogs) | Get logs
|
||||
| [`GET /lighthouse/version`](#get-lighthouseversion) | Get the Lighthouse software version. |
|
||||
| [`GET /lighthouse/health`](#get-lighthousehealth) | Get information about the host machine. |
|
||||
| [`GET /lighthouse/ui/health`](#get-lighthouseuihealth) | Get information about the host machine. Focused for UI applications. |
|
||||
| [`GET /lighthouse/spec`](#get-lighthousespec) | Get the Ethereum proof-of-stake consensus specification used by the validator. |
|
||||
| [`GET /lighthouse/auth`](#get-lighthouseauth) | Get the location of the authorization token. |
|
||||
| [`GET /lighthouse/validators`](#get-lighthousevalidators) | List all validators. |
|
||||
| [`GET /lighthouse/validators`](#get-lighthousevalidators) | List all validators. |
|
||||
| [`GET /lighthouse/validators/:voting_pubkey`](#get-lighthousevalidatorsvoting_pubkey) | Get a specific validator. |
|
||||
| [`PATCH /lighthouse/validators/:voting_pubkey`](#patch-lighthousevalidatorsvoting_pubkey) | Update a specific validator. |
|
||||
| [`POST /lighthouse/validators`](#post-lighthousevalidators) | Create a new validator and mnemonic. |
|
||||
| [`POST /lighthouse/validators/keystore`](#post-lighthousevalidatorskeystore) | Import a keystore. |
|
||||
| [`POST /lighthouse/validators/mnemonic`](#post-lighthousevalidatorsmnemonic) | Create a new validator from an existing mnemonic. |
|
||||
| [`POST /lighthouse/validators/web3signer`](#post-lighthousevalidatorsweb3signer) | Add web3signer validators. |
|
||||
| [`GET /lighthouse/logs`](#get-lighthouselogs) | Get logs |
|
||||
|
||||
The query to Lighthouse API endpoints requires authorization, see [Authorization Header](./api-vc-auth-header.md).
|
||||
The query to Lighthouse API endpoints requires authorization, see [Authorization Header](./api-vc-auth-header.md).
|
||||
|
||||
In addition to the above endpoints Lighthouse also supports all of the [standard keymanager APIs](https://ethereum.github.io/keymanager-APIs/).
|
||||
|
||||
|
||||
## `GET /lighthouse/version`
|
||||
|
||||
Returns the software version and `git` commit hash for the Lighthouse binary.
|
||||
@@ -37,6 +37,7 @@ Returns the software version and `git` commit hash for the Lighthouse binary.
|
||||
| Typical Responses | 200 |
|
||||
|
||||
Command:
|
||||
|
||||
```bash
|
||||
DATADIR=/var/lib/lighthouse
|
||||
curl -X GET "http://localhost:5062/lighthouse/version" -H "Authorization: Bearer $(cat ${DATADIR}/validators/api-token.txt)" | jq
|
||||
@@ -44,7 +45,6 @@ curl -X GET "http://localhost:5062/lighthouse/version" -H "Authorization: Bearer
|
||||
|
||||
Example Response Body:
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"data": {
|
||||
@@ -52,9 +52,11 @@ Example Response Body:
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
> Note: The command provided in this documentation links to the API token file. In this documentation, it is assumed that the API token file is located in `/var/lib/lighthouse/validators/API-token.txt`. If your database is saved in another directory, modify the `DATADIR` accordingly. If you are having permission issue with accessing the API token file, you can modify the header to become `-H "Authorization: Bearer $(sudo cat ${DATADIR}/validators/api-token.txt)"`.
|
||||
|
||||
> As an alternative, you can also provide the API token directly, for example, `-H "Authorization: Bearer api-token-0x02dc2a13115cc8c83baf170f597f22b1eb2930542941ab902df3daadebcb8f8176`. In this case, you obtain the token from the file `API token.txt` and the command becomes:
|
||||
|
||||
```bash
|
||||
curl -X GET "http://localhost:5062/lighthouse/version" -H "Authorization: Bearer api-token-0x02dc2a13115cc8c83baf170f597f22b1eb2930542941ab902df3daadebcb8f8176" | jq
|
||||
```
|
||||
@@ -75,6 +77,7 @@ Returns information regarding the health of the host machine.
|
||||
*Note: this endpoint is presently only available on Linux.*
|
||||
|
||||
Command:
|
||||
|
||||
```bash
|
||||
DATADIR=/var/lib/lighthouse
|
||||
curl -X GET "http://localhost:5062/lighthouse/health" -H "Authorization: Bearer $(cat ${DATADIR}/validators/api-token.txt)" | jq
|
||||
@@ -133,6 +136,7 @@ Returns information regarding the health of the host machine.
|
||||
| Typical Responses | 200 |
|
||||
|
||||
Command:
|
||||
|
||||
```bash
|
||||
DATADIR=/var/lib/lighthouse
|
||||
curl -X GET "http://localhost:5062/lighthouse/ui/health" -H "Authorization: Bearer $(cat ${DATADIR}/validators/api-token.txt)" | jq
|
||||
@@ -178,10 +182,12 @@ Returns the graffiti that will be used for the next block proposal of each valid
|
||||
| Typical Responses | 200 |
|
||||
|
||||
Command:
|
||||
|
||||
```bash
|
||||
DATADIR=/var/lib/lighthouse
|
||||
curl -X GET "http://localhost:5062/lighthouse/ui/graffiti" -H "Authorization: Bearer $(cat ${DATADIR}/validators/api-token.txt)" | jq
|
||||
```
|
||||
|
||||
Example Response Body
|
||||
|
||||
```json
|
||||
@@ -323,7 +329,7 @@ Example Response Body
|
||||
## `GET /lighthouse/auth`
|
||||
|
||||
Fetch the filesystem path of the [authorization token](./api-vc-auth-header.md).
|
||||
Unlike the other endpoints this may be called _without_ providing an authorization token.
|
||||
Unlike the other endpoints this may be called *without* providing an authorization token.
|
||||
|
||||
This API is intended to be called from the same machine as the validator client, so that the token
|
||||
file may be read by a local user with access rights.
|
||||
@@ -440,7 +446,6 @@ and `graffiti`. The following example updates a validator from `enabled: true`
|
||||
| Required Headers | [`Authorization`](./api-vc-auth-header.md) |
|
||||
| Typical Responses | 200, 400 |
|
||||
|
||||
|
||||
Example Request Body
|
||||
|
||||
```json
|
||||
@@ -458,6 +463,7 @@ curl -X PATCH "http://localhost:5062/lighthouse/validators/0xb0148e6348264131bf4
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"enabled\":false}" | jq
|
||||
```
|
||||
|
||||
### Example Response Body
|
||||
|
||||
```json
|
||||
@@ -466,12 +472,11 @@ null
|
||||
|
||||
A `null` response indicates that the request is successful. At the same time, `lighthouse vc` will log:
|
||||
|
||||
```
|
||||
```text
|
||||
INFO Disabled validator voting_pubkey: 0xb0148e6348264131bf47bcd1829590e870c836dc893050fd0dadc7a28949f9d0a72f2805d027521b45441101f0cc1cde
|
||||
INFO Modified key_cache saved successfully
|
||||
```
|
||||
|
||||
|
||||
## `POST /lighthouse/validators/`
|
||||
|
||||
Create any number of new validators, all of which will share a common mnemonic
|
||||
@@ -510,7 +515,8 @@ Validators are generated from the mnemonic according to
|
||||
]
|
||||
```
|
||||
|
||||
Command:
|
||||
Command:
|
||||
|
||||
```bash
|
||||
DATADIR=/var/lib/lighthouse
|
||||
curl -X POST http://localhost:5062/lighthouse/validators \
|
||||
@@ -560,7 +566,7 @@ curl -X POST http://localhost:5062/lighthouse/validators \
|
||||
|
||||
`lighthouse vc` will log:
|
||||
|
||||
```
|
||||
```text
|
||||
INFO Enabled validator voting_pubkey: 0x8ffbc881fb60841a4546b4b385ec5e9b5090fd1c4395e568d98b74b94b41a912c6101113da39d43c101369eeb9b48e50, signing_method: local_keystore
|
||||
INFO Modified key_cache saved successfully
|
||||
INFO Disabled validator voting_pubkey: 0xa9fadd620dc68e9fe0d6e1a69f6c54a0271ad65ab5a509e645e45c6e60ff8f4fc538f301781193a08b55821444801502
|
||||
@@ -625,6 +631,7 @@ Import a keystore into the validator client.
|
||||
We can use [JSON to String Converter](https://jsontostring.com/) so that the above data can be properly presented as a command. The command is as below:
|
||||
|
||||
Command:
|
||||
|
||||
```bash
|
||||
DATADIR=/var/lib/lighthouse
|
||||
curl -X POST http://localhost:5062/lighthouse/validators/keystore \
|
||||
@@ -636,6 +643,7 @@ curl -X POST http://localhost:5062/lighthouse/validators/keystore \
|
||||
As this is an example for demonstration, the above command will return `InvalidPassword`. However, with a keystore file and correct password, running the above command will import the keystore to the validator client. An example of a success message is shown below:
|
||||
|
||||
### Example Response Body
|
||||
|
||||
```json
|
||||
{
|
||||
"data": {
|
||||
@@ -717,7 +725,7 @@ curl -X POST http://localhost:5062/lighthouse/validators/mnemonic \
|
||||
|
||||
`lighthouse vc` will log:
|
||||
|
||||
```
|
||||
```text
|
||||
INFO Enabled validator voting_pubkey: 0xa062f95fee747144d5e511940624bc6546509eeaeae9383257a9c43e7ddc58c17c2bab4ae62053122184c381b90db380, signing_method: local_keystore
|
||||
INFO Modified key_cache saved successfully
|
||||
```
|
||||
@@ -759,8 +767,8 @@ Create any number of new validators, all of which will refer to a
|
||||
|
||||
Some of the fields above may be omitted or nullified to obtain default values (e.g., `graffiti`, `request_timeout_ms`).
|
||||
|
||||
|
||||
Command:
|
||||
|
||||
```bash
|
||||
DATADIR=/var/lib/lighthouse
|
||||
curl -X POST http://localhost:5062/lighthouse/validators/web3signer \
|
||||
@@ -769,21 +777,18 @@ curl -X POST http://localhost:5062/lighthouse/validators/web3signer \
|
||||
-d "[{\"enable\":true,\"description\":\"validator_one\",\"graffiti\":\"Mr F was here\",\"suggested_fee_recipient\":\"0xa2e334e71511686bcfe38bb3ee1ad8f6babcc03d\",\"voting_public_key\":\"0xa062f95fee747144d5e511940624bc6546509eeaeae9383257a9c43e7ddc58c17c2bab4ae62053122184c381b90db380\",\"builder_proposals\":true,\"url\":\"http://path-to-web3signer.com\",\"root_certificate_path\":\"/path/to/certificate.pem\",\"client_identity_path\":\"/path/to/identity.p12\",\"client_identity_password\":\"pass\",\"request_timeout_ms\":12000}]"
|
||||
```
|
||||
|
||||
|
||||
### Example Response Body
|
||||
|
||||
|
||||
```json
|
||||
null
|
||||
```
|
||||
|
||||
A `null` response indicates that the request is successful. At the same time, `lighthouse vc` will log:
|
||||
|
||||
```
|
||||
```text
|
||||
INFO Enabled validator voting_pubkey: 0xa062f95fee747144d5e511940624bc6546509eeaeae9383257a9c43e7ddc58c17c2bab4ae62053122184c381b90db380, signing_method: remote_signer
|
||||
```
|
||||
|
||||
|
||||
## `GET /lighthouse/logs`
|
||||
|
||||
Provides a subscription to receive logs as Server Side Events. Currently the
|
||||
|
||||
Reference in New Issue
Block a user