Skip to content

Commit

Permalink
Revise Engine API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rubo committed Sep 18, 2023
1 parent 220f0e5 commit 96d1336
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions docs/get-started/consensus-clients.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ We urge you to take [client diversity](https://ethereum.org/en/developers/docs/n

## Configuring JSON-RPC interface

Execution and consensus clients communicate via an authenticated endpoint specified in Engine JSON-RPC API. In order to connect to a consensus client, the execution client must generate a [JWT](https://jwt.io) secret at a known path. Although the secret is generated automatically by Nethermind, in some cases, you might need to do it yourself. You can generate one using [OpenSSL](https://www.openssl.org):
Execution and consensus clients communicate via an authenticated endpoint specified in Engine JSON-RPC API. In order to connect to a consensus client, the execution client must generate a [JWT](https://jwt.io) secret at a known path. Although the secret is generated automatically by Nethermind on startup at `keystore/jwt-secret` path in its root directory, in some cases, you might need to do it yourself. You can generate one using [OpenSSL](https://www.openssl.org):

```bash
openssl rand -hex 32 > path/to/jwt.hex
Expand All @@ -35,9 +35,11 @@ openssl rand -hex 32 > path/to/jwt.hex
Since the JWT secret is simply a 64-character hex value, there are many other ways of generating it, including online resources. However, for security reasons, we recommend using OpenSSL.
:::

The generated JWT secret can be specified with the `--JsonRpc.JwtSecretFile path/to/jwt.hex` command line option. For more configuration options, see [Engine API](../interacting/json-rpc-server.md#engine-api).

## Running the consensus client

This step assumes that you have already [installed](../get-started/installing-nethermind.md) Nethermind, the [consensus client](#choosing-a-consensus-client) of your choice, and, optionally, created the JWT secret. If you haven't created the JWT secret, Nethermind will create it on startup at `keystore/jwt-secret` path in its root directory.
This step assumes that you have already [installed](../get-started/installing-nethermind.md) Nethermind, the [consensus client](#choosing-a-consensus-client) of your choice, and, optionally, created the [JWT secret](#configuring-json-rpc-interface).

:::info
As syncing from the scratch can take a very long time on some networks (up to several days), the commands below optionally use [checkpoint sync](https://ethereum.org/en/developers/docs/nodes-and-clients/#checkpoint-sync) to speed up the process.
Expand Down
6 changes: 4 additions & 2 deletions docs/interacting/json-rpc-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ The Engine API is a set of RPC methods that enable communication between an exec

By default, the Engine API uses local loopback (`127.0.0.1` or `localhost`) and `8551` port. To use a different host or port, set the `--JsonRpc.EngineHost` and `--JsonRpc.EnginePort` command line options, respectively. For example, this can be useful when execution and consensus clients are on different machines.

:::caution
:::caution Important
If you specify the `--JsonRpc.EngineHost` option, the `--JsonRpc.EnginePort` option must be specified as well.
:::
:::

The Engine API uses JWT authentication and requires a JWT secret. By default, Nethermind creates one at `keystore/jwt-secret` path in its root directory. To use a different path, specify the `--JsonRpc.JwtSecretFile path/to/jwt.hex` command line option.

0 comments on commit 96d1336

Please sign in to comment.