diff --git a/docker-compose.yml b/docker-compose.yml index 8b88d83..ba65566 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,8 +14,6 @@ services: - data:/data environment: MODE: normal - NETHERMIND_SYNCCONFIG_FASTSYNC: "true" - NETHERMIND_SYNCCONFIG_SNAPSYNC: "" NETHERMIND_JSONRPCCONFIG_ENABLED: "true" NETHERMIND_JSONRPCCONFIG_HOST: 0.0.0.0 NETHERMIND_INITCONFIG_WEBSOCKETSENABLED: "true" diff --git a/getting-started.md b/getting-started.md index 2f7fd2d..050c432 100644 --- a/getting-started.md +++ b/getting-started.md @@ -8,3 +8,9 @@ There are now two RPC APIs in Execution Clients: 2. **Engine API**: Use this endpoint to connect your Beacon Chain (Consensus Layer) client. If your Execution Client is not connected to a Consensus Layer client, you won't be able to use it to query the blockchain, nor will you be able to connect your wallet to it! + +## Archive mode on Nethermind 2.0 + +Select **Archive** in the setup wizard to use the network's `_archive` configuration and its sync and storage settings. + +To serve historical state from genesis, start with a fresh data volume and sync from genesis. Switching an already synced full node to Archive does not recreate earlier state. An existing Patricia archive keeps using its Patricia database. See the [Nethermind archive guide](https://docs.nethermind.io/fundamentals/archive-nodes/) for other storage layouts, which can be configured through `EXTRA_OPTS`. diff --git a/nethermind/entrypoint.sh b/nethermind/entrypoint.sh index a5f7e87..b465248 100755 --- a/nethermind/entrypoint.sh +++ b/nethermind/entrypoint.sh @@ -8,11 +8,27 @@ echo "${JWT_SECRET}" >"${JWT_PATH}" post_jwt_to_dappmanager "${JWT_PATH}" -echo "[INFO - entrypoint] Starting Nethermind client for network: ${NETWORK}" +CONFIG="${NETWORK}" +case "${MODE:-normal}" in + normal) + ;; + archive) + CONFIG="${NETWORK}_archive" + ;; + custom) + CONFIG="/data/custom.cfg" + ;; + *) + echo "[ERROR - entrypoint] Unsupported mode: ${MODE}" >&2 + exit 1 + ;; +esac + +echo "[INFO - entrypoint] Starting Nethermind client for network: ${NETWORK}, config: ${CONFIG}" # shellcheck disable=SC2086 exec /nethermind/nethermind \ - --config "${NETWORK}" \ + --config "${CONFIG}" \ --JsonRpc.JwtSecretFile="${JWT_PATH}" \ --Network.DiscoveryPort="${P2P_PORT}" \ --Metrics.Enabled=true \ diff --git a/setup-wizard.yml b/setup-wizard.yml index 3b4161b..23b1b99 100644 --- a/setup-wizard.yml +++ b/setup-wizard.yml @@ -5,142 +5,19 @@ fields: type: environment name: MODE service: nethermind - title: Config type + title: Node mode description: >- - You must choose an installation method. Most users should choose the - normal mode, but more advanced users will be able to customize the - installation of the node and its environment variables. The methods are: - - - **Normal** (Recommended): You will fast-sync and run an Ethereum full node. - You will be able to broadcast transactions to the network and use it normally - as your main node. - - - **Archive** (NOT Recommended): An Archive node downloads and stores every - state. It is **NOT** recommended unless you want to query the node for - very specific informatin or for research purposes. - - - **Advanced** (NOT Recommended): You will be able to select different - parameters and configure them at will. Please refer to the - [documentation](https://docs.nethermind.io/fundamentals/configuration) - for further explanation. - - - **Custom** (NOT Recommended): This mode needs a configuration file (.cfg) that will load - particular settings. This allows you to use this client to set up a custom config, do not use this setting unless you are an advanced user and know exactly what you're doing, making the wrong change can break your whole Dappnode. - You can find examples of .cfg files - on [Nethermind's - Github](https://github.com/NethermindEth/nethermind/tree/master/src/Nethermind/Nethermind.Runner/configs). + Normal uses the network's default configuration. Archive uses its archive + configuration and retains historical state from the point where archive + syncing begins. To retain history from genesis, start with a fresh data + volume. Custom loads an uploaded Nethermind configuration file. enum: - "normal" - "archive" - - "advanced" - "custom" default: "normal" required: true - - id: DownloadBodiesInFastSync - target: - type: environment - name: DOWNLOAD_BODIES_IN_FAST_SYNC - service: nethermind - title: DownloadBodiesInFastSync - description: >- - If set to `true` then the block bodies will be downloaded in the Fast Sync mode. default value: true - enum: - - "true" - - "false" - default: "true" - if: { "mode": { "enum": ["advanced"] } } - - - id: downloadreceiptsinfastsync - target: - type: environment - name: DOWNLOAD_RECEIPTS_IN_FAST_SYNC - service: nethermind - title: DownloadReceiptsInFastSync - description: >- - If set to `true` then the receipts will be downloaded in the Fast Sync mode. This will slow down the process by a few hours but will allow you to interact with dApps that execute extensive historical logs searches (like Maker CDPs). default value: true - enum: - - "true" - - "false" - default: "true" - if: { "mode": { "enum": ["advanced"] } } - - - id: FastBlocks - target: - type: environment - name: FAST_BLOCKS - service: nethermind - title: FastBlocks - description: >- - If set to ‘true’ then in the Fast Sync mode blocks will be first downloaded from the provided PivotNumber downwards. This allows for parallelization of requests with many sync peers and with no need to worry about syncing a valid branch (syncing downwards to 0). You need to enter the pivot block number, hash and total difficulty from a trusted source (you can use etherscan and confirm with other sources if you wan to change it). default value: false - enum: - - "false" - - "true" - default: "false" - if: { "mode": { "enum": ["advanced"] } } - - - id: FastSync - target: - type: environment - name: FAST_SYNC - service: nethermind - title: FastSync - description: >- - If set to ‘true’ then the Fast Sync (eth/63) synchronization algorithm will be used. default value: false - enum: - - "false" - - "true" - default: "false" - if: { "mode": { "enum": ["advanced"] } } - - - id: PivotHash - target: - type: environment - name: PIVOT_HASH - service: nethermind - title: PivotHash - description: >- - Hash of the pivot block for the Fast Blocks sync. default value: null - if: { "mode": { "enum": ["advanced"] } } - - - id: PivotNumber - target: - type: environment - name: PIVOT_NUMBER - service: nethermind - title: PivotNumber - description: >- - Number of the pivot block for the Fast Blocks sync. default value: null - if: { "mode": { "enum": ["advanced"] } } - - - id: PivotTotalDifficulty - target: - type: environment - name: PIVOT_TOTAL_DIFFICULTY - service: nethermind - title: PivotTotalDifficulty - description: >- - Total Difficulty of the pivot block for the Fast Blocks sync (not - this is total difficulty and not difficulty). default value: null - if: { "mode": { "enum": ["advanced"] } } - - - id: UseGethLimitsInFastBlocks - target: - type: environment - name: USE_GETH_LIMITS_IN_FAST_BLOCKS - service: nethermind - title: UseGethLimitsInFastBlocks - description: >- - If set to `true` then in the Fast Blocks mode Nethermind generates smaller requests to avoid Geth from disconnecting. On the Geth heavy networks (mainnet) it is desired while on Parity or Nethermind heavy networks (Goerli, AuRa) it slows down the sync by a factor of ~4 default value: true - enum: - - "true" - - "false" - default: "true" - if: { "mode": { "enum": ["advanced"] } } - - id: CustomConfiguration target: type: fileUpload @@ -148,9 +25,10 @@ fields: service: nethermind title: Custom configuration file description: >- - Upload your desired configuration file. You can get more info about how to configure nethermind [here](https://nethermind.readthedocs.io/en/latest/configuration.html) and also you can find some examples [here](https://github.com/NethermindEth/nethermind/tree/master/src/Nethermind/Nethermind.Runner/configs) + Upload a Nethermind JSON configuration file. See the + [configuration guide](https://docs.nethermind.io/fundamentals/configuration/). if: { "mode": { "enum": ["custom"] } } - + - id: EnableUI target: type: environment @@ -158,7 +36,7 @@ fields: service: nethermind title: Nethermind UI description: >- - If set to `true` then you will be able to access a UI where to check basic info from the Nethermind client. + Enable Nethermind's health check UI. enum: - "true" - "false"