Update Lighthouse book and some FAQs (#4178)

## Issue Addressed

Updated Lighthouse book on Section 2 and added some FAQs

## Proposed Changes

All changes are made in the book/src .md files.

## Additional Info

Please provide any additional information. For example, future considerations
or information useful for reviewers.


Co-authored-by: chonghe <tanck2005@gmail.com>
Co-authored-by: Michael Sproul <micsproul@gmail.com>
This commit is contained in:
chonghe
2023-04-14 01:11:45 +00:00
parent a3669abac5
commit 56dba96319
8 changed files with 149 additions and 88 deletions

View File

@@ -16,21 +16,18 @@ way to run Lighthouse without building the image yourself.
Obtain the latest image with:
```bash
$ docker pull sigp/lighthouse
docker pull sigp/lighthouse
```
Download and test the image with:
```bash
$ docker run sigp/lighthouse lighthouse --version
docker run sigp/lighthouse lighthouse --version
```
If you can see the latest [Lighthouse release](https://github.com/sigp/lighthouse/releases) version
(see example below), then you've successfully installed Lighthouse via Docker.
> Pro tip: try the `latest-modern` image for a 20-30% speed-up! See [Available Docker
> Images](#available-docker-images) below.
### Example Version Output
```
@@ -38,6 +35,9 @@ Lighthouse vx.x.xx-xxxxxxxxx
BLS Library: xxxx-xxxxxxx
```
> Pro tip: try the `latest-modern` image for a 20-30% speed-up! See [Available Docker
> Images](#available-docker-images) below.
### Available Docker Images
There are several images available on Docker Hub.
@@ -47,11 +47,10 @@ Lighthouse with optimizations enabled. If you are running on older hardware then
`latest` image bundles a _portable_ version of Lighthouse which is slower but with better hardware
compatibility (see [Portability](./installation-binaries.md#portability)).
To install a specific tag (in this case `latest-modern`) add the tag name to your `docker` commands
like so:
To install a specific tag (in this case `latest-modern`), add the tag name to your `docker` commands:
```
$ docker pull sigp/lighthouse:latest-modern
docker pull sigp/lighthouse:latest-modern
```
Image tags follow this format:
@@ -65,17 +64,17 @@ The `version` is:
* `vX.Y.Z` for a tagged Lighthouse release, e.g. `v2.1.1`
* `latest` for the `stable` branch (latest release) or `unstable` branch
The `stability` is:
* `-unstable` for the `unstable` branch
* empty for a tagged release or the `stable` branch
The `arch` is:
* `-amd64` for x86_64, e.g. Intel, AMD
* `-arm64` for aarch64, e.g. Raspberry Pi 4
* empty for a multi-arch image (works on either `amd64` or `arm64` platforms)
The `stability` is:
* `-unstable` for the `unstable` branch
* empty for a tagged release or the `stable` branch
The `modernity` is:
* `-modern` for optimized builds
@@ -99,13 +98,13 @@ To build the image from source, navigate to
the root of the repository and run:
```bash
$ docker build . -t lighthouse:local
docker build . -t lighthouse:local
```
The build will likely take several minutes. Once it's built, test it with:
```bash
$ docker run lighthouse:local lighthouse --help
docker run lighthouse:local lighthouse --help
```
## Using the Docker image
@@ -113,12 +112,12 @@ $ docker run lighthouse:local lighthouse --help
You can run a Docker beacon node with the following command:
```bash
$ docker run -p 9000:9000/tcp -p 9000:9000/udp -p 127.0.0.1:5052:5052 -v $HOME/.lighthouse:/root/.lighthouse sigp/lighthouse lighthouse --network mainnet beacon --http --http-address 0.0.0.0
docker run -p 9000:9000/tcp -p 9000:9000/udp -p 127.0.0.1:5052:5052 -v $HOME/.lighthouse:/root/.lighthouse sigp/lighthouse lighthouse --network mainnet beacon --http --http-address 0.0.0.0
```
> To join the Prater testnet, use `--network prater` instead.
> To join the Goerli testnet, use `--network goerli` instead.
> The `-p` and `-v` and values are described below.
> The `-v` (Volumes) and `-p` (Ports) and values are described below.
### Volumes
@@ -131,7 +130,7 @@ The following example runs a beacon node with the data directory
mapped to the users home directory:
```bash
$ docker run -v $HOME/.lighthouse:/root/.lighthouse sigp/lighthouse lighthouse beacon
docker run -v $HOME/.lighthouse:/root/.lighthouse sigp/lighthouse lighthouse beacon
```
### Ports
@@ -140,14 +139,14 @@ In order to be a good peer and serve other peers you should expose port `9000` f
Use the `-p` flag to do this:
```bash
$ docker run -p 9000:9000/tcp -p 9000:9000/udp sigp/lighthouse lighthouse beacon
docker run -p 9000:9000/tcp -p 9000:9000/udp sigp/lighthouse lighthouse beacon
```
If you use the `--http` flag you may also want to expose the HTTP port with `-p
127.0.0.1:5052:5052`.
```bash
$ docker run -p 9000:9000/tcp -p 9000:9000/udp -p 127.0.0.1:5052:5052 sigp/lighthouse lighthouse beacon --http --http-address 0.0.0.0
docker run -p 9000:9000/tcp -p 9000:9000/udp -p 127.0.0.1:5052:5052 sigp/lighthouse lighthouse beacon --http --http-address 0.0.0.0
```
[docker_hub]: https://hub.docker.com/repository/docker/sigp/lighthouse/