Skip to content

Commit

Permalink
add Lodestar Validator config in Interactive guide gnosischain#241
Browse files Browse the repository at this point in the history
  • Loading branch information
zengzengzenghuy committed Jan 30, 2023
1 parent 8bb12f8 commit 461c7b9
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 141 deletions.
166 changes: 48 additions & 118 deletions docs/node/guide/beacon/_partials/_install_cl_lodestar.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,32 +81,64 @@ Check that you are install correctly by running `./lodestar --help'
Lodestar only runs on Linux. To run it on Windows, [Install Linux on Windows with WSL](https://learn.microsoft.com/en-us/windows/wsl/install), and follow the instructions on the WSL terminal.
- Go to the [lighhouse releases page](https://github.com/sigp/lighthouse/releases) and copy the url of the latest release based on your OS version.
- Go to the [lodestar releases page](https://github.com/ChainSafe/lodestar/releases/tag/v1.2.2) and copy the url of the latest release, currently v1.2.2.
- Download the lighthouse-VERSION-ARQ.tar.gz binary.
- Download the lodestar VERSION-ARQ.tar.gz binary.
```bash
wget [URL_FROM_PREVIOUS_STEP]
```
- Extract the downloaded file
- Extract the downloaded file and move under consensus directory
```bash
tar -xvf lighthouse-VERSION-ARQ.tar.gz --directory consensus
tar -xvf VERSION-ARQ.tar.gz --directory consensus
```
Your repo will look like this
```
📂gnosis
├── 📂 jwtsecret/
├── 📂 execution/
└── 📂 consensus/
├── 📂 lodestar-${version}/
├── 📂 data/
├── 📂 keystores/
└── 📂 validators/
```
- Get into the folder
- Get into the lodestar folder
```bash
cd consensus/lodestar-${version} #cd consensus/lodestar-1.2.2
```
- Install and build across all packages
```bash
cd consensus
yarn install --ignore-optional
yarn run build
```
- Execute Lighthouse
:::tip
Check that you are install correctly by running `./lodestar --help'
:::
- Execute Lodestar Beacon Chain
```bash
./lighthouse \
--network gnosis beacon_node \
--datadir=data \
--http \
--execution-endpoint http://localhost:8551 \
--execution-jwt ../jwtsecret/jwt.hex \
--checkpoint-sync-url "https://checkpoint.gnosischain.com"
./lodestar \
--network=gnosis
--dataDir=/data
--preset=gnosis
--eth1=true
--execution.urls=http://execution:8551
--jwt-secret=/jwt.hex
--logFile=/data/logs/beacon.log
--logFileLevel=info
--port=9000
--rest=true
--rest.address=0.0.0.0
--rest.port=4000
--rest.cors=*
--discv5=true
--targetPeers=50
--metrics=true
--metrics.port=5054
--checkpointSyncUrl=https://checkpoint.gnosischain.com/
```
</TabItem>
Expand All @@ -121,114 +153,12 @@ Lodestar only runs on Linux. To run it on Windows, [Install Linux on Windows wit
]}>
<TabItem value="others">
- Go to the [lighhouse releases page](https://github.com/sigp/lighthouse/releases) and copy the url of the latest release based on your OS version.
- Download the lighthouse-VERSION-ARQ.tar.gz binary.
```bash
wget [URL_FROM_PREVIOUS_STEP]
```
- Extract the downloaded file
```bash
tar -xvf lighthouse-VERSION-ARQ.tar.gz --directory consensus
```
- Get into the folder
```bash
cd consensus
```
- Create a new folder `network_config` and download Chiado config files:
```bash
mkdir network_config &&
cd network_config &&
wget https://github.com/gnosischain/configs/raw/main/chiado/config.yaml &&
wget https://github.com/gnosischain/configs/raw/main/chiado/genesis.ssz &&
wget https://github.com/gnosischain/configs/raw/main/chiado/deploy_block.txt
```
- Execute Lighthouse, replace `[BOOTNODES]` with a comma-separated bootnodes from [this file](https://github.com/gnosischain/configs/blob/main/chiado/bootnodes.yaml); and `[YOUR_ADDRESS]` with your fee recipient address.
```bash
./lighthouse \
--testnet-dir=./network_config bn \
--datadir=data \
--disable-upnp \
--port=9000 \
--http \
--http-address=0.0.0.0 \
--http-port=4000 \
--target-peers=50 \
--boot-nodes=enr:[BOOTNODES] \
--execution-endpoints=http://localhost:8551 \
--execution-jwt=../jwtsecret/jwt.hex \
--eth1-endpoints=http://localhost:8545 \
--debug-level=info \
--suggested-fee-recipient=[YOUR_ADDRESS] \
--validator-monitor-auto \
--subscribe-all-subnets \
--import-all-attestations \
--metrics \
--metrics-port=5054 \
--metrics-address=0.0.0.0 \
--checkpoint-sync-url https://checkpoint.chiadochain.net
```
Lodestar doesn't support Chiado at the moment.
</TabItem>
<TabItem value="win">
Lighthouse only runs on Linux. To run it on Windows, [Install Linux on Windows with WSL](https://learn.microsoft.com/en-us/windows/wsl/install), and follow the instructions on the WSL terminal.
- Go to the [lighhouse releases page](https://github.com/sigp/lighthouse/releases) and copy the url of the latest release based on your OS version.
- Download the lighthouse-VERSION-ARQ.tar.gz binary.
```bash
wget [URL_FROM_PREVIOUS_STEP]
```
- Extract the downloaded file
```bash
tar -xvf lighthouse-VERSION-ARQ.tar.gz --directory consensus
```
- Get into the folder
```bash
cd consensus
```
- Create a new folder `network_config` and download Chiado config files:
```bash
mkdir network_config &&
cd network_config &&
wget https://github.com/gnosischain/configs/raw/main/chiado/config.yaml &&
wget https://github.com/gnosischain/configs/raw/main/chiado/genesis.ssz &&
wget https://github.com/gnosischain/configs/raw/main/chiado/deploy_block.txt
```
- Execute Lighthouse, replace `[BOOTNODES]` with a comma-separated bootnodes from [this file](https://github.com/gnosischain/configs/blob/main/chiado/bootnodes.yaml); and `[YOUR_ADDRESS]` with your fee recipient address.
```bash
./lighthouse \
--testnet-dir=./network_config bn \
--datadir=data \
--disable-upnp \
--port=9000 \
--http \
--http-address=0.0.0.0 \
--http-port=4000 \
--target-peers=50 \
--boot-nodes=enr:[BOOTNODES] \
--execution-endpoints=http://localhost:8551 \
--execution-jwt=../jwtsecret/jwt.hex \
--eth1-endpoints=http://localhost:8545 \
--debug-level=info \
--suggested-fee-recipient=[YOUR_ADDRESS] \
--validator-monitor-auto \
--subscribe-all-subnets \
--import-all-attestations \
--metrics \
--metrics-port=5054 \
--metrics-address=0.0.0.0 \
--checkpoint-sync-url https://checkpoint.chiadochain.net
```
Lodestar doesn't support Chiado at the moment.
</TabItem>
</Tabs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,43 +23,37 @@ Lighthouse only runs on Linux. To run it on Windows, [Install Linux on Windows w

To run a validator, we need to first import the keys generated in the previous step.

* In a new command line window, navigate to the `consensus` folder and execute Lighthouse validator client
* In a new command line window, navigate to the `consensus` folder and execute Lodestar validator client
* To ease the import process, we will create a `password.txt` file containing the password used to encrypt the validator keys.

```shell
echo 'PLACE_HERE_YOUR_PASSWORD' > keystores/password.txt
```


You can import the keys when starting the validator.

* Import the validator keys using lighthouse:

```shell
./lighthouse account_manager validator import \
--network gnosis \
--password-file keystores/password.txt \
--reuse-password \
./lodestar validator \
--network=gnosis \
--importKeystores=/keystores \
--importKeystoresPassword=keystores/password.txt \
--directory keystores \
--datadir validators
--dataDir=/data/validators \
# highlight-start
--suggestedFeeRecipient=$FEE_RECIPIENT \ # Change this value
# highlight-start
# highlight-start
--graffiti=$GRAFFITI # Change this value
# highlight-start
```

* Start your lighhouse validator:

```shell
./lighthouse validator_client \
--network gnosis \
--datadir validators \
--enable-doppelganger-protection \
# highlight-start
--suggested-fee-recipient="0x0" \ # Change this value
# highlight-end
--metrics \
--metrics-address=0.0.0.0 \
--metrics-port=5064 \
# highlight-start
--graffiti "gnosis-docs-graffiti" # Change this value
# highlight-end
```

Replace `gnosis-docs-graffiti` with your [graffiti](https://lighthouse-book.sigmaprime.io/graffiti.html). Make sure to delete `# Change this value` before running this command. Learn more about the [`enable-doppelganger-protection`](https://lighthouse-book.sigmaprime.io/validator-doppelganger.html) flag in Lighthouse docs.

Replace `$GRAFFITI` with your [graffiti](https://lighthouse-book.sigmaprime.io/graffiti.html)and `$FEE_RECIPIENT` with your fee recipient address. Make sure to delete `# Change this value` before running this command. Learn more about the CLI commands and their options [here](https://chainsafe.github.io/lodestar/reference/cli/)



Expand Down

0 comments on commit 461c7b9

Please sign in to comment.