diff --git a/pages/index.md b/pages/index.md index f7f3e6c09b0..fe04906c31b 100644 --- a/pages/index.md +++ b/pages/index.md @@ -786,6 +786,7 @@ + [How to set up a web server (LAMP) on Debian or Ubuntu](bare_metal_cloud/dedicated_servers/installing_lamp_debian9_ubuntu18) + [Local Zone VPN-as-a-Service (VPNaaS) with Tailscale Integration](public_cloud/compute/local-zones-vpn-tailscale-integration) + [How to connect a Public Cloud instance to an EFS volume via vRack](storage_and_backup/file_storage/enterprise_file_storage/netapp_pci_connection_via_vrack) + + [Running an Ethereum node on a Public Cloud instance](public_cloud/compute/tutorial-blockchain-running-ethereum-node) + [Security](public-cloud-compute-security) + [How to create and use authentication keys for SSH connections to Public Cloud instances](public_cloud/compute/creating-ssh-keys-pci) + [How to configure additional SSH keys on an instance](public_cloud/compute/configuring_additional_ssh_keys) diff --git a/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/guide.de-de.md b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/guide.de-de.md new file mode 100644 index 00000000000..e84ecf088b4 --- /dev/null +++ b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/guide.de-de.md @@ -0,0 +1,353 @@ +--- +title: 'Einen Ethereum-Node auf einer Public Cloud Instanz betreiben' +excerpt: 'Einen vollständigen Ethereum-Node mit Nethermind (EL) und Lighthouse (CL) auf einer OVHcloud Public Cloud Instanz mit Block Storage für Blockchain-Daten bereitstellen' +updated: 2026-03-12 +--- + +## Ziel + +Ethereum ist eines der am weitesten verbreiteten Blockchain-Netzwerke und bildet die Grundlage für Smart Contracts in den Bereichen dezentrale Finanzen (DeFi) und NFT-Ökosysteme. Der Betrieb eines eigenen Ethereum-Nodes ermöglicht es Ihnen, direkt mit dem Netzwerk zu interagieren, ohne auf Dienste von Drittanbietern angewiesen zu sein. + +Ein voll funktionsfähiger Ethereum-Node erfordert zwei zentrale Softwarekomponenten, die koordiniert arbeiten: + +1. **Execution Client (EL)** — verantwortlich für die Verarbeitung von Transaktionen und die Pflege des Ethereum-Zustands. +2. **Consensus Client (CL)** — verantwortlich für die Konsensbildung mit dem restlichen Netzwerk über das Ethereum Proof-of-Stake-Protokoll. + +Diese beiden Komponenten müssen parallel laufen und sicher miteinander kommunizieren, um die Synchronisation mit dem Ethereum Mainnet aufrechtzuerhalten. + +Das Ethereum-Ökosystem unterstützt mehrere Client-Implementierungen, die jeweils unabhängig entwickelt werden, aber der Ethereum-Spezifikation entsprechen. Zu den am häufigsten verwendeten Optionen gehören: + +**Execution Clients (EL):** + +- Geth +- Nethermind +- Reth +- Besu +- Erigon + +**Consensus Clients (CL):** + +- Lighthouse +- Prysm +- Teku +- Nimbus +- Lodestar + +In diesem Tutorial verwenden wir die folgende Kombination: + +- **Execution Client**: Nethermind +- **Consensus Client**: Lighthouse + +**Dieses Tutorial führt Sie durch die Bereitstellung eines voll funktionsfähigen Ethereum-Nodes auf einer OVHcloud Public Cloud Instanz.** + +> [!warning] +> +> Die Sicherheitshärtung und die betrieblichen Best Practices, die zum vollständigen Schutz eines Ethereum-Nodes erforderlich sind, gehen über den Rahmen dieses Tutorials hinaus. Es wird dringend empfohlen, zusätzliche Sicherheitsmaßnahmen zu implementieren — wie Firewall-Konfiguration, Schlüsselverwaltung und Monitoring — entsprechend Ihren organisatorischen Anforderungen und branchenüblichen Best Practices. +> + +## Voraussetzungen + +- Sie verfügen über ein [Public Cloud Projekt](/pages/public_cloud/compute/create_a_public_cloud_project) in Ihrem OVHcloud Kunden-Account. +- Sie verfügen über eine [Public Cloud Instanz](/pages/public_cloud/compute/public-cloud-first-steps) mit mindestens 2 vCores und 30 GB RAM (z.B. R2-30), auf der **Ubuntu 24.04 LTS** läuft. +- Sie verfügen über ein [Block Storage Volume](/pages/public_cloud/compute/create_and_configure_an_additional_disk_on_an_instance) von mindestens 2 TB mit dem Typ **High-Speed Gen2**, das an Ihre Instanz angehängt ist. +- Sie haben administrativen Zugriff (sudo) auf die Instanz via SSH. + +> [!primary] +> +> Laut der Dokumentation der Ethereum Foundation benötigt ein Ethereum-Node mindestens: +> +> - **Execution Client**: 2 CPU-Kerne, 16 GB RAM und 1 TB schnellen SSD-Speicher +> - **Consensus Client**: 2 CPU-Kerne, 8 GB RAM und Zugang zum selben Speicher +> +> Für Produktionsumgebungen und langfristige Stabilität werden höhere Spezifikationen dringend empfohlen. +> + +## In der praktischen Anwendung + +### Schritt 1 - Block Storage Volume mounten + +Sobald Sie Ihr [Block Storage Volume erstellt und an Ihre Instanz angehängt](/pages/public_cloud/compute/create_and_configure_an_additional_disk_on_an_instance) haben, verbinden Sie sich per SSH mit Ihrer Instanz: + +```bash +ssh ubuntu@ +``` + +Listen Sie alle verfügbaren Blockgeräte auf, um Ihr angehängtes Volume zu identifizieren: + +```bash +lsblk +``` + +![lsblk-Ausgabe mit dem angehängten Volume](images/lsblk_output.png){.thumbnail} + +Dies zeigt eine Baumansicht aller Speichergeräte an. Identifizieren Sie das Gerät (z.B. `/dev/sdb`), das Ihrem 2-TB-Volume entspricht. Es wird formatiert und gemountet, um die Ethereum-Blockchain-Daten zu speichern. + +Erstellen Sie eine Partition auf dem neu angehängten Volume. Ersetzen Sie `/dev/sdb` durch den im vorherigen Schritt identifizierten Gerätenamen, falls dieser abweicht: + +```bash +sudo fdisk /dev/sdb +``` + +![fdisk-Partitionierung](images/fdisk_partition.png){.thumbnail} + +Dies öffnet das Partitionierungswerkzeug für das ausgewählte Blockgerät. Erstellen Sie eine neue primäre Partition, die die gesamte Festplatte umfasst, und schreiben Sie die Änderungen. Nach Abschluss ist die Partition in der Regel als `/dev/sdb1` verfügbar. + +Formatieren Sie die neue Partition mit dem ext4-Dateisystem, das eine stabile und weit verbreitete Wahl für die Speicherung von Ethereum-Blockchain-Daten ist: + +```bash +sudo mkfs.ext4 /dev/sdb1 +``` + +![ext4-Formatierung](images/mkfs_ext4.png){.thumbnail} + +Erstellen Sie ein dediziertes Verzeichnis als Mountpunkt für das formatierte Volume, mounten Sie es und überprüfen Sie, ob es erfolgreich an das Dateisystem angehängt wurde: + +```bash +sudo mkdir -p /mnt/chaindata +sudo mount /dev/sdb1 /mnt/chaindata +df -h +``` + +- `mkdir -p /mnt/chaindata` erstellt das Mount-Verzeichnis (`-p` stellt sicher, dass kein Fehler auftritt, wenn übergeordnete Verzeichnisse fehlen). +- `mount /dev/sdb1 /mnt/chaindata` mountet die formatierte Partition in das Verzeichnis. +- `df -h` zeigt alle gemounteten Dateisysteme in einem lesbaren Format an, sodass Sie bestätigen können, dass `/dev/sdb1` korrekt unter `/mnt/chaindata` mit der erwarteten Kapazität (ca. 2 TB) gemountet ist. + +![Mount überprüfen](images/mount_verify.png){.thumbnail} + +Ihre Festplatte ist jetzt gemountet, aber die Konfiguration ist **nicht persistent**: Wenn der Server neu startet, muss das Volume manuell gemountet werden. Um es beim Systemstart automatisch zu mounten, fügen Sie einen Eintrag in `/etc/fstab` hinzu. + +Rufen Sie die **UUID (Universally Unique Identifier)** Ihres Volumes ab: + +```bash +sudo blkid +``` + +![blkid-Ausgabe](images/blkid_output.png){.thumbnail} + +Dieser Befehl listet alle Blockgeräte und ihre zugehörigen Attribute auf. Identifizieren Sie den Eintrag, der Ihrer neuen Partition entspricht (z.B. `/dev/sdb1`), und kopieren Sie den Wert des `UUID`-Feldes. + +Bearbeiten Sie die Datei `/etc/fstab`, um den automatischen Mount zu konfigurieren: + +```bash +sudo nano /etc/fstab +``` + +```text +UUID= /mnt/chaindata ext4 nofail 0 0 +``` + +Die Option `nofail` ermöglicht es dem System, den Bootvorgang fortzusetzen, auch wenn das Gerät nicht verfügbar ist. + +### Schritt 2 - Dedizierten Benutzer erstellen + +Erstellen Sie ein **dediziertes Benutzerkonto**, um alle Ethereum-Node-Operationen zu verwalten. Diese Vorgehensweise verbessert die Sicherheit, indem Node-Prozesse vom Standard-Systembenutzer getrennt werden. + +```bash +sudo useradd -s /bin/bash -d /home/node_admin/ -m -G sudo node_admin +``` + +- `useradd` erstellt einen neuen Benutzer namens `node_admin` mit einem Home-Verzeichnis, einer Bash-Shell und Mitgliedschaft in der `sudo`-Gruppe. + +Legen Sie ein Passwort für den neuen Benutzer fest (ersetzen Sie es durch ein sicheres Passwort oder konfigurieren Sie eine schlüsselbasierte Anmeldung): + +```bash +echo 'node_admin:' | sudo chpasswd +``` + +Konfigurieren Sie die **SSH-Schlüssel-Authentifizierung** für den neuen Benutzer, indem Sie Ihren öffentlichen SSH-Schlüssel zur Datei `authorized_keys` hinzufügen. Ersetzen Sie den Platzhalter durch Ihren tatsächlichen öffentlichen Schlüssel: + +```bash +sudo mkdir -p /home/node_admin/.ssh +sudo sh -c "echo '' > /home/node_admin/.ssh/authorized_keys" +``` + +Dies erstellt die Datei `authorized_keys` unter `/home/node_admin/.ssh/` und schreibt Ihren öffentlichen Schlüssel hinein, was eine sichere, passwortlose Anmeldung als Benutzer `node_admin` ermöglicht. + +### Schritt 3 - Nethermind (Execution Client) installieren + +Nethermind ist ein Ethereum Execution Client, der für die Verarbeitung von Transaktionen und die Pflege des Ethereum-Zustands verantwortlich ist. + +Fügen Sie das offizielle Nethermind APT-Repository hinzu: + +```bash +sudo apt-get install software-properties-common -y +sudo add-apt-repository ppa:nethermindeth/nethermind +``` + +![Nethermind-Repository hinzufügen](images/nethermind_add_repo.png){.thumbnail} + +Aktualisieren Sie den Paketindex: + +```bash +sudo apt-get update +``` + +![Pakete aktualisieren](images/nethermind_apt_update.png){.thumbnail} + +Installieren Sie Nethermind: + +```bash +sudo apt-get install nethermind -y +``` + +![Nethermind installieren](images/nethermind_install.png){.thumbnail} + +### Schritt 4 - Lighthouse (Consensus Client) installieren + +Lighthouse ist ein Ethereum Consensus Client, der für die Konsensbildung über das Proof-of-Stake-Protokoll verantwortlich ist. + +Laden Sie die neueste stabile Version von der [Lighthouse GitHub Releases-Seite](https://github.com/sigp/lighthouse/releases) herunter: + +```bash +curl -LO https://github.com/sigp/lighthouse/releases/download/v7.1.0/lighthouse-v7.1.0-x86_64-unknown-linux-gnu.tar.gz +``` + +![Lighthouse herunterladen](images/lighthouse_download.png){.thumbnail} + +Entpacken Sie das Archiv: + +```bash +tar -xvf lighthouse-v7.1.0-x86_64-unknown-linux-gnu.tar.gz +``` + +![Lighthouse entpacken](images/lighthouse_extract.png){.thumbnail} + +Überprüfen Sie die Binärdatei und verschieben Sie sie an einen systemweiten Speicherort: + +```bash +./lighthouse --version +sudo cp lighthouse /usr/bin +``` + +![Lighthouse-Version](images/lighthouse_version.png){.thumbnail} + +### Schritt 5 - JWT-Geheimdatei erstellen + +Ein gemeinsames JWT-Geheimnis ist für die sichere Kommunikation zwischen dem Execution Client und dem Consensus Client erforderlich. + +```bash +sudo mkdir -p /secrets +openssl rand -hex 32 | tr -d "\n" | sudo tee /secrets/jwt.hex > /dev/null +``` + +![JWT-Geheimnis erstellt](images/jwt_secret.png){.thumbnail} + +### Schritt 6 - screen für Sitzungspersistenz installieren + +Auf einem Remote-Server werden laufende Prozesse beim Trennen der SSH-Verbindung beendet. `screen` hält sie unabhängig von Ihrer Sitzung im Hintergrund am Laufen. + +```bash +screen --version +``` + +![screen-Version](images/screen_version.png){.thumbnail} + +Falls noch nicht installiert: + +```bash +sudo apt-get install screen -y +``` + +### Schritt 7 - Verzeichnis-Eigentümerschaft festlegen + +Die Ethereum-Clients benötigen Schreibzugriff auf das Datenverzeichnis. Weisen Sie Ihrem aktuellen Benutzer die Eigentümerschaft des Mountpunkts zu: + +```bash +sudo chown $USER:$USER /mnt/chaindata +``` + +Dies gewährt Ihrem Benutzer die volle Eigentümerschaft über `/mnt/chaindata`, sodass die Ethereum-Clients dort Daten lesen und schreiben können. + +### Schritt 8 - Nethermind starten + +Erstellen Sie eine screen-Sitzung und starten Sie Nethermind: + +```bash +screen -S nethermind +``` + +```bash +nethermind -c mainnet \ + --data-dir /mnt/chaindata/nethermind \ + --JsonRpc.Enabled true \ + --HealthChecks.Enabled true \ + --HealthChecks.UIEnabled true \ + --JsonRpc.EngineHost=127.0.0.1 \ + --JsonRpc.EnginePort=8551 \ + --JsonRpc.JwtSecretFile=/secrets/jwt.hex +``` + +Sie sollten Logeinträge sehen, die anzeigen, dass der Client läuft. Schließlich wird die folgende Nachricht erscheinen: + +```text +Waiting for Forkchoice message from Consensus Layer +``` + +Dies zeigt an, dass der Execution Client darauf wartet, sich mit dem Consensus Client zu verbinden. + +![Nethermind läuft](images/nethermind_running.png){.thumbnail} + +Trennen Sie die Sitzung, indem Sie `Ctrl+A` und dann `D` drücken, um zur Haupt-Shell zurückzukehren. + +Sie können aktive Sitzungen mit `screen -ls` auflisten und sich später mit `screen -r nethermind` erneut verbinden. + +![screen-Sitzungen](images/screen_list.png){.thumbnail} + +### Schritt 9 - Lighthouse starten + +Erstellen Sie eine neue screen-Sitzung und starten Sie Lighthouse: + +```bash +screen -S lighthouse +``` + +```bash +lighthouse bn \ + --network mainnet \ + --execution-endpoint http://127.0.0.1:8551 \ + --execution-jwt /secrets/jwt.hex \ + --checkpoint-sync-url https://mainnet.checkpoint.sigp.io \ + --http \ + --datadir /mnt/chaindata/lighthouse +``` + +![Lighthouse startet](images/lighthouse_start.png){.thumbnail} + +Nach der Ersteinrichtung sollte Lighthouse mit der Synchronisation mit dem Netzwerk beginnen. + +![Lighthouse synchronisiert](images/lighthouse_syncing.png){.thumbnail} + +Trennen Sie die Sitzung, indem Sie `Ctrl+A` und dann `D` drücken. + +### Schritt 10 - Synchronisation überprüfen + +Zu diesem Zeitpunkt sollten sowohl der **Execution Client** (Nethermind) als auch der **Consensus Client** (Lighthouse) in separaten screen-Sitzungen laufen. Um zu bestätigen, dass sie korrekt verbunden sind und die Synchronisation läuft, verbinden Sie sich erneut mit der Nethermind-Sitzung und überprüfen Sie die Logeinträge: + +```bash +screen -r nethermind +``` + +Wenn Lighthouse korrekt verbunden ist, sollte die Nachricht "Waiting for Forkchoice" verschwinden. Stattdessen sollten Sie **Engine API**-Kommunikation und Block-Verarbeitungslogs sehen: + +```text +Received ForkChoice: ... +Syncing... +``` + +![EL- und CL-Synchronisation](images/el_cl_sync.png){.thumbnail} + +Diese Logeinträge bestätigen, dass Nethermind Block-Vorschläge und Fork-Choice-Updates von Lighthouse empfängt und dass der Node mit dem Ethereum Mainnet synchronisiert. + +Während sich dieses Tutorial auf die technische Bereitstellung konzentrierte, ist es wichtig, die Einrichtung durch geeignete Sicherheitshärtung, Monitoring und Wartungspraktiken zu ergänzen, um langfristige Stabilität zu gewährleisten. Mit der nun geschaffenen Grundlage können Sie die Funktionalität Ihres Nodes erweitern, ihn in größere Infrastrukturen integrieren oder als Basis für Forschung, Entwicklung und Staking-Operationen verwenden. + +## Weiterführende Informationen + +- [Ethereum Foundation - Run a node](https://ethereum.org/en/run-a-node/) +- [Nethermind-Dokumentation](https://docs.nethermind.io/) +- [Lighthouse-Dokumentation](https://lighthouse-book.sigmaprime.io/) + +[Eine Public Cloud Instanz erstellen](/pages/public_cloud/compute/public-cloud-first-steps) + +[Zusätzliche Festplatte auf einer Instanz erstellen und konfigurieren](/pages/public_cloud/compute/create_and_configure_an_additional_disk_on_an_instance) + +Treten Sie unserer [User Community](/links/community) bei. diff --git a/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/guide.en-gb.md b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/guide.en-gb.md new file mode 100644 index 00000000000..722eaa4f582 --- /dev/null +++ b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/guide.en-gb.md @@ -0,0 +1,353 @@ +--- +title: 'Running an Ethereum node on a Public Cloud instance' +excerpt: 'Deploy a full Ethereum node with Nethermind (EL) and Lighthouse (CL) on an OVHcloud Public Cloud instance using block storage for chain data' +updated: 2026-03-12 +--- + +## Objective + +Ethereum is one of the most widely used blockchain networks, powering smart contracts for decentralised finance (DeFi) and NFT ecosystems. Operating your own Ethereum node allows you to interact directly with the network without relying on third-party services. + +A fully functional Ethereum node requires two key software components running in coordination: + +1. **Execution Client (EL)** — responsible for processing transactions and maintaining the Ethereum state. +2. **Consensus Client (CL)** — responsible for reaching consensus with the rest of the network through the Ethereum proof-of-stake protocol. + +These two components must run in tandem and communicate securely to maintain synchronisation with the Ethereum mainnet. + +The Ethereum ecosystem supports multiple client implementations, each developed independently but compliant with the Ethereum specification. The most widely used options include: + +**Execution Clients (EL):** + +- Geth +- Nethermind +- Reth +- Besu +- Erigon + +**Consensus Clients (CL):** + +- Lighthouse +- Prysm +- Teku +- Nimbus +- Lodestar + +For this tutorial, we will use the following combination: + +- **Execution Client**: Nethermind +- **Consensus Client**: Lighthouse + +**This tutorial will guide you through deploying a fully functional Ethereum node on an OVHcloud Public Cloud instance.** + +> [!warning] +> +> The security hardening and operational best practices required to fully protect an Ethereum node are beyond the scope of this tutorial. You are strongly advised to implement additional security measures — such as firewall configuration, key management, and monitoring — according to your organisational requirements and industry best practices. +> + +## Requirements + +- A [Public Cloud project](/pages/public_cloud/compute/create_a_public_cloud_project) in your OVHcloud account +- A [Public Cloud instance](/pages/public_cloud/compute/public-cloud-first-steps) with at least 2 vCores and 30 GB of RAM (e.g. R2-30), running **Ubuntu 24.04 LTS** +- A [Block Storage volume](/pages/public_cloud/compute/create_and_configure_an_additional_disk_on_an_instance) of at least 2 TB, using the **High-Speed Gen2** type, attached to your instance +- Administrative (sudo) access to the instance via SSH + +> [!primary] +> +> According to the Ethereum Foundation documentation, an Ethereum node requires at least: +> +> - **Execution client**: 2 CPU cores, 16 GB of RAM, and 1 TB of fast SSD storage +> - **Consensus client**: 2 CPU cores, 8 GB of RAM, and access to the same storage +> +> For production environments and long-term stability, higher specifications are strongly recommended. +> + +## Instructions + +### Step 1 - Mount the Block Storage volume + +Once you have [created and attached your Block Storage volume](/pages/public_cloud/compute/create_and_configure_an_additional_disk_on_an_instance) to the instance, connect to your instance via SSH: + +```bash +ssh ubuntu@ +``` + +List all available block devices to identify your attached volume: + +```bash +lsblk +``` + +![lsblk output showing the attached volume](images/lsblk_output.png){.thumbnail} + +This displays a tree view of all storage devices. Identify the device (e.g. `/dev/sdb`) that corresponds to your 2 TB volume. It will be formatted and mounted to store the Ethereum blockchain data. + +Create a partition on the newly attached volume. Replace `/dev/sdb` with the device name identified in the previous step if it differs: + +```bash +sudo fdisk /dev/sdb +``` + +![fdisk partitioning](images/fdisk_partition.png){.thumbnail} + +This opens the partitioning utility for the selected block device. Create a new primary partition that spans the entire disk, then write the changes. Once complete, the partition will typically be available as `/dev/sdb1`. + +Format the new partition with the ext4 filesystem, which is a stable and widely supported choice for storing Ethereum chain data: + +```bash +sudo mkfs.ext4 /dev/sdb1 +``` + +![ext4 formatting](images/mkfs_ext4.png){.thumbnail} + +Create a dedicated directory to serve as the mount point for the formatted volume, then mount it and verify that it has been successfully attached to the filesystem: + +```bash +sudo mkdir -p /mnt/chaindata +sudo mount /dev/sdb1 /mnt/chaindata +df -h +``` + +- `mkdir -p /mnt/chaindata` creates the mount directory (using `-p` ensures no error if intermediate directories are missing). +- `mount /dev/sdb1 /mnt/chaindata` mounts the formatted partition to the directory. +- `df -h` displays all mounted filesystems in a human-readable format, allowing you to confirm that `/dev/sdb1` is correctly mounted at `/mnt/chaindata` with the expected capacity (approximately 2 TB). + +![Verify mount](images/mount_verify.png){.thumbnail} + +Your disk is now mounted, but the configuration is **not persistent**: if the server restarts, the volume must be mounted manually. To make it mount automatically at boot, add an entry to `/etc/fstab`. + +Retrieve the **UUID (Universally Unique Identifier)** of your volume: + +```bash +sudo blkid +``` + +![blkid output](images/blkid_output.png){.thumbnail} + +This command lists all block devices and their associated attributes. Identify the entry corresponding to your new partition (e.g. `/dev/sdb1`) and copy the value of its `UUID` field. + +Edit the `/etc/fstab` file to configure the automatic mount: + +```bash +sudo nano /etc/fstab +``` + +```text +UUID= /mnt/chaindata ext4 nofail 0 0 +``` + +The `nofail` option allows the system to continue booting even if the device is unavailable. + +### Step 2 - Create a dedicated user + +Create a **dedicated user account** to manage all Ethereum node operations. This practice improves security by separating node processes from the default system user. + +```bash +sudo useradd -s /bin/bash -d /home/node_admin/ -m -G sudo node_admin +``` + +- `useradd` creates a new user named `node_admin`, with a home directory, bash shell, and membership in the `sudo` group. + +Set a password for the new user (replace with a strong password or configure key-based login): + +```bash +echo 'node_admin:' | sudo chpasswd +``` + +Configure **SSH key-based authentication** for the new user by adding your public SSH key to the `authorized_keys` file. Replace the placeholder with your actual public key: + +```bash +sudo mkdir -p /home/node_admin/.ssh +sudo sh -c "echo '' > /home/node_admin/.ssh/authorized_keys" +``` + +This creates the `authorized_keys` file under `/home/node_admin/.ssh/` and writes your public key into it, allowing secure, passwordless login as the `node_admin` user. + +### Step 3 - Install Nethermind (Execution Client) + +Nethermind is an Ethereum execution client responsible for processing transactions and maintaining the Ethereum state. + +Add the official Nethermind APT repository: + +```bash +sudo apt-get install software-properties-common -y +sudo add-apt-repository ppa:nethermindeth/nethermind +``` + +![Adding Nethermind repository](images/nethermind_add_repo.png){.thumbnail} + +Update the package index: + +```bash +sudo apt-get update +``` + +![Updating packages](images/nethermind_apt_update.png){.thumbnail} + +Install Nethermind: + +```bash +sudo apt-get install nethermind -y +``` + +![Installing Nethermind](images/nethermind_install.png){.thumbnail} + +### Step 4 - Install Lighthouse (Consensus Client) + +Lighthouse is an Ethereum consensus client responsible for reaching consensus through the proof-of-stake protocol. + +Download the latest stable release from the [Lighthouse GitHub releases page](https://github.com/sigp/lighthouse/releases): + +```bash +curl -LO https://github.com/sigp/lighthouse/releases/download/v7.1.0/lighthouse-v7.1.0-x86_64-unknown-linux-gnu.tar.gz +``` + +![Downloading Lighthouse](images/lighthouse_download.png){.thumbnail} + +Extract the archive: + +```bash +tar -xvf lighthouse-v7.1.0-x86_64-unknown-linux-gnu.tar.gz +``` + +![Extracting Lighthouse](images/lighthouse_extract.png){.thumbnail} + +Verify the binary and move it to a system-wide location: + +```bash +./lighthouse --version +sudo cp lighthouse /usr/bin +``` + +![Lighthouse version](images/lighthouse_version.png){.thumbnail} + +### Step 5 - Create the JWT secret file + +A shared JWT secret is required for secure communication between the execution and consensus clients. + +```bash +sudo mkdir -p /secrets +openssl rand -hex 32 | tr -d "\n" | sudo tee /secrets/jwt.hex > /dev/null +``` + +![JWT secret created](images/jwt_secret.png){.thumbnail} + +### Step 6 - Install screen for session persistence + +On a remote server, disconnecting from SSH terminates running processes. `screen` keeps them running in the background independently of your session. + +```bash +screen --version +``` + +![screen version](images/screen_version.png){.thumbnail} + +If not already installed: + +```bash +sudo apt-get install screen -y +``` + +### Step 7 - Set directory ownership + +The Ethereum clients need write access to the data directory. Assign ownership of the mount point to your current user: + +```bash +sudo chown $USER:$USER /mnt/chaindata +``` + +This grants your user full ownership of `/mnt/chaindata`, so the Ethereum clients can read and write data there. + +### Step 8 - Launch Nethermind + +Create a screen session and start Nethermind: + +```bash +screen -S nethermind +``` + +```bash +nethermind -c mainnet \ + --data-dir /mnt/chaindata/nethermind \ + --JsonRpc.Enabled true \ + --HealthChecks.Enabled true \ + --HealthChecks.UIEnabled true \ + --JsonRpc.EngineHost=127.0.0.1 \ + --JsonRpc.EnginePort=8551 \ + --JsonRpc.JwtSecretFile=/secrets/jwt.hex +``` + +You should see logs indicating the client is running. Eventually, the following message will appear: + +```text +Waiting for Forkchoice message from Consensus Layer +``` + +This indicates that the execution client is waiting to pair with the consensus client. + +![Nethermind running](images/nethermind_running.png){.thumbnail} + +Detach the session by pressing `Ctrl+A` then `D` to return to the main shell. + +You can list active sessions with `screen -ls` and reattach later with `screen -r nethermind`. + +![screen sessions](images/screen_list.png){.thumbnail} + +### Step 9 - Launch Lighthouse + +Create a new screen session and start Lighthouse: + +```bash +screen -S lighthouse +``` + +```bash +lighthouse bn \ + --network mainnet \ + --execution-endpoint http://127.0.0.1:8551 \ + --execution-jwt /secrets/jwt.hex \ + --checkpoint-sync-url https://mainnet.checkpoint.sigp.io \ + --http \ + --datadir /mnt/chaindata/lighthouse +``` + +![Lighthouse starting](images/lighthouse_start.png){.thumbnail} + +After initial setup, Lighthouse should begin syncing with the network. + +![Lighthouse syncing](images/lighthouse_syncing.png){.thumbnail} + +Detach the session by pressing `Ctrl+A` then `D`. + +### Step 10 - Verify synchronisation + +At this stage, both the **execution client** (Nethermind) and the **consensus client** (Lighthouse) should be running in separate screen sessions. To confirm that they are properly connected and synchronisation is underway, reattach to the Nethermind session and inspect the logs: + +```bash +screen -r nethermind +``` + +If Lighthouse is connected correctly, the "Waiting for Forkchoice" message should disappear. Instead, you should see **Engine API** communication and block processing logs: + +```text +Received ForkChoice: ... +Syncing... +``` + +![EL and CL synchronisation](images/el_cl_sync.png){.thumbnail} + +These logs confirm that Nethermind is receiving block proposals and fork choice updates from Lighthouse, and that the node is syncing with the Ethereum mainnet. + +While this tutorial focused on the technical deployment, it is important to complement the setup with proper security hardening, monitoring, and maintenance practices to ensure long-term stability. With the foundation now in place, you can extend your node's functionality, integrate it into larger infrastructures, or use it as a base for research, development, and staking operations. + +## Go further + +- [Ethereum Foundation - Run a node](https://ethereum.org/en/run-a-node/) +- [Nethermind documentation](https://docs.nethermind.io/) +- [Lighthouse documentation](https://lighthouse-book.sigmaprime.io/) + +[Creating a Public Cloud instance](/pages/public_cloud/compute/public-cloud-first-steps) + +[Creating and configuring an additional disk on an instance](/pages/public_cloud/compute/create_and_configure_an_additional_disk_on_an_instance) + +Join our [community of users](/links/community). diff --git a/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/guide.es-es.md b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/guide.es-es.md new file mode 100644 index 00000000000..cee7159d3c3 --- /dev/null +++ b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/guide.es-es.md @@ -0,0 +1,353 @@ +--- +title: 'Ejecutar un nodo Ethereum en una instancia Public Cloud' +excerpt: 'Despliegue un nodo Ethereum completo con Nethermind (EL) y Lighthouse (CL) en una instancia Public Cloud de OVHcloud utilizando Block Storage para los datos de la cadena' +updated: 2026-03-12 +--- + +## Objetivo + +Ethereum es una de las redes blockchain más utilizadas, ya que impulsa contratos inteligentes para los ecosistemas de finanzas descentralizadas (DeFi) y NFT. Operar su propio nodo Ethereum le permite interactuar directamente con la red sin depender de servicios de terceros. + +Un nodo Ethereum completamente funcional requiere dos componentes de software clave que funcionan de forma coordinada: + +1. **Execution Client (EL)** — responsable de procesar las transacciones y mantener el estado de Ethereum. +2. **Consensus Client (CL)** — responsable de alcanzar el consenso con el resto de la red a través del protocolo de prueba de participación (proof-of-stake) de Ethereum. + +Estos dos componentes deben ejecutarse en paralelo y comunicarse de forma segura para mantener la sincronización con la red principal (mainnet) de Ethereum. + +El ecosistema Ethereum admite múltiples implementaciones de clientes, cada una desarrollada de forma independiente pero conforme a la especificación de Ethereum. Las opciones más utilizadas son: + +**Execution Clients (EL):** + +- Geth +- Nethermind +- Reth +- Besu +- Erigon + +**Consensus Clients (CL):** + +- Lighthouse +- Prysm +- Teku +- Nimbus +- Lodestar + +Para este tutorial, utilizaremos la siguiente combinación: + +- **Execution Client**: Nethermind +- **Consensus Client**: Lighthouse + +**Este tutorial le guiará a través del despliegue de un nodo Ethereum completamente funcional en una instancia Public Cloud de OVHcloud.** + +> [!warning] +> +> Las medidas de refuerzo de seguridad y las mejores prácticas operativas necesarias para proteger completamente un nodo Ethereum están fuera del alcance de este tutorial. Se recomienda encarecidamente implementar medidas de seguridad adicionales, como la configuración del firewall, la gestión de claves y la monitorización, de acuerdo con los requisitos de su organización y las mejores prácticas del sector. +> + +## Requisitos + +- Un [proyecto Public Cloud](/pages/public_cloud/compute/create_a_public_cloud_project) en su cuenta de OVHcloud +- Una [instancia Public Cloud](/pages/public_cloud/compute/public-cloud-first-steps) con al menos 2 vCores y 30 GB de RAM (p. ej., R2-30), con **Ubuntu 24.04 LTS** +- Un [volumen Block Storage](/pages/public_cloud/compute/create_and_configure_an_additional_disk_on_an_instance) de al menos 2 TB, de tipo **High-Speed Gen2**, asociado a su instancia +- Acceso de administrador (sudo) a la instancia a través de SSH + +> [!primary] +> +> Según la documentación de la Ethereum Foundation, un nodo Ethereum requiere como mínimo: +> +> - **Execution client**: 2 núcleos de CPU, 16 GB de RAM y 1 TB de almacenamiento SSD rápido +> - **Consensus client**: 2 núcleos de CPU, 8 GB de RAM y acceso al mismo almacenamiento +> +> Para entornos de producción y estabilidad a largo plazo, se recomienda encarecidamente utilizar especificaciones superiores. +> + +## Procedimiento + +### Paso 1 - Montar el volumen Block Storage + +Una vez que haya [creado y asociado su volumen Block Storage](/pages/public_cloud/compute/create_and_configure_an_additional_disk_on_an_instance) a la instancia, conéctese a su instancia a través de SSH: + +```bash +ssh ubuntu@ +``` + +Liste todos los dispositivos de bloques disponibles para identificar el volumen asociado: + +```bash +lsblk +``` + +![Salida de lsblk mostrando el volumen asociado](images/lsblk_output.png){.thumbnail} + +Esto muestra una vista en árbol de todos los dispositivos de almacenamiento. Identifique el dispositivo (p. ej., `/dev/sdb`) que corresponde a su volumen de 2 TB. Se formateará y montará para almacenar los datos de la cadena de bloques Ethereum. + +Cree una partición en el volumen recién asociado. Sustituya `/dev/sdb` por el nombre del dispositivo identificado en el paso anterior si es diferente: + +```bash +sudo fdisk /dev/sdb +``` + +![Particionado con fdisk](images/fdisk_partition.png){.thumbnail} + +Esto abre la utilidad de particionado para el dispositivo de bloques seleccionado. Cree una nueva partición primaria que abarque todo el disco y, a continuación, escriba los cambios. Una vez completado, la partición estará normalmente disponible como `/dev/sdb1`. + +Formatee la nueva partición con el sistema de archivos ext4, que es una opción estable y ampliamente compatible para almacenar los datos de la cadena Ethereum: + +```bash +sudo mkfs.ext4 /dev/sdb1 +``` + +![Formateo ext4](images/mkfs_ext4.png){.thumbnail} + +Cree un directorio dedicado que sirva como punto de montaje para el volumen formateado, móntelo y compruebe que se ha asociado correctamente al sistema de archivos: + +```bash +sudo mkdir -p /mnt/chaindata +sudo mount /dev/sdb1 /mnt/chaindata +df -h +``` + +- `mkdir -p /mnt/chaindata` crea el directorio de montaje (el uso de `-p` garantiza que no se produzca ningún error si faltan directorios intermedios). +- `mount /dev/sdb1 /mnt/chaindata` monta la partición formateada en el directorio. +- `df -h` muestra todos los sistemas de archivos montados en un formato legible, lo que le permite confirmar que `/dev/sdb1` está correctamente montado en `/mnt/chaindata` con la capacidad esperada (aproximadamente 2 TB). + +![Verificar montaje](images/mount_verify.png){.thumbnail} + +El disco ya está montado, pero la configuración **no es persistente**: si el servidor se reinicia, el volumen deberá montarse manualmente. Para que se monte automáticamente en cada arranque, añada una entrada a `/etc/fstab`. + +Obtenga el **UUID (Universally Unique Identifier)** de su volumen: + +```bash +sudo blkid +``` + +![Salida de blkid](images/blkid_output.png){.thumbnail} + +Este comando lista todos los dispositivos de bloques y sus atributos asociados. Identifique la entrada correspondiente a su nueva partición (p. ej., `/dev/sdb1`) y copie el valor del campo `UUID`. + +Edite el archivo `/etc/fstab` para configurar el montaje automático: + +```bash +sudo nano /etc/fstab +``` + +```text +UUID= /mnt/chaindata ext4 nofail 0 0 +``` + +La opción `nofail` permite que el sistema continúe arrancando aunque el dispositivo no esté disponible. + +### Paso 2 - Crear un usuario dedicado + +Cree una **cuenta de usuario dedicada** para gestionar todas las operaciones del nodo Ethereum. Esta práctica mejora la seguridad al separar los procesos del nodo del usuario del sistema por defecto. + +```bash +sudo useradd -s /bin/bash -d /home/node_admin/ -m -G sudo node_admin +``` + +- `useradd` crea un nuevo usuario llamado `node_admin`, con un directorio de inicio, shell bash y pertenencia al grupo `sudo`. + +Establezca una contraseña para el nuevo usuario (sustitúyala por una contraseña segura o configure un inicio de sesión basado en claves): + +```bash +echo 'node_admin:' | sudo chpasswd +``` + +Configure la **autenticación SSH basada en claves** para el nuevo usuario añadiendo su clave pública SSH al archivo `authorized_keys`. Sustituya el marcador de posición por su clave pública real: + +```bash +sudo mkdir -p /home/node_admin/.ssh +sudo sh -c "echo '' > /home/node_admin/.ssh/authorized_keys" +``` + +Esto crea el archivo `authorized_keys` en `/home/node_admin/.ssh/` y escribe su clave pública en él, lo que permite un inicio de sesión seguro y sin contraseña como usuario `node_admin`. + +### Paso 3 - Instalar Nethermind (Execution Client) + +Nethermind es un cliente de ejecución de Ethereum responsable de procesar las transacciones y mantener el estado de Ethereum. + +Añada el repositorio APT oficial de Nethermind: + +```bash +sudo apt-get install software-properties-common -y +sudo add-apt-repository ppa:nethermindeth/nethermind +``` + +![Añadir el repositorio de Nethermind](images/nethermind_add_repo.png){.thumbnail} + +Actualice el índice de paquetes: + +```bash +sudo apt-get update +``` + +![Actualización de paquetes](images/nethermind_apt_update.png){.thumbnail} + +Instale Nethermind: + +```bash +sudo apt-get install nethermind -y +``` + +![Instalación de Nethermind](images/nethermind_install.png){.thumbnail} + +### Paso 4 - Instalar Lighthouse (Consensus Client) + +Lighthouse es un cliente de consenso de Ethereum responsable de alcanzar el consenso a través del protocolo de prueba de participación (proof-of-stake). + +Descargue la última versión estable desde la [página de versiones de Lighthouse en GitHub](https://github.com/sigp/lighthouse/releases): + +```bash +curl -LO https://github.com/sigp/lighthouse/releases/download/v7.1.0/lighthouse-v7.1.0-x86_64-unknown-linux-gnu.tar.gz +``` + +![Descarga de Lighthouse](images/lighthouse_download.png){.thumbnail} + +Extraiga el archivo: + +```bash +tar -xvf lighthouse-v7.1.0-x86_64-unknown-linux-gnu.tar.gz +``` + +![Extracción de Lighthouse](images/lighthouse_extract.png){.thumbnail} + +Verifique el binario y muévalo a una ubicación accesible en todo el sistema: + +```bash +./lighthouse --version +sudo cp lighthouse /usr/bin +``` + +![Versión de Lighthouse](images/lighthouse_version.png){.thumbnail} + +### Paso 5 - Crear el archivo de secreto JWT + +Se requiere un secreto JWT compartido para la comunicación segura entre los clientes de ejecución y de consenso. + +```bash +sudo mkdir -p /secrets +openssl rand -hex 32 | tr -d "\n" | sudo tee /secrets/jwt.hex > /dev/null +``` + +![Secreto JWT creado](images/jwt_secret.png){.thumbnail} + +### Paso 6 - Instalar screen para la persistencia de sesiones + +En un servidor remoto, al desconectarse de SSH se terminan los procesos en ejecución. `screen` los mantiene en ejecución en segundo plano, independientemente de su sesión. + +```bash +screen --version +``` + +![Versión de screen](images/screen_version.png){.thumbnail} + +Si no está instalado: + +```bash +sudo apt-get install screen -y +``` + +### Paso 7 - Establecer la propiedad del directorio + +Los clientes de Ethereum necesitan acceso de escritura al directorio de datos. Asigne la propiedad del punto de montaje a su usuario actual: + +```bash +sudo chown $USER:$USER /mnt/chaindata +``` + +Esto concede a su usuario la propiedad total de `/mnt/chaindata`, de modo que los clientes de Ethereum puedan leer y escribir datos en él. + +### Paso 8 - Iniciar Nethermind + +Cree una sesión de screen e inicie Nethermind: + +```bash +screen -S nethermind +``` + +```bash +nethermind -c mainnet \ + --data-dir /mnt/chaindata/nethermind \ + --JsonRpc.Enabled true \ + --HealthChecks.Enabled true \ + --HealthChecks.UIEnabled true \ + --JsonRpc.EngineHost=127.0.0.1 \ + --JsonRpc.EnginePort=8551 \ + --JsonRpc.JwtSecretFile=/secrets/jwt.hex +``` + +Debería ver registros (logs) que indican que el cliente se está ejecutando. Finalmente, aparecerá el siguiente mensaje: + +```text +Waiting for Forkchoice message from Consensus Layer +``` + +Esto indica que el cliente de ejecución está esperando emparejarse con el cliente de consenso. + +![Nethermind en ejecución](images/nethermind_running.png){.thumbnail} + +Desconecte la sesión pulsando `Ctrl+A` y, a continuación, `D` para volver al shell principal. + +Puede listar las sesiones activas con `screen -ls` y volver a conectarse posteriormente con `screen -r nethermind`. + +![Sesiones de screen](images/screen_list.png){.thumbnail} + +### Paso 9 - Iniciar Lighthouse + +Cree una nueva sesión de screen e inicie Lighthouse: + +```bash +screen -S lighthouse +``` + +```bash +lighthouse bn \ + --network mainnet \ + --execution-endpoint http://127.0.0.1:8551 \ + --execution-jwt /secrets/jwt.hex \ + --checkpoint-sync-url https://mainnet.checkpoint.sigp.io \ + --http \ + --datadir /mnt/chaindata/lighthouse +``` + +![Inicio de Lighthouse](images/lighthouse_start.png){.thumbnail} + +Tras la configuración inicial, Lighthouse debería comenzar a sincronizarse con la red. + +![Sincronización de Lighthouse](images/lighthouse_syncing.png){.thumbnail} + +Desconecte la sesión pulsando `Ctrl+A` y, a continuación, `D`. + +### Paso 10 - Verificar la sincronización + +En este punto, tanto el **cliente de ejecución** (Nethermind) como el **cliente de consenso** (Lighthouse) deberían estar ejecutándose en sesiones de screen separadas. Para confirmar que están correctamente conectados y que la sincronización está en curso, vuelva a conectarse a la sesión de Nethermind e inspeccione los registros: + +```bash +screen -r nethermind +``` + +Si Lighthouse está conectado correctamente, el mensaje "Waiting for Forkchoice" debería desaparecer. En su lugar, debería ver la comunicación de la **Engine API** y los registros de procesamiento de bloques: + +```text +Received ForkChoice: ... +Syncing... +``` + +![Sincronización EL y CL](images/el_cl_sync.png){.thumbnail} + +Estos registros confirman que Nethermind está recibiendo propuestas de bloques y actualizaciones de fork choice de Lighthouse, y que el nodo se está sincronizando con la red principal de Ethereum. + +Aunque este tutorial se centró en el despliegue técnico, es importante complementar la configuración con medidas adecuadas de refuerzo de seguridad, monitorización y mantenimiento para garantizar la estabilidad a largo plazo. Con las bases ya establecidas, puede ampliar la funcionalidad de su nodo, integrarlo en infraestructuras más grandes o utilizarlo como base para investigación, desarrollo y operaciones de staking. + +## Más información + +- [Ethereum Foundation - Run a node](https://ethereum.org/en/run-a-node/) +- [Documentación de Nethermind](https://docs.nethermind.io/) +- [Documentación de Lighthouse](https://lighthouse-book.sigmaprime.io/) + +[Crear una instancia Public Cloud](/pages/public_cloud/compute/public-cloud-first-steps) + +[Crear y configurar un disco adicional en una instancia](/pages/public_cloud/compute/create_and_configure_an_additional_disk_on_an_instance) + +Interactúe con nuestra [comunidad de usuarios](/links/community). diff --git a/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/guide.fr-fr.md b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/guide.fr-fr.md new file mode 100644 index 00000000000..145229acfc1 --- /dev/null +++ b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/guide.fr-fr.md @@ -0,0 +1,353 @@ +--- +title: "Exécuter un nœud Ethereum sur une instance Public Cloud" +excerpt: "Déployez un nœud Ethereum complet avec Nethermind (EL) et Lighthouse (CL) sur une instance OVHcloud Public Cloud en utilisant le block storage pour les données de la chaîne" +updated: 2026-03-12 +--- + +## Objectif + +Ethereum est l'un des réseaux blockchain les plus utilisés, supportant les contrats intelligents pour la finance décentralisée (DeFi) et les écosystèmes NFT. Exploiter votre propre nœud Ethereum vous permet d'interagir directement avec le réseau sans dépendre de services tiers. + +Un nœud Ethereum pleinement fonctionnel nécessite deux composants logiciels clés fonctionnant de manière coordonnée : + +1. **Client d'exécution (EL)** — responsable du traitement des transactions et de la maintenance de l'état Ethereum. +2. **Client de consensus (CL)** — responsable de l'obtention du consensus avec le reste du réseau via le protocole de preuve d'enjeu (proof-of-stake) d'Ethereum. + +Ces deux composants doivent fonctionner en tandem et communiquer de manière sécurisée pour maintenir la synchronisation avec le réseau principal Ethereum (mainnet). + +L'écosystème Ethereum prend en charge plusieurs implémentations de clients, chacune développée indépendamment mais conforme à la spécification Ethereum. Les options les plus couramment utilisées sont : + +**Clients d'exécution (EL) :** + +- Geth +- Nethermind +- Reth +- Besu +- Erigon + +**Clients de consensus (CL) :** + +- Lighthouse +- Prysm +- Teku +- Nimbus +- Lodestar + +Pour ce tutoriel, nous utiliserons la combinaison suivante : + +- **Client d'exécution** : Nethermind +- **Client de consensus** : Lighthouse + +**Ce tutoriel vous guide dans le déploiement d'un nœud Ethereum pleinement fonctionnel sur une instance OVHcloud Public Cloud.** + +> [!warning] +> +> Le renforcement de la sécurité et les bonnes pratiques opérationnelles nécessaires pour protéger pleinement un nœud Ethereum dépassent le cadre de ce tutoriel. Il est fortement recommandé de mettre en œuvre des mesures de sécurité supplémentaires — telles que la configuration du pare-feu, la gestion des clés et la supervision — en fonction de vos exigences organisationnelles et des bonnes pratiques du secteur. +> + +## Prérequis + +- Un [projet Public Cloud](/pages/public_cloud/compute/create_a_public_cloud_project) dans votre compte OVHcloud +- Une [instance Public Cloud](/pages/public_cloud/compute/public-cloud-first-steps) avec au moins 2 vCores et 30 Go de RAM (par exemple R2-30), sous **Ubuntu 24.04 LTS** +- Un [volume Block Storage](/pages/public_cloud/compute/create_and_configure_an_additional_disk_on_an_instance) d'au moins 2 To, de type **High-Speed Gen2**, attaché à votre instance +- Un accès administrateur (sudo) à l'instance via SSH + +> [!primary] +> +> Selon la documentation de l'Ethereum Foundation, un nœud Ethereum nécessite au minimum : +> +> - **Client d'exécution** : 2 cœurs CPU, 16 Go de RAM et 1 To de stockage SSD rapide +> - **Client de consensus** : 2 cœurs CPU, 8 Go de RAM et un accès au même stockage +> +> Pour les environnements de production et une stabilité à long terme, des spécifications supérieures sont fortement recommandées. +> + +## En pratique + +### Étape 1 - Monter le volume Block Storage + +Une fois que vous avez [créé et attaché votre volume Block Storage](/pages/public_cloud/compute/create_and_configure_an_additional_disk_on_an_instance) à l'instance, connectez-vous à votre instance via SSH : + +```bash +ssh ubuntu@ +``` + +Listez tous les périphériques de blocs disponibles pour identifier votre volume attaché : + +```bash +lsblk +``` + +![Sortie lsblk montrant le volume attaché](images/lsblk_output.png){.thumbnail} + +Cela affiche une vue en arborescence de tous les périphériques de stockage. Identifiez le périphérique (par exemple `/dev/sdb`) qui correspond à votre volume de 2 To. Il sera formaté et monté pour stocker les données de la blockchain Ethereum. + +Créez une partition sur le volume nouvellement attaché. Remplacez `/dev/sdb` par le nom du périphérique identifié à l'étape précédente si celui-ci diffère : + +```bash +sudo fdisk /dev/sdb +``` + +![Partitionnement avec fdisk](images/fdisk_partition.png){.thumbnail} + +Cela ouvre l'utilitaire de partitionnement pour le périphérique de blocs sélectionné. Créez une nouvelle partition primaire occupant l'intégralité du disque, puis écrivez les modifications. Une fois terminé, la partition sera généralement disponible sous `/dev/sdb1`. + +Formatez la nouvelle partition avec le système de fichiers ext4, qui est un choix stable et largement pris en charge pour le stockage des données de la chaîne Ethereum : + +```bash +sudo mkfs.ext4 /dev/sdb1 +``` + +![Formatage ext4](images/mkfs_ext4.png){.thumbnail} + +Créez un répertoire dédié servant de point de montage pour le volume formaté, puis montez-le et vérifiez qu'il a été correctement attaché au système de fichiers : + +```bash +sudo mkdir -p /mnt/chaindata +sudo mount /dev/sdb1 /mnt/chaindata +df -h +``` + +- `mkdir -p /mnt/chaindata` crée le répertoire de montage (l'option `-p` garantit qu'aucune erreur ne survient si des répertoires intermédiaires sont manquants). +- `mount /dev/sdb1 /mnt/chaindata` monte la partition formatée sur le répertoire. +- `df -h` affiche tous les systèmes de fichiers montés dans un format lisible, vous permettant de confirmer que `/dev/sdb1` est correctement monté sur `/mnt/chaindata` avec la capacité attendue (environ 2 To). + +![Vérification du montage](images/mount_verify.png){.thumbnail} + +Votre disque est maintenant monté, mais la configuration n'est **pas persistante** : si le serveur redémarre, le volume devra être monté manuellement. Pour qu'il soit monté automatiquement au démarrage, ajoutez une entrée dans `/etc/fstab`. + +Récupérez l'**UUID (Universally Unique Identifier)** de votre volume : + +```bash +sudo blkid +``` + +![Sortie blkid](images/blkid_output.png){.thumbnail} + +Cette commande liste tous les périphériques de blocs et leurs attributs associés. Identifiez l'entrée correspondant à votre nouvelle partition (par exemple `/dev/sdb1`) et copiez la valeur de son champ `UUID`. + +Éditez le fichier `/etc/fstab` pour configurer le montage automatique : + +```bash +sudo nano /etc/fstab +``` + +```text +UUID= /mnt/chaindata ext4 nofail 0 0 +``` + +L'option `nofail` permet au système de continuer à démarrer même si le périphérique n'est pas disponible. + +### Étape 2 - Créer un utilisateur dédié + +Créez un **compte utilisateur dédié** pour gérer toutes les opérations du nœud Ethereum. Cette pratique améliore la sécurité en séparant les processus du nœud de l'utilisateur système par défaut. + +```bash +sudo useradd -s /bin/bash -d /home/node_admin/ -m -G sudo node_admin +``` + +- `useradd` crée un nouvel utilisateur nommé `node_admin`, avec un répertoire personnel, un shell bash et l'appartenance au groupe `sudo`. + +Définissez un mot de passe pour le nouvel utilisateur (remplacez par un mot de passe fort ou configurez une connexion par clé) : + +```bash +echo 'node_admin:' | sudo chpasswd +``` + +Configurez l'**authentification SSH par clé** pour le nouvel utilisateur en ajoutant votre clé SSH publique au fichier `authorized_keys`. Remplacez l'espace réservé par votre clé publique réelle : + +```bash +sudo mkdir -p /home/node_admin/.ssh +sudo sh -c "echo '' > /home/node_admin/.ssh/authorized_keys" +``` + +Cela crée le fichier `authorized_keys` sous `/home/node_admin/.ssh/` et y inscrit votre clé publique, permettant une connexion sécurisée sans mot de passe en tant qu'utilisateur `node_admin`. + +### Étape 3 - Installer Nethermind (client d'exécution) + +Nethermind est un client d'exécution Ethereum responsable du traitement des transactions et de la maintenance de l'état Ethereum. + +Ajoutez le dépôt APT officiel de Nethermind : + +```bash +sudo apt-get install software-properties-common -y +sudo add-apt-repository ppa:nethermindeth/nethermind +``` + +![Ajout du dépôt Nethermind](images/nethermind_add_repo.png){.thumbnail} + +Mettez à jour l'index des paquets : + +```bash +sudo apt-get update +``` + +![Mise à jour des paquets](images/nethermind_apt_update.png){.thumbnail} + +Installez Nethermind : + +```bash +sudo apt-get install nethermind -y +``` + +![Installation de Nethermind](images/nethermind_install.png){.thumbnail} + +### Étape 4 - Installer Lighthouse (client de consensus) + +Lighthouse est un client de consensus Ethereum responsable de l'obtention du consensus via le protocole de preuve d'enjeu (proof-of-stake). + +Téléchargez la dernière version stable depuis la [page des releases GitHub de Lighthouse](https://github.com/sigp/lighthouse/releases) : + +```bash +curl -LO https://github.com/sigp/lighthouse/releases/download/v7.1.0/lighthouse-v7.1.0-x86_64-unknown-linux-gnu.tar.gz +``` + +![Téléchargement de Lighthouse](images/lighthouse_download.png){.thumbnail} + +Extrayez l'archive : + +```bash +tar -xvf lighthouse-v7.1.0-x86_64-unknown-linux-gnu.tar.gz +``` + +![Extraction de Lighthouse](images/lighthouse_extract.png){.thumbnail} + +Vérifiez le binaire et déplacez-le vers un emplacement accessible à l'ensemble du système : + +```bash +./lighthouse --version +sudo cp lighthouse /usr/bin +``` + +![Version de Lighthouse](images/lighthouse_version.png){.thumbnail} + +### Étape 5 - Créer le fichier de secret JWT + +Un secret JWT partagé est nécessaire pour la communication sécurisée entre les clients d'exécution et de consensus. + +```bash +sudo mkdir -p /secrets +openssl rand -hex 32 | tr -d "\n" | sudo tee /secrets/jwt.hex > /dev/null +``` + +![Secret JWT créé](images/jwt_secret.png){.thumbnail} + +### Étape 6 - Installer screen pour la persistance des sessions + +Sur un serveur distant, la déconnexion de la session SSH met fin aux processus en cours. `screen` permet de les maintenir en arrière-plan indépendamment de votre session. + +```bash +screen --version +``` + +![Version de screen](images/screen_version.png){.thumbnail} + +Si ce n'est pas déjà installé : + +```bash +sudo apt-get install screen -y +``` + +### Étape 7 - Définir la propriété des répertoires + +Les clients Ethereum ont besoin d'un accès en écriture au répertoire de données. Attribuez la propriété du point de montage à votre utilisateur actuel : + +```bash +sudo chown $USER:$USER /mnt/chaindata +``` + +Cela accorde à votre utilisateur la propriété complète de `/mnt/chaindata`, afin que les clients Ethereum puissent y lire et écrire des données. + +### Étape 8 - Lancer Nethermind + +Créez une session screen et démarrez Nethermind : + +```bash +screen -S nethermind +``` + +```bash +nethermind -c mainnet \ + --data-dir /mnt/chaindata/nethermind \ + --JsonRpc.Enabled true \ + --HealthChecks.Enabled true \ + --HealthChecks.UIEnabled true \ + --JsonRpc.EngineHost=127.0.0.1 \ + --JsonRpc.EnginePort=8551 \ + --JsonRpc.JwtSecretFile=/secrets/jwt.hex +``` + +Des journaux indiquant que le client est en cours d'exécution s'affichent. Le message suivant apparaît ensuite : + +```text +Waiting for Forkchoice message from Consensus Layer +``` + +Cela indique que le client d'exécution attend de se coupler avec le client de consensus. + +![Nethermind en cours d'exécution](images/nethermind_running.png){.thumbnail} + +Détachez la session en appuyant sur `Ctrl+A` puis `D` pour revenir au shell principal. + +Vous pouvez lister les sessions actives avec `screen -ls` et vous y rattacher ultérieurement avec `screen -r nethermind`. + +![Sessions screen](images/screen_list.png){.thumbnail} + +### Étape 9 - Lancer Lighthouse + +Créez une nouvelle session screen et démarrez Lighthouse : + +```bash +screen -S lighthouse +``` + +```bash +lighthouse bn \ + --network mainnet \ + --execution-endpoint http://127.0.0.1:8551 \ + --execution-jwt /secrets/jwt.hex \ + --checkpoint-sync-url https://mainnet.checkpoint.sigp.io \ + --http \ + --datadir /mnt/chaindata/lighthouse +``` + +![Démarrage de Lighthouse](images/lighthouse_start.png){.thumbnail} + +Après la configuration initiale, Lighthouse commence la synchronisation avec le réseau. + +![Synchronisation de Lighthouse](images/lighthouse_syncing.png){.thumbnail} + +Détachez la session en appuyant sur `Ctrl+A` puis `D`. + +### Étape 10 - Vérifier la synchronisation + +À cette étape, le **client d'exécution** (Nethermind) et le **client de consensus** (Lighthouse) doivent être en cours d'exécution dans des sessions screen séparées. Pour confirmer qu'ils sont correctement connectés et que la synchronisation est en cours, rattachez-vous à la session Nethermind et inspectez les journaux : + +```bash +screen -r nethermind +``` + +Si Lighthouse est correctement connecté, le message « Waiting for Forkchoice » disparaît. À la place, des journaux de communication **Engine API** et de traitement de blocs s'affichent : + +```text +Received ForkChoice: ... +Syncing... +``` + +![Synchronisation EL et CL](images/el_cl_sync.png){.thumbnail} + +Ces journaux confirment que Nethermind reçoit les propositions de blocs et les mises à jour de fork choice de Lighthouse, et que le nœud se synchronise avec le réseau principal Ethereum. + +Bien que ce tutoriel se concentre sur le déploiement technique, il est important de compléter la configuration par un renforcement approprié de la sécurité, une supervision et des pratiques de maintenance pour assurer une stabilité à long terme. Avec les bases maintenant en place, vous pouvez étendre les fonctionnalités de votre nœud, l'intégrer dans des infrastructures plus larges ou l'utiliser comme base pour la recherche, le développement et les opérations de staking. + +## Aller plus loin + +- [Ethereum Foundation - Run a node](https://ethereum.org/en/run-a-node/) +- [Documentation Nethermind](https://docs.nethermind.io/) +- [Documentation Lighthouse](https://lighthouse-book.sigmaprime.io/) + +[Créer une instance Public Cloud](/pages/public_cloud/compute/public-cloud-first-steps) + +[Créer et configurer un disque supplémentaire sur une instance](/pages/public_cloud/compute/create_and_configure_an_additional_disk_on_an_instance) + +Échangez avec notre [communauté d'utilisateurs](/links/community). diff --git a/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/guide.it-it.md b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/guide.it-it.md new file mode 100644 index 00000000000..dd50aa75307 --- /dev/null +++ b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/guide.it-it.md @@ -0,0 +1,353 @@ +--- +title: "Eseguire un nodo Ethereum su un'istanza Public Cloud" +excerpt: "Esegui il deploy di un nodo Ethereum completo con Nethermind (EL) e Lighthouse (CL) su un'istanza Public Cloud OVHcloud utilizzando il Block Storage per i dati della blockchain" +updated: 2026-03-12 +--- + +## Obiettivo + +Ethereum è una delle reti blockchain più utilizzate al mondo, alla base di smart contract per la finanza decentralizzata (DeFi) e gli ecosistemi NFT. Gestire un proprio nodo Ethereum consente di interagire direttamente con la rete senza dipendere da servizi di terze parti. + +Un nodo Ethereum completamente funzionale richiede due componenti software principali che operano in coordinazione: + +1. **Execution Client (EL)** — responsabile dell'elaborazione delle transazioni e del mantenimento dello stato di Ethereum. +2. **Consensus Client (CL)** — responsabile del raggiungimento del consenso con il resto della rete tramite il protocollo proof-of-stake di Ethereum. + +Questi due componenti devono funzionare in parallelo e comunicare in modo sicuro per mantenere la sincronizzazione con la mainnet di Ethereum. + +L'ecosistema Ethereum supporta diverse implementazioni client, ciascuna sviluppata in modo indipendente ma conforme alle specifiche di Ethereum. Le opzioni più utilizzate includono: + +**Execution Clients (EL):** + +- Geth +- Nethermind +- Reth +- Besu +- Erigon + +**Consensus Clients (CL):** + +- Lighthouse +- Prysm +- Teku +- Nimbus +- Lodestar + +Per questo tutorial utilizzeremo la seguente combinazione: + +- **Execution Client**: Nethermind +- **Consensus Client**: Lighthouse + +**Questo tutorial ti guiderà nel deploy di un nodo Ethereum completamente funzionale su un'istanza Public Cloud OVHcloud.** + +> [!warning] +> +> Le misure di hardening della sicurezza e le best practice operative necessarie per proteggere completamente un nodo Ethereum vanno oltre lo scopo di questo tutorial. Si raccomanda vivamente di implementare misure di sicurezza aggiuntive, come la configurazione del firewall, la gestione delle chiavi e il monitoraggio, in base ai propri requisiti organizzativi e alle best practice del settore. +> + +## Prerequisiti + +- Un [progetto Public Cloud](/pages/public_cloud/compute/create_a_public_cloud_project) nel tuo account OVHcloud +- Un'[istanza Public Cloud](/pages/public_cloud/compute/public-cloud-first-steps) con almeno 2 vCore e 30 GB di RAM (ad esempio R2-30), con **Ubuntu 24.04 LTS** +- Un [volume Block Storage](/pages/public_cloud/compute/create_and_configure_an_additional_disk_on_an_instance) di almeno 2 TB, di tipo **High-Speed Gen2**, associato all'istanza +- Accesso amministrativo (sudo) all'istanza tramite SSH + +> [!primary] +> +> Secondo la documentazione della Ethereum Foundation, un nodo Ethereum richiede almeno: +> +> - **Execution client**: 2 core CPU, 16 GB di RAM e 1 TB di storage SSD veloce +> - **Consensus client**: 2 core CPU, 8 GB di RAM e accesso allo stesso storage +> +> Per ambienti di produzione e stabilità a lungo termine, si raccomandano specifiche superiori. +> + +## Procedura + +### Passo 1 - Montare il volume Block Storage + +Dopo aver [creato e associato il volume Block Storage](/pages/public_cloud/compute/create_and_configure_an_additional_disk_on_an_instance) all'istanza, connettiti all'istanza tramite SSH: + +```bash +ssh ubuntu@ +``` + +Elenca tutti i dispositivi a blocchi disponibili per identificare il volume associato: + +```bash +lsblk +``` + +![Output lsblk che mostra il volume associato](images/lsblk_output.png){.thumbnail} + +Questo comando visualizza una struttura ad albero di tutti i dispositivi di storage. Identifica il dispositivo (ad esempio `/dev/sdb`) corrispondente al volume da 2 TB. Verrà formattato e montato per archiviare i dati della blockchain Ethereum. + +Crea una partizione sul volume appena associato. Sostituisci `/dev/sdb` con il nome del dispositivo identificato nel passaggio precedente, se diverso: + +```bash +sudo fdisk /dev/sdb +``` + +![Partizionamento con fdisk](images/fdisk_partition.png){.thumbnail} + +Questo comando apre l'utilità di partizionamento per il dispositivo a blocchi selezionato. Crea una nuova partizione primaria che occupi l'intero disco, quindi salva le modifiche. Una volta completata l'operazione, la partizione sarà generalmente disponibile come `/dev/sdb1`. + +Formatta la nuova partizione con il filesystem ext4, una scelta stabile e ampiamente supportata per l'archiviazione dei dati della blockchain Ethereum: + +```bash +sudo mkfs.ext4 /dev/sdb1 +``` + +![Formattazione ext4](images/mkfs_ext4.png){.thumbnail} + +Crea una directory dedicata come punto di montaggio per il volume formattato, quindi montalo e verifica che sia stato correttamente associato al filesystem: + +```bash +sudo mkdir -p /mnt/chaindata +sudo mount /dev/sdb1 /mnt/chaindata +df -h +``` + +- `mkdir -p /mnt/chaindata` crea la directory di montaggio (l'opzione `-p` garantisce che non venga generato un errore in caso di directory intermedie mancanti). +- `mount /dev/sdb1 /mnt/chaindata` monta la partizione formattata nella directory. +- `df -h` visualizza tutti i filesystem montati in un formato leggibile, consentendo di confermare che `/dev/sdb1` è correttamente montato in `/mnt/chaindata` con la capacità prevista (circa 2 TB). + +![Verifica del montaggio](images/mount_verify.png){.thumbnail} + +Il disco è ora montato, ma la configurazione **non è persistente**: se il server viene riavviato, il volume dovrà essere montato manualmente. Per configurare il montaggio automatico all'avvio, aggiungi una voce in `/etc/fstab`. + +Recupera l'**UUID (Universally Unique Identifier)** del volume: + +```bash +sudo blkid +``` + +![Output blkid](images/blkid_output.png){.thumbnail} + +Questo comando elenca tutti i dispositivi a blocchi e i relativi attributi. Identifica la voce corrispondente alla nuova partizione (ad esempio `/dev/sdb1`) e copia il valore del campo `UUID`. + +Modifica il file `/etc/fstab` per configurare il montaggio automatico: + +```bash +sudo nano /etc/fstab +``` + +```text +UUID= /mnt/chaindata ext4 nofail 0 0 +``` + +L'opzione `nofail` consente al sistema di proseguire l'avvio anche se il dispositivo non è disponibile. + +### Passo 2 - Creare un utente dedicato + +Crea un **account utente dedicato** per gestire tutte le operazioni del nodo Ethereum. Questa pratica migliora la sicurezza separando i processi del nodo dall'utente di sistema predefinito. + +```bash +sudo useradd -s /bin/bash -d /home/node_admin/ -m -G sudo node_admin +``` + +- `useradd` crea un nuovo utente denominato `node_admin`, con una directory home, la shell bash e l'appartenenza al gruppo `sudo`. + +Imposta una password per il nuovo utente (sostituisci con una password complessa o configura l'accesso tramite chiave): + +```bash +echo 'node_admin:' | sudo chpasswd +``` + +Configura l'**autenticazione tramite chiave SSH** per il nuovo utente aggiungendo la chiave SSH pubblica al file `authorized_keys`. Sostituisci il segnaposto con la tua chiave pubblica effettiva: + +```bash +sudo mkdir -p /home/node_admin/.ssh +sudo sh -c "echo '' > /home/node_admin/.ssh/authorized_keys" +``` + +Questo crea il file `authorized_keys` nella directory `/home/node_admin/.ssh/` e vi inserisce la chiave pubblica, consentendo un accesso sicuro e senza password come utente `node_admin`. + +### Passo 3 - Installare Nethermind (Execution Client) + +Nethermind è un execution client Ethereum responsabile dell'elaborazione delle transazioni e del mantenimento dello stato di Ethereum. + +Aggiungi il repository APT ufficiale di Nethermind: + +```bash +sudo apt-get install software-properties-common -y +sudo add-apt-repository ppa:nethermindeth/nethermind +``` + +![Aggiunta del repository Nethermind](images/nethermind_add_repo.png){.thumbnail} + +Aggiorna l'indice dei pacchetti: + +```bash +sudo apt-get update +``` + +![Aggiornamento dei pacchetti](images/nethermind_apt_update.png){.thumbnail} + +Installa Nethermind: + +```bash +sudo apt-get install nethermind -y +``` + +![Installazione di Nethermind](images/nethermind_install.png){.thumbnail} + +### Passo 4 - Installare Lighthouse (Consensus Client) + +Lighthouse è un consensus client Ethereum responsabile del raggiungimento del consenso tramite il protocollo proof-of-stake. + +Scarica l'ultima versione stabile dalla [pagina delle release di Lighthouse su GitHub](https://github.com/sigp/lighthouse/releases): + +```bash +curl -LO https://github.com/sigp/lighthouse/releases/download/v7.1.0/lighthouse-v7.1.0-x86_64-unknown-linux-gnu.tar.gz +``` + +![Download di Lighthouse](images/lighthouse_download.png){.thumbnail} + +Estrai l'archivio: + +```bash +tar -xvf lighthouse-v7.1.0-x86_64-unknown-linux-gnu.tar.gz +``` + +![Estrazione di Lighthouse](images/lighthouse_extract.png){.thumbnail} + +Verifica il binario e spostalo in una posizione accessibile a livello di sistema: + +```bash +./lighthouse --version +sudo cp lighthouse /usr/bin +``` + +![Versione di Lighthouse](images/lighthouse_version.png){.thumbnail} + +### Passo 5 - Creare il file JWT secret + +Un segreto JWT condiviso è necessario per la comunicazione sicura tra l'execution client e il consensus client. + +```bash +sudo mkdir -p /secrets +openssl rand -hex 32 | tr -d "\n" | sudo tee /secrets/jwt.hex > /dev/null +``` + +![JWT secret creato](images/jwt_secret.png){.thumbnail} + +### Passo 6 - Installare screen per la persistenza delle sessioni + +Su un server remoto, la disconnessione dalla sessione SSH termina i processi in esecuzione. `screen` consente di mantenerli attivi in background, indipendentemente dalla sessione. + +```bash +screen --version +``` + +![Versione di screen](images/screen_version.png){.thumbnail} + +Se non è già installato: + +```bash +sudo apt-get install screen -y +``` + +### Passo 7 - Impostare la proprietà delle directory + +I client Ethereum necessitano di accesso in scrittura alla directory dei dati. Assegna la proprietà del punto di montaggio al tuo utente corrente: + +```bash +sudo chown $USER:$USER /mnt/chaindata +``` + +Questo comando assegna al tuo utente la piena proprietà di `/mnt/chaindata`, in modo che i client Ethereum possano leggere e scrivere dati al suo interno. + +### Passo 8 - Avviare Nethermind + +Crea una sessione screen e avvia Nethermind: + +```bash +screen -S nethermind +``` + +```bash +nethermind -c mainnet \ + --data-dir /mnt/chaindata/nethermind \ + --JsonRpc.Enabled true \ + --HealthChecks.Enabled true \ + --HealthChecks.UIEnabled true \ + --JsonRpc.EngineHost=127.0.0.1 \ + --JsonRpc.EnginePort=8551 \ + --JsonRpc.JwtSecretFile=/secrets/jwt.hex +``` + +Dovresti visualizzare dei log che indicano che il client è in esecuzione. Alla fine, apparirà il seguente messaggio: + +```text +Waiting for Forkchoice message from Consensus Layer +``` + +Questo indica che l'execution client è in attesa di collegarsi al consensus client. + +![Nethermind in esecuzione](images/nethermind_running.png){.thumbnail} + +Disconnetti la sessione premendo `Ctrl+A` e poi `D` per tornare alla shell principale. + +Puoi elencare le sessioni attive con `screen -ls` e ricollegarti successivamente con `screen -r nethermind`. + +![Sessioni screen](images/screen_list.png){.thumbnail} + +### Passo 9 - Avviare Lighthouse + +Crea una nuova sessione screen e avvia Lighthouse: + +```bash +screen -S lighthouse +``` + +```bash +lighthouse bn \ + --network mainnet \ + --execution-endpoint http://127.0.0.1:8551 \ + --execution-jwt /secrets/jwt.hex \ + --checkpoint-sync-url https://mainnet.checkpoint.sigp.io \ + --http \ + --datadir /mnt/chaindata/lighthouse +``` + +![Avvio di Lighthouse](images/lighthouse_start.png){.thumbnail} + +Dopo la configurazione iniziale, Lighthouse dovrebbe iniziare la sincronizzazione con la rete. + +![Sincronizzazione di Lighthouse](images/lighthouse_syncing.png){.thumbnail} + +Disconnetti la sessione premendo `Ctrl+A` e poi `D`. + +### Passo 10 - Verificare la sincronizzazione + +A questo punto, sia l'**execution client** (Nethermind) che il **consensus client** (Lighthouse) dovrebbero essere in esecuzione in sessioni screen separate. Per verificare che siano correttamente collegati e che la sincronizzazione sia in corso, ricollegati alla sessione Nethermind e ispeziona i log: + +```bash +screen -r nethermind +``` + +Se Lighthouse è collegato correttamente, il messaggio "Waiting for Forkchoice" dovrebbe scomparire. Al suo posto, dovresti visualizzare i log di comunicazione dell'**Engine API** e dell'elaborazione dei blocchi: + +```text +Received ForkChoice: ... +Syncing... +``` + +![Sincronizzazione EL e CL](images/el_cl_sync.png){.thumbnail} + +Questi log confermano che Nethermind sta ricevendo le proposte di blocco e gli aggiornamenti di fork choice da Lighthouse, e che il nodo è in fase di sincronizzazione con la mainnet di Ethereum. + +Sebbene questo tutorial si sia concentrato sul deploy tecnico, è importante completare la configurazione con adeguate misure di hardening della sicurezza, monitoraggio e manutenzione per garantire la stabilità a lungo termine. Con le basi ora in atto, è possibile estendere le funzionalità del nodo, integrarlo in infrastrutture più ampie o utilizzarlo come base per attività di ricerca, sviluppo e staking. + +## Per saperne di più + +- [Ethereum Foundation - Run a node](https://ethereum.org/en/run-a-node/) +- [Documentazione Nethermind](https://docs.nethermind.io/) +- [Documentazione Lighthouse](https://lighthouse-book.sigmaprime.io/) + +[Creare un'istanza Public Cloud](/pages/public_cloud/compute/public-cloud-first-steps) + +[Creare e configurare un disco aggiuntivo su un'istanza](/pages/public_cloud/compute/create_and_configure_an_additional_disk_on_an_instance) + +Contatta la nostra [Community di utenti](/links/community). diff --git a/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/guide.pl-pl.md b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/guide.pl-pl.md new file mode 100644 index 00000000000..6e9d5911bad --- /dev/null +++ b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/guide.pl-pl.md @@ -0,0 +1,353 @@ +--- +title: 'Uruchomienie węzła Ethereum na instancji Public Cloud' +excerpt: 'Wdrożenie pełnego węzła Ethereum z Nethermind (EL) i Lighthouse (CL) na instancji OVHcloud Public Cloud z wykorzystaniem block storage do przechowywania danych łańcucha bloków' +updated: 2026-03-12 +--- + +## Wprowadzenie + +Ethereum jest jedną z najszerzej wykorzystywanych sieci blockchain, obsługującą inteligentne kontrakty dla zdecentralizowanych finansów (DeFi) oraz ekosystemów NFT. Prowadzenie własnego węzła Ethereum pozwala na bezpośrednią interakcję z siecią bez polegania na usługach podmiotów trzecich. + +W pełni funkcjonalny węzeł Ethereum wymaga dwóch kluczowych komponentów oprogramowania działających w koordynacji: + +1. **Klient warstwy wykonawczej (EL)** — odpowiedzialny za przetwarzanie transakcji i utrzymanie stanu Ethereum. +2. **Klient warstwy konsensusu (CL)** — odpowiedzialny za osiąganie konsensusu z resztą sieci poprzez protokół proof-of-stake Ethereum. + +Te dwa komponenty muszą działać równolegle i komunikować się w bezpieczny sposób, aby utrzymać synchronizację z siecią główną Ethereum (mainnet). + +Ekosystem Ethereum obsługuje wiele implementacji klientów, z których każda jest rozwijana niezależnie, ale zgodnie ze specyfikacją Ethereum. Najczęściej używane opcje to: + +**Klienty warstwy wykonawczej (EL):** + +- Geth +- Nethermind +- Reth +- Besu +- Erigon + +**Klienty warstwy konsensusu (CL):** + +- Lighthouse +- Prysm +- Teku +- Nimbus +- Lodestar + +W tym tutorialu użyjemy następującej kombinacji: + +- **Klient warstwy wykonawczej**: Nethermind +- **Klient warstwy konsensusu**: Lighthouse + +**Ten tutorial przeprowadzi Cię przez proces wdrażania w pełni funkcjonalnego węzła Ethereum na instancji OVHcloud Public Cloud.** + +> [!warning] +> +> Zabezpieczanie systemu oraz najlepsze praktyki operacyjne wymagane do pełnej ochrony węzła Ethereum wykraczają poza zakres tego tutorialu. Zdecydowanie zaleca się wdrożenie dodatkowych środków bezpieczeństwa — takich jak konfiguracja zapory sieciowej, zarządzanie kluczami i monitoring — zgodnie z wymaganiami Twojej organizacji i najlepszymi praktykami branżowymi. +> + +## Wymagania początkowe + +- [Projekt Public Cloud](/pages/public_cloud/compute/create_a_public_cloud_project) na Twoim koncie OVHcloud +- [Instancja Public Cloud](/pages/public_cloud/compute/public-cloud-first-steps) z co najmniej 2 rdzeniami vCPU i 30 GB pamięci RAM (np. R2-30), z systemem **Ubuntu 24.04 LTS** +- [Wolumen Block Storage](/pages/public_cloud/compute/create_and_configure_an_additional_disk_on_an_instance) o pojemności co najmniej 2 TB, typu **High-Speed Gen2**, podłączony do Twojej instancji +- Dostęp administracyjny (sudo) do instancji przez SSH + +> [!primary] +> +> Zgodnie z dokumentacją Ethereum Foundation węzeł Ethereum wymaga co najmniej: +> +> - **Klient warstwy wykonawczej**: 2 rdzenie CPU, 16 GB pamięci RAM i 1 TB szybkiej pamięci masowej SSD +> - **Klient warstwy konsensusu**: 2 rdzenie CPU, 8 GB pamięci RAM i dostęp do tej samej pamięci masowej +> +> W środowiskach produkcyjnych i w celu zapewnienia długoterminowej stabilności zdecydowanie zaleca się wyższe parametry. +> + +## W praktyce + +### Krok 1 — Zamontowanie wolumenu Block Storage + +Po [utworzeniu i podłączeniu wolumenu Block Storage](/pages/public_cloud/compute/create_and_configure_an_additional_disk_on_an_instance) do instancji połącz się z instancją przez SSH: + +```bash +ssh ubuntu@ +``` + +Wyświetl listę wszystkich dostępnych urządzeń blokowych, aby zidentyfikować podłączony wolumen: + +```bash +lsblk +``` + +![Wyjście polecenia lsblk pokazujące podłączony wolumen](images/lsblk_output.png){.thumbnail} + +Polecenie wyświetla widok drzewa wszystkich urządzeń pamięci masowej. Zidentyfikuj urządzenie (np. `/dev/sdb`), które odpowiada Twojemu wolumenowi o pojemności 2 TB. Zostanie ono sformatowane i zamontowane w celu przechowywania danych łańcucha bloków Ethereum. + +Utwórz partycję na nowo podłączonym wolumenie. Zastąp `/dev/sdb` nazwą urządzenia zidentyfikowanego w poprzednim kroku, jeśli jest inna: + +```bash +sudo fdisk /dev/sdb +``` + +![Partycjonowanie za pomocą fdisk](images/fdisk_partition.png){.thumbnail} + +Polecenie otwiera narzędzie do partycjonowania dla wybranego urządzenia blokowego. Utwórz nową partycję podstawową obejmującą cały dysk, a następnie zapisz zmiany. Po zakończeniu partycja będzie zwykle dostępna jako `/dev/sdb1`. + +Sformatuj nową partycję za pomocą systemu plików ext4, który jest stabilnym i szeroko obsługiwanym wyborem do przechowywania danych łańcucha bloków Ethereum: + +```bash +sudo mkfs.ext4 /dev/sdb1 +``` + +![Formatowanie ext4](images/mkfs_ext4.png){.thumbnail} + +Utwórz dedykowany katalog jako punkt montowania sformatowanego wolumenu, a następnie zamontuj go i sprawdź, czy został pomyślnie podłączony do systemu plików: + +```bash +sudo mkdir -p /mnt/chaindata +sudo mount /dev/sdb1 /mnt/chaindata +df -h +``` + +- `mkdir -p /mnt/chaindata` tworzy katalog montowania (opcja `-p` zapobiega błędowi w przypadku braku katalogów pośrednich). +- `mount /dev/sdb1 /mnt/chaindata` montuje sformatowaną partycję w katalogu. +- `df -h` wyświetla wszystkie zamontowane systemy plików w czytelnym formacie, pozwalając potwierdzić, że `/dev/sdb1` jest prawidłowo zamontowany w `/mnt/chaindata` z oczekiwaną pojemnością (około 2 TB). + +![Weryfikacja montowania](images/mount_verify.png){.thumbnail} + +Dysk jest teraz zamontowany, ale konfiguracja **nie jest trwała**: po ponownym uruchomieniu serwera wolumen będzie wymagał ręcznego zamontowania. Aby zapewnić automatyczne montowanie przy starcie systemu, dodaj wpis do pliku `/etc/fstab`. + +Pobierz **UUID (Universally Unique Identifier)** wolumenu: + +```bash +sudo blkid +``` + +![Wyjście polecenia blkid](images/blkid_output.png){.thumbnail} + +Polecenie wyświetla listę wszystkich urządzeń blokowych i ich atrybutów. Zidentyfikuj wpis odpowiadający Twojej nowej partycji (np. `/dev/sdb1`) i skopiuj wartość pola `UUID`. + +Edytuj plik `/etc/fstab`, aby skonfigurować automatyczne montowanie: + +```bash +sudo nano /etc/fstab +``` + +```text +UUID= /mnt/chaindata ext4 nofail 0 0 +``` + +Opcja `nofail` pozwala systemowi kontynuować rozruch nawet w przypadku niedostępności urządzenia. + +### Krok 2 — Utworzenie dedykowanego użytkownika + +Utwórz **dedykowane konto użytkownika** do zarządzania wszystkimi operacjami węzła Ethereum. Ta praktyka poprawia bezpieczeństwo, oddzielając procesy węzła od domyślnego użytkownika systemowego. + +```bash +sudo useradd -s /bin/bash -d /home/node_admin/ -m -G sudo node_admin +``` + +- `useradd` tworzy nowego użytkownika o nazwie `node_admin` z katalogiem domowym, powłoką bash i przynależnością do grupy `sudo`. + +Ustaw hasło dla nowego użytkownika (zastąp silnym hasłem lub skonfiguruj logowanie za pomocą klucza): + +```bash +echo 'node_admin:' | sudo chpasswd +``` + +Skonfiguruj **uwierzytelnianie za pomocą kluczy SSH** dla nowego użytkownika, dodając swój publiczny klucz SSH do pliku `authorized_keys`. Zastąp symbol zastępczy swoim rzeczywistym kluczem publicznym: + +```bash +sudo mkdir -p /home/node_admin/.ssh +sudo sh -c "echo '' > /home/node_admin/.ssh/authorized_keys" +``` + +Polecenie tworzy plik `authorized_keys` w katalogu `/home/node_admin/.ssh/` i zapisuje w nim Twój klucz publiczny, umożliwiając bezpieczne logowanie bez hasła jako użytkownik `node_admin`. + +### Krok 3 — Instalacja Nethermind (klient warstwy wykonawczej) + +Nethermind to klient warstwy wykonawczej Ethereum odpowiedzialny za przetwarzanie transakcji i utrzymanie stanu Ethereum. + +Dodaj oficjalne repozytorium APT Nethermind: + +```bash +sudo apt-get install software-properties-common -y +sudo add-apt-repository ppa:nethermindeth/nethermind +``` + +![Dodawanie repozytorium Nethermind](images/nethermind_add_repo.png){.thumbnail} + +Zaktualizuj indeks pakietów: + +```bash +sudo apt-get update +``` + +![Aktualizacja pakietów](images/nethermind_apt_update.png){.thumbnail} + +Zainstaluj Nethermind: + +```bash +sudo apt-get install nethermind -y +``` + +![Instalacja Nethermind](images/nethermind_install.png){.thumbnail} + +### Krok 4 — Instalacja Lighthouse (klient warstwy konsensusu) + +Lighthouse to klient warstwy konsensusu Ethereum odpowiedzialny za osiąganie konsensusu poprzez protokół proof-of-stake. + +Pobierz najnowszą stabilną wersję ze [strony wydań Lighthouse na GitHubie](https://github.com/sigp/lighthouse/releases): + +```bash +curl -LO https://github.com/sigp/lighthouse/releases/download/v7.1.0/lighthouse-v7.1.0-x86_64-unknown-linux-gnu.tar.gz +``` + +![Pobieranie Lighthouse](images/lighthouse_download.png){.thumbnail} + +Rozpakuj archiwum: + +```bash +tar -xvf lighthouse-v7.1.0-x86_64-unknown-linux-gnu.tar.gz +``` + +![Rozpakowywanie Lighthouse](images/lighthouse_extract.png){.thumbnail} + +Zweryfikuj plik binarny i przenieś go do lokalizacji systemowej: + +```bash +./lighthouse --version +sudo cp lighthouse /usr/bin +``` + +![Wersja Lighthouse](images/lighthouse_version.png){.thumbnail} + +### Krok 5 — Utworzenie pliku sekretu JWT + +Współdzielony sekret JWT jest wymagany do bezpiecznej komunikacji między klientem warstwy wykonawczej a klientem warstwy konsensusu. + +```bash +sudo mkdir -p /secrets +openssl rand -hex 32 | tr -d "\n" | sudo tee /secrets/jwt.hex > /dev/null +``` + +![Utworzono sekret JWT](images/jwt_secret.png){.thumbnail} + +### Krok 6 — Instalacja screen w celu utrzymania sesji + +Na serwerze zdalnym rozłączenie sesji SSH powoduje zakończenie uruchomionych procesów. Narzędzie `screen` utrzymuje je w tle niezależnie od Twojej sesji. + +```bash +screen --version +``` + +![Wersja screen](images/screen_version.png){.thumbnail} + +Jeśli narzędzie nie jest jeszcze zainstalowane: + +```bash +sudo apt-get install screen -y +``` + +### Krok 7 — Ustawienie własności katalogów + +Klienty Ethereum potrzebują uprawnień do zapisu w katalogu danych. Przypisz własność punktu montowania do bieżącego użytkownika: + +```bash +sudo chown $USER:$USER /mnt/chaindata +``` + +Polecenie nadaje Twojemu użytkownikowi pełną własność katalogu `/mnt/chaindata`, dzięki czemu klienty Ethereum mogą odczytywać i zapisywać w nim dane. + +### Krok 8 — Uruchomienie Nethermind + +Utwórz sesję screen i uruchom Nethermind: + +```bash +screen -S nethermind +``` + +```bash +nethermind -c mainnet \ + --data-dir /mnt/chaindata/nethermind \ + --JsonRpc.Enabled true \ + --HealthChecks.Enabled true \ + --HealthChecks.UIEnabled true \ + --JsonRpc.EngineHost=127.0.0.1 \ + --JsonRpc.EnginePort=8551 \ + --JsonRpc.JwtSecretFile=/secrets/jwt.hex +``` + +W logach powinny pojawić się informacje o działaniu klienta. Ostatecznie wyświetli się następujący komunikat: + +```text +Waiting for Forkchoice message from Consensus Layer +``` + +Oznacza to, że klient warstwy wykonawczej oczekuje na połączenie z klientem warstwy konsensusu. + +![Uruchomiony Nethermind](images/nethermind_running.png){.thumbnail} + +Odłącz sesję, naciskając `Ctrl+A`, a następnie `D`, aby wrócić do głównej powłoki. + +Możesz wyświetlić listę aktywnych sesji za pomocą `screen -ls` i podłączyć się ponownie za pomocą `screen -r nethermind`. + +![Sesje screen](images/screen_list.png){.thumbnail} + +### Krok 9 — Uruchomienie Lighthouse + +Utwórz nową sesję screen i uruchom Lighthouse: + +```bash +screen -S lighthouse +``` + +```bash +lighthouse bn \ + --network mainnet \ + --execution-endpoint http://127.0.0.1:8551 \ + --execution-jwt /secrets/jwt.hex \ + --checkpoint-sync-url https://mainnet.checkpoint.sigp.io \ + --http \ + --datadir /mnt/chaindata/lighthouse +``` + +![Uruchamianie Lighthouse](images/lighthouse_start.png){.thumbnail} + +Po wstępnej konfiguracji Lighthouse powinien rozpocząć synchronizację z siecią. + +![Synchronizacja Lighthouse](images/lighthouse_syncing.png){.thumbnail} + +Odłącz sesję, naciskając `Ctrl+A`, a następnie `D`. + +### Krok 10 — Weryfikacja synchronizacji + +Na tym etapie zarówno **klient warstwy wykonawczej** (Nethermind), jak i **klient warstwy konsensusu** (Lighthouse) powinny działać w oddzielnych sesjach screen. Aby potwierdzić, że są prawidłowo połączone i synchronizacja jest w toku, podłącz się ponownie do sesji Nethermind i sprawdź logi: + +```bash +screen -r nethermind +``` + +Jeśli Lighthouse jest prawidłowo połączony, komunikat "Waiting for Forkchoice" powinien zniknąć. Zamiast niego powinny pojawić się logi komunikacji **Engine API** oraz przetwarzania bloków: + +```text +Received ForkChoice: ... +Syncing... +``` + +![Synchronizacja EL i CL](images/el_cl_sync.png){.thumbnail} + +Logi te potwierdzają, że Nethermind otrzymuje propozycje bloków i aktualizacje fork choice od Lighthouse oraz że węzeł synchronizuje się z siecią główną Ethereum. + +Chociaż ten tutorial skupił się na technicznym wdrożeniu, ważne jest uzupełnienie konfiguracji o odpowiednie zabezpieczenia systemu, monitoring i praktyki konserwacyjne w celu zapewnienia długoterminowej stabilności. Mając teraz podstawy, możesz rozszerzyć funkcjonalność swojego węzła, zintegrować go z większymi infrastrukturami lub wykorzystać jako bazę do badań, rozwoju i operacji stakingowych. + +## Sprawdź również + +- [Ethereum Foundation - Run a node](https://ethereum.org/en/run-a-node/) +- [Dokumentacja Nethermind](https://docs.nethermind.io/) +- [Dokumentacja Lighthouse](https://lighthouse-book.sigmaprime.io/) + +[Tworzenie instancji Public Cloud](/pages/public_cloud/compute/public-cloud-first-steps) + +[Tworzenie i konfiguracja dodatkowego dysku na instancji](/pages/public_cloud/compute/create_and_configure_an_additional_disk_on_an_instance) + +Dołącz do [grona naszych użytkowników](/links/community). diff --git a/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/guide.pt-pt.md b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/guide.pt-pt.md new file mode 100644 index 00000000000..ea232d0d6c4 --- /dev/null +++ b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/guide.pt-pt.md @@ -0,0 +1,353 @@ +--- +title: 'Executar um nó Ethereum numa instância Public Cloud' +excerpt: 'Implemente um nó Ethereum completo com Nethermind (EL) e Lighthouse (CL) numa instância Public Cloud da OVHcloud, utilizando block storage para os dados da blockchain' +updated: 2026-03-12 +--- + +## Objetivo + +O Ethereum é uma das redes blockchain mais utilizadas, alimentando contratos inteligentes para ecossistemas de finanças descentralizadas (DeFi) e NFT. Operar o seu próprio nó Ethereum permite-lhe interagir diretamente com a rede sem depender de serviços de terceiros. + +Um nó Ethereum totalmente funcional requer dois componentes de software principais a funcionar de forma coordenada: + +1. **Execution Client (EL)** — responsável pelo processamento das transações e pela manutenção do estado do Ethereum. +2. **Consensus Client (CL)** — responsável por alcançar o consenso com o resto da rede através do protocolo proof-of-stake do Ethereum. + +Estes dois componentes devem funcionar em conjunto e comunicar de forma segura para manter a sincronização com a mainnet do Ethereum. + +O ecossistema Ethereum suporta múltiplas implementações de clientes, cada uma desenvolvida de forma independente, mas em conformidade com a especificação Ethereum. As opções mais utilizadas incluem: + +**Execution Clients (EL):** + +- Geth +- Nethermind +- Reth +- Besu +- Erigon + +**Consensus Clients (CL):** + +- Lighthouse +- Prysm +- Teku +- Nimbus +- Lodestar + +Neste tutorial, utilizaremos a seguinte combinação: + +- **Execution Client**: Nethermind +- **Consensus Client**: Lighthouse + +**Este tutorial irá guiá-lo na implementação de um nó Ethereum totalmente funcional numa instância Public Cloud da OVHcloud.** + +> [!warning] +> +> As medidas de reforço da segurança e as boas práticas operacionais necessárias para proteger completamente um nó Ethereum estão fora do âmbito deste tutorial. É fortemente aconselhado implementar medidas de segurança adicionais — como configuração de firewall, gestão de chaves e monitorização — de acordo com os requisitos da sua organização e as boas práticas do setor. +> + +## Requisitos + +- Um [projeto Public Cloud](/pages/public_cloud/compute/create_a_public_cloud_project) na sua conta OVHcloud +- Uma [instância Public Cloud](/pages/public_cloud/compute/public-cloud-first-steps) com pelo menos 2 vCores e 30 GB de RAM (por exemplo, R2-30), a executar **Ubuntu 24.04 LTS** +- Um [volume Block Storage](/pages/public_cloud/compute/create_and_configure_an_additional_disk_on_an_instance) de pelo menos 2 TB, utilizando o tipo **High-Speed Gen2**, associado à sua instância +- Acesso administrativo (sudo) à instância via SSH + +> [!primary] +> +> De acordo com a documentação da Ethereum Foundation, um nó Ethereum requer no mínimo: +> +> - **Execution client**: 2 cores de CPU, 16 GB de RAM e 1 TB de armazenamento SSD rápido +> - **Consensus client**: 2 cores de CPU, 8 GB de RAM e acesso ao mesmo armazenamento +> +> Para ambientes de produção e estabilidade a longo prazo, são fortemente recomendadas especificações superiores. +> + +## Instruções + +### Etapa 1 - Montar o volume Block Storage + +Depois de ter [criado e associado o seu volume Block Storage](/pages/public_cloud/compute/create_and_configure_an_additional_disk_on_an_instance) à instância, ligue-se à sua instância via SSH: + +```bash +ssh ubuntu@ +``` + +Liste todos os dispositivos de bloco disponíveis para identificar o volume associado: + +```bash +lsblk +``` + +![Saída do lsblk mostrando o volume associado](images/lsblk_output.png){.thumbnail} + +Isto apresenta uma vista em árvore de todos os dispositivos de armazenamento. Identifique o dispositivo (por exemplo, `/dev/sdb`) que corresponde ao seu volume de 2 TB. Este será formatado e montado para armazenar os dados da blockchain Ethereum. + +Crie uma partição no volume recentemente associado. Substitua `/dev/sdb` pelo nome do dispositivo identificado na etapa anterior, caso seja diferente: + +```bash +sudo fdisk /dev/sdb +``` + +![Particionamento com fdisk](images/fdisk_partition.png){.thumbnail} + +Isto abre o utilitário de particionamento para o dispositivo de bloco selecionado. Crie uma nova partição primária que ocupe todo o disco e, em seguida, grave as alterações. Uma vez concluído, a partição estará normalmente disponível como `/dev/sdb1`. + +Formate a nova partição com o sistema de ficheiros ext4, que é uma escolha estável e amplamente suportada para armazenar dados da blockchain Ethereum: + +```bash +sudo mkfs.ext4 /dev/sdb1 +``` + +![Formatação ext4](images/mkfs_ext4.png){.thumbnail} + +Crie um diretório dedicado para servir como ponto de montagem para o volume formatado e, em seguida, monte-o e verifique se foi corretamente associado ao sistema de ficheiros: + +```bash +sudo mkdir -p /mnt/chaindata +sudo mount /dev/sdb1 /mnt/chaindata +df -h +``` + +- `mkdir -p /mnt/chaindata` cria o diretório de montagem (utilizando `-p` para garantir que não ocorre erro se os diretórios intermédios não existirem). +- `mount /dev/sdb1 /mnt/chaindata` monta a partição formatada no diretório. +- `df -h` apresenta todos os sistemas de ficheiros montados num formato legível, permitindo-lhe confirmar que `/dev/sdb1` está corretamente montado em `/mnt/chaindata` com a capacidade esperada (aproximadamente 2 TB). + +![Verificar montagem](images/mount_verify.png){.thumbnail} + +O seu disco está agora montado, mas a configuração **não é persistente**: se o servidor reiniciar, o volume terá de ser montado manualmente. Para que seja montado automaticamente no arranque, adicione uma entrada ao ficheiro `/etc/fstab`. + +Obtenha o **UUID (Universally Unique Identifier)** do seu volume: + +```bash +sudo blkid +``` + +![Saída do blkid](images/blkid_output.png){.thumbnail} + +Este comando lista todos os dispositivos de bloco e os respetivos atributos associados. Identifique a entrada correspondente à sua nova partição (por exemplo, `/dev/sdb1`) e copie o valor do campo `UUID`. + +Edite o ficheiro `/etc/fstab` para configurar a montagem automática: + +```bash +sudo nano /etc/fstab +``` + +```text +UUID= /mnt/chaindata ext4 nofail 0 0 +``` + +A opção `nofail` permite que o sistema continue o arranque mesmo que o dispositivo não esteja disponível. + +### Etapa 2 - Criar um utilizador dedicado + +Crie uma **conta de utilizador dedicada** para gerir todas as operações do nó Ethereum. Esta prática melhora a segurança ao separar os processos do nó do utilizador predefinido do sistema. + +```bash +sudo useradd -s /bin/bash -d /home/node_admin/ -m -G sudo node_admin +``` + +- `useradd` cria um novo utilizador chamado `node_admin`, com um diretório pessoal, shell bash e pertença ao grupo `sudo`. + +Defina uma palavra-passe para o novo utilizador (substitua por uma palavra-passe forte ou configure a autenticação por chave): + +```bash +echo 'node_admin:' | sudo chpasswd +``` + +Configure a **autenticação SSH por chave** para o novo utilizador, adicionando a sua chave pública SSH ao ficheiro `authorized_keys`. Substitua o marcador de posição pela sua chave pública real: + +```bash +sudo mkdir -p /home/node_admin/.ssh +sudo sh -c "echo '' > /home/node_admin/.ssh/authorized_keys" +``` + +Isto cria o ficheiro `authorized_keys` em `/home/node_admin/.ssh/` e insere a sua chave pública, permitindo o início de sessão seguro e sem palavra-passe como utilizador `node_admin`. + +### Etapa 3 - Instalar o Nethermind (Execution Client) + +O Nethermind é um execution client Ethereum responsável pelo processamento das transações e pela manutenção do estado do Ethereum. + +Adicione o repositório APT oficial do Nethermind: + +```bash +sudo apt-get install software-properties-common -y +sudo add-apt-repository ppa:nethermindeth/nethermind +``` + +![Adicionar repositório Nethermind](images/nethermind_add_repo.png){.thumbnail} + +Atualize o índice de pacotes: + +```bash +sudo apt-get update +``` + +![Atualizar pacotes](images/nethermind_apt_update.png){.thumbnail} + +Instale o Nethermind: + +```bash +sudo apt-get install nethermind -y +``` + +![Instalar Nethermind](images/nethermind_install.png){.thumbnail} + +### Etapa 4 - Instalar o Lighthouse (Consensus Client) + +O Lighthouse é um consensus client Ethereum responsável por alcançar o consenso através do protocolo proof-of-stake. + +Transfira a versão estável mais recente a partir da [página de releases do Lighthouse no GitHub](https://github.com/sigp/lighthouse/releases): + +```bash +curl -LO https://github.com/sigp/lighthouse/releases/download/v7.1.0/lighthouse-v7.1.0-x86_64-unknown-linux-gnu.tar.gz +``` + +![Transferir Lighthouse](images/lighthouse_download.png){.thumbnail} + +Extraia o arquivo: + +```bash +tar -xvf lighthouse-v7.1.0-x86_64-unknown-linux-gnu.tar.gz +``` + +![Extrair Lighthouse](images/lighthouse_extract.png){.thumbnail} + +Verifique o binário e mova-o para uma localização acessível a todo o sistema: + +```bash +./lighthouse --version +sudo cp lighthouse /usr/bin +``` + +![Versão do Lighthouse](images/lighthouse_version.png){.thumbnail} + +### Etapa 5 - Criar o ficheiro de segredo JWT + +Um segredo JWT partilhado é necessário para a comunicação segura entre os clientes de execução e de consenso. + +```bash +sudo mkdir -p /secrets +openssl rand -hex 32 | tr -d "\n" | sudo tee /secrets/jwt.hex > /dev/null +``` + +![Segredo JWT criado](images/jwt_secret.png){.thumbnail} + +### Etapa 6 - Instalar o screen para persistência de sessão + +Num servidor remoto, a desconexão do SSH termina os processos em execução. O `screen` mantém-nos em execução em segundo plano, independentemente da sua sessão. + +```bash +screen --version +``` + +![Versão do screen](images/screen_version.png){.thumbnail} + +Se não estiver já instalado: + +```bash +sudo apt-get install screen -y +``` + +### Etapa 7 - Definir a propriedade dos diretórios + +Os clientes Ethereum necessitam de acesso de escrita ao diretório de dados. Atribua a propriedade do ponto de montagem ao seu utilizador atual: + +```bash +sudo chown $USER:$USER /mnt/chaindata +``` + +Isto concede ao seu utilizador a propriedade total de `/mnt/chaindata`, para que os clientes Ethereum possam ler e escrever dados nesse local. + +### Etapa 8 - Iniciar o Nethermind + +Crie uma sessão screen e inicie o Nethermind: + +```bash +screen -S nethermind +``` + +```bash +nethermind -c mainnet \ + --data-dir /mnt/chaindata/nethermind \ + --JsonRpc.Enabled true \ + --HealthChecks.Enabled true \ + --HealthChecks.UIEnabled true \ + --JsonRpc.EngineHost=127.0.0.1 \ + --JsonRpc.EnginePort=8551 \ + --JsonRpc.JwtSecretFile=/secrets/jwt.hex +``` + +Deverá ver registos a indicar que o cliente está em execução. Eventualmente, a seguinte mensagem será apresentada: + +```text +Waiting for Forkchoice message from Consensus Layer +``` + +Isto indica que o execution client está à espera de emparelhar com o consensus client. + +![Nethermind em execução](images/nethermind_running.png){.thumbnail} + +Desanexe a sessão premindo `Ctrl+A` e depois `D` para regressar ao shell principal. + +Pode listar as sessões ativas com `screen -ls` e voltar a anexar mais tarde com `screen -r nethermind`. + +![Sessões screen](images/screen_list.png){.thumbnail} + +### Etapa 9 - Iniciar o Lighthouse + +Crie uma nova sessão screen e inicie o Lighthouse: + +```bash +screen -S lighthouse +``` + +```bash +lighthouse bn \ + --network mainnet \ + --execution-endpoint http://127.0.0.1:8551 \ + --execution-jwt /secrets/jwt.hex \ + --checkpoint-sync-url https://mainnet.checkpoint.sigp.io \ + --http \ + --datadir /mnt/chaindata/lighthouse +``` + +![Início do Lighthouse](images/lighthouse_start.png){.thumbnail} + +Após a configuração inicial, o Lighthouse deverá começar a sincronizar com a rede. + +![Sincronização do Lighthouse](images/lighthouse_syncing.png){.thumbnail} + +Desanexe a sessão premindo `Ctrl+A` e depois `D`. + +### Etapa 10 - Verificar a sincronização + +Nesta fase, tanto o **execution client** (Nethermind) como o **consensus client** (Lighthouse) devem estar em execução em sessões screen separadas. Para confirmar que estão corretamente ligados e que a sincronização está em curso, volte a anexar à sessão Nethermind e inspecione os registos: + +```bash +screen -r nethermind +``` + +Se o Lighthouse estiver corretamente ligado, a mensagem "Waiting for Forkchoice" deverá desaparecer. Em vez disso, deverá ver registos de comunicação **Engine API** e de processamento de blocos: + +```text +Received ForkChoice: ... +Syncing... +``` + +![Sincronização EL e CL](images/el_cl_sync.png){.thumbnail} + +Estes registos confirmam que o Nethermind está a receber propostas de blocos e atualizações de fork choice do Lighthouse, e que o nó está a sincronizar com a mainnet do Ethereum. + +Embora este tutorial se tenha focado na implementação técnica, é importante complementar a configuração com medidas adequadas de reforço da segurança, monitorização e manutenção para garantir a estabilidade a longo prazo. Com a base agora estabelecida, pode expandir a funcionalidade do seu nó, integrá-lo em infraestruturas maiores ou utilizá-lo como base para investigação, desenvolvimento e operações de staking. + +## Quer saber mais? + +- [Ethereum Foundation - Run a node](https://ethereum.org/en/run-a-node/) +- [Documentação Nethermind](https://docs.nethermind.io/) +- [Documentação Lighthouse](https://lighthouse-book.sigmaprime.io/) + +[Criar uma instância Public Cloud](/pages/public_cloud/compute/public-cloud-first-steps) + +[Criar e configurar um disco adicional numa instância](/pages/public_cloud/compute/create_and_configure_an_additional_disk_on_an_instance) + +Fale com a nossa [comunidade de utilizadores](/links/community). diff --git a/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/blkid_output.png b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/blkid_output.png new file mode 100644 index 00000000000..403d2909861 Binary files /dev/null and b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/blkid_output.png differ diff --git a/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/el_cl_sync.png b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/el_cl_sync.png new file mode 100644 index 00000000000..46b8ae86030 Binary files /dev/null and b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/el_cl_sync.png differ diff --git a/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/fdisk_partition.png b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/fdisk_partition.png new file mode 100644 index 00000000000..f50f5c3ebb2 Binary files /dev/null and b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/fdisk_partition.png differ diff --git a/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/jwt_secret.png b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/jwt_secret.png new file mode 100644 index 00000000000..09837f14bdf Binary files /dev/null and b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/jwt_secret.png differ diff --git a/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/lighthouse_download.png b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/lighthouse_download.png new file mode 100644 index 00000000000..aa6cd1fd075 Binary files /dev/null and b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/lighthouse_download.png differ diff --git a/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/lighthouse_extract.png b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/lighthouse_extract.png new file mode 100644 index 00000000000..20a1fd9a84a Binary files /dev/null and b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/lighthouse_extract.png differ diff --git a/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/lighthouse_start.png b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/lighthouse_start.png new file mode 100644 index 00000000000..cac148af74d Binary files /dev/null and b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/lighthouse_start.png differ diff --git a/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/lighthouse_syncing.png b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/lighthouse_syncing.png new file mode 100644 index 00000000000..6142c8dea2b Binary files /dev/null and b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/lighthouse_syncing.png differ diff --git a/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/lighthouse_version.png b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/lighthouse_version.png new file mode 100644 index 00000000000..2928ab38e9e Binary files /dev/null and b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/lighthouse_version.png differ diff --git a/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/lsblk_output.png b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/lsblk_output.png new file mode 100644 index 00000000000..a98fb97c484 Binary files /dev/null and b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/lsblk_output.png differ diff --git a/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/mkfs_ext4.png b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/mkfs_ext4.png new file mode 100644 index 00000000000..10ae1536296 Binary files /dev/null and b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/mkfs_ext4.png differ diff --git a/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/mount_verify.png b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/mount_verify.png new file mode 100644 index 00000000000..87e991014d0 Binary files /dev/null and b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/mount_verify.png differ diff --git a/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/nethermind_add_repo.png b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/nethermind_add_repo.png new file mode 100644 index 00000000000..806e0a5f42d Binary files /dev/null and b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/nethermind_add_repo.png differ diff --git a/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/nethermind_apt_update.png b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/nethermind_apt_update.png new file mode 100644 index 00000000000..abca1bf4e59 Binary files /dev/null and b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/nethermind_apt_update.png differ diff --git a/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/nethermind_install.png b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/nethermind_install.png new file mode 100644 index 00000000000..274e178af49 Binary files /dev/null and b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/nethermind_install.png differ diff --git a/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/nethermind_running.png b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/nethermind_running.png new file mode 100644 index 00000000000..c901037d401 Binary files /dev/null and b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/nethermind_running.png differ diff --git a/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/screen_list.png b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/screen_list.png new file mode 100644 index 00000000000..ad8707e6ee2 Binary files /dev/null and b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/screen_list.png differ diff --git a/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/screen_version.png b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/screen_version.png new file mode 100644 index 00000000000..74b073baaee Binary files /dev/null and b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/images/screen_version.png differ diff --git a/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/meta.yaml b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/meta.yaml new file mode 100644 index 00000000000..da5af849e7f --- /dev/null +++ b/pages/public_cloud/compute/tutorial-blockchain-running-ethereum-node/meta.yaml @@ -0,0 +1,2 @@ +id: 0fd5f27e-1de6-4746-84a9-36eb42db479b +full_slug: public-cloud-compute-tutorial-blockchain-running-ethereum-node