Skip to content

Commit

Permalink
updates and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bloxster committed Dec 20, 2024
1 parent cb9ce75 commit afb2509
Show file tree
Hide file tree
Showing 23 changed files with 133 additions and 163 deletions.
20 changes: 2 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
# The Erigon 3 Book

This is the official The Erigon 3 Book, soon online at <https://docs.erigon.tech/>.
This is the official Erigon 3 documentation, hosted at <https://docs.erigon.tech/>.

It is built on [mdbook](https://rust-lang.github.io/mdBook/). Please take a look at its install instructions first.

## Build

```shell
mdbook build
```

The compiled book will be available in the `book` subdirectory.

## Run it locally

```shell
mdbook serve
```

It will start a local HTTP server and serve the book contents at http://localhost:3000/.
Development branch is hosted at <https://development.erigon-documentation-preview.pages.dev> and it is built on [mdbook](https://rust-lang.github.io/mdBook/). If you want to contribute please take a look at its install instructions first.
17 changes: 8 additions & 9 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,18 @@
- [Default Ports and Firewalls](basic/ports.md)
- [Web3 Wallet](basic/wallet)

- [Quick nodes](quick_nodes.md)
- [How to run an Ethereum node](nodes/ethereum.md)
- [How to run a Gnosis Chain node](nodes/gnosis.md)
- [How to run a Polygon node](nodes/polygon.md)

- [Advanced Usage](advanced.md)
- [Configuring Erigon](advanced/configuring.md)
- [Consensus Layer](advanced/consensus_layer.md)
- [Caplin](advanced/caplin.md)
- [Prysm](advanced/prysm.md)
- [Lighthouse](advanced/lighthouse.md)
- [JWT secret](advanced/jwt.md)
- [Block production](advanced/block-prod.md)
- [Options](advanced/options.md)
- [RPC Daemon](advanced/rpc_daemon.md)
- [TxPool](advanced/txpool.md)
Expand All @@ -39,14 +43,9 @@
- [TLS Authentication](advanced/tls-authentication.md)
- [Perfomance Tricks](advanced/performance.md)

---

- [Quick nodes](quick_nodes.md)
- [Ethereum](nodes/ethereum.md)
- [Gnosis](nodes/gnosis.md)
- [Polygon](nodes/polygon.md)

---
- [Staking](staking.md)
- [External CL](advanced/bp-ext.md)
- [Caplin](advanced/bp-caplin.md)

- [Tools](tools.md)
- [Dagnostic Tools](tools/introduction.md)
Expand Down
37 changes: 2 additions & 35 deletions src/advanced/block-prod.md → src/advanced/bp-caplin.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,7 @@
# Block production

*How to propose and validate blocks with Erigon*

Both remote miners and Caplin are supported.

# Using remote miners

To enable remote miners , add the flags:

```bash
--mine --miner.etherbase=...
```
or

```bash
--mine --miner.miner.sigkey=...
```

Other supported options are:
- `--miner.notify`: Comma separated HTTP URL list to notify of new work packages
- `--miner.gaslimit`: Target gas limit for mined blocks (default: `36000000`)
- `--miner.etherbase`: Public address for block mining rewards (default: "`0`")
- `--miner.extradata`: Block extra data set by the miner (default: `client version`)
- `--miner.noverify`: Disable remote sealing verification (default: `false`)
- `--miner.noverify`: Disable remote sealing verification (default: `false`)
- `--miner.sigfile`: Private key to sign blocks with
- `--miner.recommit`: Time interval to recreate the block being mined (default: `3s`)
- `--miner.gasprice`: This option sets the minimum gas price for mined transactions
- `--miner.gastarget`: This option sets the maximum amount of gas that could be spent during a transaction.

Erigon supports [standard JSON-RPC methods](https://ethereum.org/en/developers/docs/apis/json-rpc/).

# Using Caplin as validator
*Running Erigon with Caplin and Lighthouse Validator*
*Running Erigon with Caplin as validator*

Caplin is also suitable for staking, however, you will need to utilize either Lighthouse, Teku, or another validator client as your key manager, since Caplin does not offer a native key management solution.
Caplin is also suitable for staking. However, it is required to pair it with a validator key manager, such as Lighthouse or Teku, since it doesn't have a native key management system.

This guide explains how to use Erigon with its embedded Caplin consensus layer and Lighthouse as the validator client for staking on Ethereum.

Expand Down
26 changes: 26 additions & 0 deletions src/advanced/bp-ext.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Using an external consensus client as validator

To enable external consensus clients, add the flags:

```bash
--mine --miner.etherbase=...
```
or

```bash
--mine --miner.miner.sigkey=...
```

Other supported options are:
- `--miner.notify`: Comma separated HTTP URL list to notify of new work packages
- `--miner.gaslimit`: Target gas limit for mined blocks (default: `36000000`)
- `--miner.etherbase`: Public address for block mining rewards (default: "`0`")
- `--miner.extradata`: Block extra data set by the miner (default: `client version`)
- `--miner.noverify`: Disable remote sealing verification (default: `false`)
- `--miner.noverify`: Disable remote sealing verification (default: `false`)
- `--miner.sigfile`: Private key to sign blocks with
- `--miner.recommit`: Time interval to recreate the block being mined (default: `3s`)
- `--miner.gasprice`: This option sets the minimum gas price for mined transactions
- `--miner.gastarget`: This option sets the maximum amount of gas that could be spent during a transaction.

Erigon supports [standard JSON-RPC methods](https://ethereum.org/en/developers/docs/apis/json-rpc/).
4 changes: 2 additions & 2 deletions src/advanced/configuring.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ The Erigon 3 CLI has a wide range of flags that can be used to customize its beh

## Data Storage

* `--datadir`: Set the data directory for the databases (default: `/home/admin/.local/share/erigon`)
* `--ethash.dagdir`: Set the directory to store the ethash mining DAGs (default: `/home/admin/.local/share/erigon-ethash`)
* `--datadir`: Set the data directory for the databases (default: `/home/usr/.local/share/erigon`)
* `--ethash.dagdir`: Set the directory to store the ethash mining DAGs (default: `/home/usr/.local/share/erigon-ethash`)
* `--database.verbosity` Enabling internal db logs. Very high verbosity levels may require recompile db. Default: 2, means warning. (default: `2`)

## Logging
Expand Down
4 changes: 2 additions & 2 deletions src/advanced/downloader.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ To display available options for downloader digit:
The `--help` flag listing is reproduced below for your convenience.
```
```bash
snapshot downloader
Usage:
Expand All @@ -182,7 +182,7 @@ Available Commands:
Flags:
--chain string name of the network to join (default "mainnet")
--datadir string Data directory for the databases (default "/home/admin/.local/share/erigon")
--datadir string Data directory for the databases (default "/home/usr/.local/share/erigon")
--db.writemap Enable WRITE_MAP feature for fast database writes and fast commit times (default true)
--diagnostics.disabled Disable diagnostics
--diagnostics.endpoint.addr string Diagnostics HTTP server listening interface (default "127.0.0.1")
Expand Down
34 changes: 29 additions & 5 deletions src/advanced/lighthouse.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
# Lighthouse

Lighthouse is another popular client that combined with Erigon can be used for block building.
Lighthouse is another popular client that combined with Erigon can be used for block building. The necessary steps to run Erigon with Lightouse are listed here following:

1. Start Erigon with the flag `--externalcl` to allow a external Consesus Layer:

```bash
./build/bin/erigon --externalcl
```

2. Install Lighthouse by following the [official instructions](https://lighthouse-book.sigmaprime.io).

3. Lighthouse must fully synchronize before Erigon can start syncing, since Erigon requires an existing target head to sync to. The quickest way to get Lighthouse synced is to use a public checkpoint synchronization endpoint from the list at <https://eth-clients.github.io/checkpoint-sync-endpoints>.

In order to communicate with Erigon the execution endpoint `<erigon address>:8551` must be specified, where `<erigon address>` is either `//localhost` or the IP address of the device running Erigon.

Lighthouse must point to the [JWT secret](/advanced/jwt.md) automatically created by Erigon in the datadir directory (in the below example the default data directory is used).

```bash
lighthouse bn \
--network mainnet \
--execution-endpoint http://localhost:8551 \
--execution-jwt /home/usr/.local/share/erigon/jwt.hex \
--checkpoint-sync-url https://mainnet.checkpoint.sigp.io \
```

If your Lighthouse is on a different device, add `--authrpc.addr 0.0.0.0` (Engine API listens on localhost by default) as well as `--authrpc.vhosts <CL host>`.





Documentation can be found here: <https://lighthouse-book.sigmaprime.io>

The basic steps to run Erigon together with Lighthouse are:
1. Install and run Erigon. Erigon will automatically create a JWT secret.
2. Install and run Lighthouse, pointing to JWT secret created by Erigon.
21 changes: 20 additions & 1 deletion src/advanced/prysm.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
# Prysm

Prysm is a popular client that combined with Erigon can be used for staking. The necessary steps to run Erigon with Prysm are listed here following:

<img src="/images/WIP.png" alt="" style="display: block; margin: 0 auto;">
1. Start Erigon with the flag `--externalcl` to allow a external Consesus Layer:

```bash
./build/bin/erigon --externalcl
```

2. Install Prysm by following the [official instructions](https://docs.prylabs.network/docs/install/install-with-script).

3. Prysm must fully synchronize before Erigon can start syncing, since Erigon requires an existing target head to sync to. The quickest way to get Prysm synced is to use a public checkpoint synchronization endpoint from the list at <https://eth-clients.github.io/checkpoint-sync-endpoints>.

In order to communicate with Erigon the execution endpoint `<erigon address>:8551` must be specified, where `<erigon address>` is either `//localhost` or the IP address of the device running Erigon.

Prysm must point to the [JWT secret](/advanced/jwt.md) automatically created by Erigon in the datadir directory (in the below example the default data directory is used).

```bash
./prysm.sh beacon-chain --execution-endpoint=http://localhost:8551 --mainnet --jwt-secret=/home/usr/.local/share/erigon/jwt.hex --checkpoint-sync-url=https://beaconstate.info --genesis-beacon-api-url=https://beaconstate.info
```

If your Prysm is on a different device, add `--authrpc.addr 0.0.0.0` (Engine API listens on localhost by default) as well as `--authrpc.vhosts <CL host>`.
2 changes: 1 addition & 1 deletion src/advanced/rpc_daemon.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ For example:

```bash
./build/bin/erigon --internalcl --private.api.addr=localhost:9090 --http=false
./build/bin/rpcdaemon --private.api.addr=localhost:9090 --http.vhosts="*" --http.addr="0.0.0.0" --http.api=eth,erigon,web3,net,debug,trace,txpool —-datadir=/home/admin/.local/share/erigon
./build/bin/rpcdaemon --private.api.addr=localhost:9090 --http.vhosts="*" --http.addr="0.0.0.0" --http.api=eth,erigon,web3,net,debug,trace,txpool —-datadir=/home/usr/.local/share/erigon
```

With the above command it has also been specified which RPC namespaces to enable by `--http.api` flag.
Expand Down
2 changes: 1 addition & 1 deletion src/advanced/txpool.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Usage:
txpool [flags]

Flags:
--datadir string Data directory for the databases (default "/home/admin/.local/share/erigon")
--datadir string Data directory for the databases (default "/home/usr/.local/share/erigon")
-h, --help help for txpool
--log.console.json Format console logs with JSON
--log.console.verbosity string Set the log level for console logs (default "info")
Expand Down
2 changes: 1 addition & 1 deletion src/basic-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The default Consensus Layer utilized is [Caplin](./advanced/caplin.md), the Erig

# Basic Configuration​

* Default data directory is `/home/admin/.local/share/erigon`. If you want to store Erigon files in a non-default location, add flag:
* Default data directory is `/home/usr/.local/share/erigon`. If you want to store Erigon files in a non-default location, add flag:

```bash
--datadir=<your_data_dir>
Expand Down
4 changes: 2 additions & 2 deletions src/basic/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ Minimal node is suitable for users with constrained hardware who wants to achiev

## Full node

Erigon 3 is full Node by default. The full node configuration delivers **faster sync times** and reduced resource consumption for everyday operation, maintaining essential data while **reducing storage requirements**. We recommend running a full node whenever possible, as it supports the network's decentralization, resilience, and robustness, aligning with Ethereum's trustless and distributed ethos. Given the reduced [disk space](disk-space.md) requirements of Erigon 3, the full node configuration is suitable for the majority of users.
Erigon 3 is full node by default (`--prune.mode=full`). This configuration delivers **faster sync times** and reduced resource consumption for everyday operation, maintaining essential data while **reducing storage requirements**. We recommend running a full node whenever possible, as it supports the network's decentralization, resilience, and robustness, aligning with Ethereum's trustless and distributed ethos. Given the reduced [disk space](disk-space.md) requirements of Erigon 3, the full node configuration is suitable for the majority of users.

## Archive node

Ethereum's state refers to account balances, contracts, and consensus data. Archive nodes store every historical state, making it easier to access past data, but requiring more disk space. They provide comprehensive historical data, making them optimal for conducting extensive **research** on the chain, ranging from searching for old states of the EVM to implementing advanced block explorers, such as Otterscan, and undertaking **development** activities.

Erigon 3 has consistently reduced the [disk space](disk-space.md) requirements for running an archive node, rendering it more affordable and accessible to a broader range of users.
Erigon 3 has consistently reduced the [disk space](disk-space.md) requirements for running an archive node, rendering it more affordable and accessible to a broader range of users. To run a archive node use the flag `--prune.mode=archive`.

<div class="warning">

Expand Down
18 changes: 9 additions & 9 deletions src/basic/optimizing-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ For optimal performance, it's recommended to store the datadir on a fast NVMe-RA
Place the `datadir` on the slower disk. Then, create symbolic links (using `ln -s`) to the **fast disk** for the following sub-folders:

- `chaindata`
- `domain`
- `snapshots/domain`

This will speed up the execution of E3.

On the **slow disk** place `datadir` folder with the following structure:
- `chaindata` (linked to fast disk)
- `snapshots`
- `domain` (linked to fast disk)
- `history`
- `idx`
- `accessors`
- `domain` (linked to fast disk)
- `history`
- `idx`
- `accessor`
- `temp`


## Step 2: Speed Up History Access (Optional)

If you need to further improve performance:
If you need to further improve performance try the following improvements step by step:

- Store the `accessors` folder on the fast disk. This should provide a noticeable speed boost.
- If the speed is still not satisfactory, move the `idx` folder to the fast disk.
- If performance is still an issue, consider moving the entire history folder to the fast disk.
1. Store the `snapshots/accessor` folder on the fast disk. This should provide a noticeable speed boost.
2. If the speed is still not satisfactory, move the `snapshots/idx` folder to the fast disk.
3. If performance is still an issue, consider moving the entire `snapshots/history` folder to the fast disk.

By following these steps, you can optimize your Erigon 3 storage setup to achieve a good balance between performance and cost.
65 changes: 1 addition & 64 deletions src/basic/ports.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,67 +8,4 @@ Main recommendations:

This minimal configuration ensures proper P2P functionality for both the Execution and Consensus layers without exposing unnecessary services. Let me know if you need further clarifications!


## Erigon Ports

| Component | Port | Protocol | Purpose | Should Expose |
| ---------- | ----- | --------- | --------------------------- | -------------- |
| Engine | 9090 | TCP | gRPC Server | *Private* |
| Engine | 42069 | TCP & UDP | Snap sync (Bittorrent) | Public |
| Engine | 8551 | TCP | Engine API (JWT auth) | *Private* |
| Sentry | 30303 | TCP & UDP | eth/68 peering | Public |
| Sentry | 30304 | TCP & UDP | eth/67 peering | Public |
| Sentry | 9091 | TCP | Incoming gRPC Connections | *Private* |
| RPCdaemon | 8545 | TCP | HTTP & WebSockets & GraphQL | *Private* |
| Diagnostics| 8080 | TCP & UDP | Diagnostic Tool | *Private* |

## Caplin ports

| Component | Port | Protocol | Purpose | Should Expose |
| --------- | ---- | -------- | ------- | -------------- |
| Sentinel | 4000 | UDP | Peering | Public |
| Sentinel | 4001 | TCP | Peering | Public |

## Shared ports

| Component | Port | Protocol | Purpose | Should Expose |
| --------- | ---- | -------- | ------- | --------------- |
| All | 6060 | TCP | pprof | *Private* |
| All | 6060 | TCP | metrics | *Private* |

- You can optionally enable additional flags to configure the system to expose different ports for **pprof** or **metrics**. However, both **pprof** and **metrics** are configured to use the same default port of 6060/tcp.
- To run both **pprof** and **metrics** at the same time, you'll need to manually modify the port assignments or choose an alternative approach.

# gRPC ports

| Component | Port |
| ------------------- | ---- |
| http api | 9092 |
| Snapshots Downloader| 9093 |
| TxPool | 9094 |


# Hetzner firewall rules


| IP Range | Description |
| ------------------------------ | ----------------------------------------- |
| 0.0.0.0/8 | "This" Network (RFC 1122, Section 3.2.1.3) |
| 10.0.0.0/8 | Private-Use Networks (RFC 1918) |
| 100.64.0.0/10 | Carrier-Grade NAT (CGN) (RFC 6598, Section 7)|
| 127.16.0.0/12 | Private-Use Networks (RFC 1918) |
| 169.254.0.0/16 | Link Local (RFC 3927) |
| 172.16.0.0/12 | Private-Use Networks (RFC 1918) |
| 192.0.0.0/24 | IETF Protocol Assignments (RFC 5736) |
| 192.0.2.0/24 | TEST-NET-1 (RFC 5737) |
| 192.88.99.0/24 | 6to4 Relay Anycast (RFC 3068) |
| 192.168.0.0/16 | Private-Use Networks (RFC 1918) |
| 198.18.0.0/15 | Network Interconnect Device Benchmark Testing (RFC 2544)|
| 198.51.100.0/24 | TEST-NET-2 (RFC 5737) |
| 203.0.113.0/24 | TEST-NET-3 (RFC 5737) |
| 224.0.0.0/4 | Multicast (RFC 3171) |
| 240.0.0.0/4 | Reserved for Future Use (RFC 1112, Section 4)|
| 255.255.255.255/32 | Limited Broadcast (RFC 919, Section 7) |
| 255.255.255.255/32 | RFC 922, Section 7 |

Same in [IpTables](https://ethereum.stackexchange.com/questions/6386/how-to-prevent-being-blacklisted-for-running-an-ethereum-client/13068#13068) syntax.
Too see ports used by Erigon and its components refer to <https://github.com/erigontech/erigon?tab=readme-ov-file#default-ports-and-firewalls>.
2 changes: 1 addition & 1 deletion src/installation/build_exec_win.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Then click on the "**New**" button and paste the following path:
Open the Command Prompt and type the following:

```bash
git clone --branch v3.0.0-alpha6 --single-branch https://github.com/erigontech/erigon.git
git clone --branch v3.0.0-alpha7 --single-branch https://github.com/erigontech/erigon.git
```
You might need to change the `ExecutionPolicy` to allow scripts created locally or signed by a trusted publisher to run:

Expand Down
Loading

0 comments on commit afb2509

Please sign in to comment.