Skip to content

Commit

Permalink
Add information about starting Teku from a recent snapshot. (#262)
Browse files Browse the repository at this point in the history
* Add  CLI option to disable built-in slashing protection for external signers.

Signed-off-by: Byron Gravenorst <[email protected]>

* Add instructions to connect to mainnet.

Signed-off-by: Byron Gravenorst <[email protected]>

* updating submodule to latest

* Add instructions to connect to mainnet.

Signed-off-by: Byron Gravenorst <[email protected]>

* Fix markdown issue.

Signed-off-by: Byron Gravenorst <[email protected]>

* Add information about starting Teku from a recent snapshot.

Signed-off-by: Byron Gravenorst <[email protected]>

* Fix markdown issues.

Signed-off-by: Byron Gravenorst <[email protected]>

* Fix markdown issues.

Signed-off-by: Byron Gravenorst <[email protected]>

* Fix markdown issues.

Signed-off-by: Byron Gravenorst <[email protected]>

* Address reviewer feedback.

Signed-off-by: Byron Gravenorst <[email protected]>

* Fix markdown issue.

Signed-off-by: Byron Gravenorst <[email protected]>

* Update docs/HowTo/Get-Started/Checkpoint-Start.md

* Update docs/HowTo/Get-Started/Checkpoint-Start.md
  • Loading branch information
bgravenorst authored Mar 25, 2021
1 parent 582823f commit 3f7aaaf
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 2 deletions.
42 changes: 42 additions & 0 deletions docs/HowTo/Get-Started/Checkpoint-Start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
description: How to start Teku using a recent finalized checkpoint state
---

# Start Teku from a recent state

To get Teku up and running in only a few minutes, you can start Teku from a recent finalized
checkpoint state rather than syncing from genesis.

When starting from a recent checkpoint, Teku downloads historic chain data in the background.

!!! important

You need access to a beacon chain client with [REST API enabled] (for example Teku) to download the
finalized checkpoint state file.

The following command downloads a recent finalized checkpoint state from a beacon chain client, and
starts Teku:

```bash
teku --eth1-endpoint=http://localhost:8545 \
--validator-keys=/Users/me/mainnet/validator/keys:/Users/me/mainnet/validator/passwords \
--initial-state=http://other-node:5051/eth/v1/debug/beacon/states/finalized
```

The command uses the [`--initial-state`](../../Reference/CLI/CLI-Syntax.md#initial-state) option
to download the finalized checkpoint state from the
[`/eth/v1/debug/beacon/states/`](https://consensys.github.io/teku/#operation/getEthV1DebugBeaconStatesWithState_id) endpoint
on the beacon chain client (for example Teku).

!!! note

You can also download a finalized checkpoint state file, and specify the location
using the [`--initial-state`](../../Reference/CLI/CLI-Syntax.md#initial-state) option. To
download the file and name it `state.ssz` run:

```bash
curl -o state.ssz -H 'Accept: application/octet-stream' http://other-node:5051/eth/v1/debug/beacon/states/finalized
```

<!--links-->
[REST API enabled]: ../../Reference/CLI/CLI-Syntax.md#rest-api-enabled
3 changes: 2 additions & 1 deletion docs/Reference/CLI/CLI-Syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ Show the help message and exit.
```

Path or URL to an SSZ-encoded state file. The state file can be used to specify the genesis state,
or a recent finalized checkpoint state from which to sync.
or a [recent finalized checkpoint state from which to sync].

!!! note

Expand Down Expand Up @@ -1813,4 +1813,5 @@ or clear your weak subjectivity settings.
[weak subjectivity period]: ../../Concepts/Weak-Subjectivity.md
[BeaconScan chain explorer]: https://beaconscan.com/ws_checkpoint
[load new validators without restarting Teku]: ../../HowTo/Load-Validators-No-Restart.md
[recent finalized checkpoint state from which to sync]: ../../HowTo/Get-Started/Checkpoint-Start.md
[Ethereum 2.0 specification]: https://github.com/ethereum/eth2.0-specs/tree/master/configs
4 changes: 3 additions & 1 deletion docs/Reference/CLI/Subcommands/Validator-Client.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ is specified using [`--data-base-path`](#data-base-path-data-path).
initial-state: "/home/me/genesis.ssz"
```

Path or URL to the network genesis file.
Path or URL to an SSZ-encoded state file. The state file can be used to specify the genesis state,
or a [recent finalized checkpoint state from which to sync].

This option does not need to be specified if the initial state is provided by the network specified
using the [`--network`](#network) option.
Expand Down Expand Up @@ -788,3 +789,4 @@ Attempts to lock all keystores in a directory if a directory is specified in
[environment variables or a configuration file]: ../CLI-Syntax.md#specifying-options
[Web3Signer]: https://docs.web3signer.consensys.net/en/latest/
[slashing protection]: ../../../Concepts/Slashing-Protection.md
[recent finalized checkpoint state from which to sync]: ../../../HowTo/Get-Started/Checkpoint-Start.md
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ nav:
- Connect to a network:
- Connect to Mainnet: HowTo/Get-Started/Connect/Connect-To-Mainnet.md
- Connect to a testnet: HowTo/Get-Started/Connect/Connect-To-Testnet.md
- Start Teku from a recent state: HowTo/Get-Started/Checkpoint-Start.md
- External signing:
- Use an external signer: HowTo/External-Signer/Use-External-Signer.md
- Load validators without restarting: HowTo/Load-Validators-No-Restart.md
Expand Down

0 comments on commit 3f7aaaf

Please sign in to comment.