Skip to content

Commit

Permalink
Remove VC response signing and update api-token in Lighthouse Book (#…
Browse files Browse the repository at this point in the history
…6288)

* update api-token

* Update book/src/api-vc-auth-header.md

Co-authored-by: Michael Sproul <micsproul@gmail.com>

* Update book/src/api-vc-auth-header.md

Co-authored-by: Michael Sproul <micsproul@gmail.com>

* Update book/src/api-vc-endpoints.md

Co-authored-by: Michael Sproul <micsproul@gmail.com>

* Update book/src/api-vc-endpoints.md

Co-authored-by: Michael Sproul <micsproul@gmail.com>

* Remove 33 characeter
  • Loading branch information
chong-he authored Aug 22, 2024
1 parent 9a295d0 commit 3c1266e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 116 deletions.
8 changes: 4 additions & 4 deletions book/src/api-vc-auth-header.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ HTTP header:
- Value: `Bearer <api-token>`

Where `<api-token>` is a string that can be obtained from the validator client
host. Here is an example `Authorization` header:
host. Here is an example of the `Authorization` header:

```text
Authorization: Bearer api-token-0x03eace4c98e8f77477bb99efb74f9af10d800bd3318f92c33b719a4644254d4123
Authorization: Bearer hGut6B8uEujufDXSmZsT0thnxvdvKFBvh
```

## Obtaining the API token
Expand All @@ -24,7 +24,7 @@ text editor will suffice:

```bash
cat api-token.txt
api-token-0x03eace4c98e8f77477bb99efb74f9af10d800bd3318f92c33b719a4644254d4123
hGut6B8uEujufDXSmZsT0thnxvdvKFBvh
```

When starting the validator client it will output a log message containing the path
Expand Down Expand Up @@ -54,7 +54,7 @@ Response:
Here is an example `curl` command using the API token in the `Authorization` header:

```bash
curl localhost:5062/lighthouse/version -H "Authorization: Bearer api-token-0x03eace4c98e8f77477bb99efb74f9af10d800bd3318f92c33b719a4644254d4123"
curl localhost:5062/lighthouse/version -H "Authorization: Bearer hGut6B8uEujufDXSmZsT0thnxvdvKFBvh"
```

The server should respond with its version:
Expand Down
6 changes: 3 additions & 3 deletions book/src/api-vc-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ 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)"`.
> 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:
> As an alternative, you can also provide the API token directly, for example, `-H "Authorization: Bearer hGut6B8uEujufDXSmZsT0thnxvdvKFBvh`. 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
curl -X GET "http://localhost:5062/lighthouse/version" -H "Authorization: Bearer hGut6B8uEujufDXSmZsT0thnxvdvKFBvh" | jq
```

## `GET /lighthouse/health`
Expand Down
108 changes: 0 additions & 108 deletions book/src/api-vc-sig-header.md

This file was deleted.

2 changes: 1 addition & 1 deletion book/src/validator-manager-move.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ location of the file varies, but it is located in the "validator directory" of y
alongside validator keystores. For example: `~/.lighthouse/mainnet/validators/api-token.txt`. If you are unsure of the `api-token.txt` path, you can run `curl http://localhost:5062/lighthouse/auth` which will show the path.

Copy the contents of that file into a new file on the **destination host** at `~/src-token.txt`. The
API token should be similar to `api-token-0x03eace4c98e8f77477bb99efb74f9af10d800bd3318f92c33b719a4644254d4123`.
API token is a random string, e.g., `hGut6B8uEujufDXSmZsT0thnxvdvKFBvh`.

### 4. Create an SSH Tunnel

Expand Down

0 comments on commit 3c1266e

Please sign in to comment.