Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
En esta página, se incluyen prácticas recomendadas para ejecutar nodos RPC en varias redes de cadena de bloques.
En este instructivo, se te guiará a través de lo siguiente:
Crear una VPC nueva para tu nodo
Iniciar una VM para tu nodo
Configurar un perfil nuevo para tu administrador de nodos
Activa un disco externo en la VM para los datos de la cadena.
En esta guía, se supone que ya tienes un proyecto de Google Cloud con la facturación habilitada.
Para obtener instrucciones sobre cómo hacerlo, consulta Cómo crear y administrar proyectos.
Crea una VPC para tu nodo siguiendo estas recomendaciones:
Crea una VPC personalizada
Modo de enrutamiento regional
MTU 1460
Habilita la regla de firewall predeterminada BLOCKCHAIN_VPC_NETWORK-allow-ssh para tu red. Consulta Usa reglas de firewall de VPC para obtener más información.
Reemplaza BLOCKCHAIN_VPC_NETWORK por el nombre de la VPC que contendrá los recursos de tu nodo, por ejemplo, ethereum-vpc.
Agrega una subred IPv4 para tu red. Asegúrate de que la región elegida para tu subred sea la misma en la que deseas implementar tu nodo.
Para obtener información sobre cómo crear VMs de reglas de firewall en una VPC, consulta Crea reglas de firewall de VPC.
Puedes encontrar instrucciones específicas para la forma de la VM que coincida con los requisitos específicos de la red de cadena de bloques en la sección Hardware Requirements and Recommended Machine Type de la página del nodo específico de la cadena de bloques. Consulta la documentación específica de la cadena de bloques para ver los requisitos de CPU y memoria, la forma de VM recomendada para tu nodo y los comandos de creación para tu nodo.
Conéctate a la VM con SSH y crea un usuario nuevo
Conéctate a la VM mediante SSH
Cuando se aprovisione la VM, conéctate a ella con SSH. Para ello, navega a la página de Compute Engine o ejecuta el siguiente comando en Cloud Shell:
gcloudcomputesshNODE_NAME
Reemplaza NODE_NAME por el nombre del nodo. Usa letras minúsculas, números y guiones. Por ejemplo: my-node.
Si te conectas desde tu propia máquina, instala Google Cloud CLI como se describe en Instala la CLI de gcloud.
Cuando se complete la instalación de Google Cloud CLI, accede a tu proyecto y conéctate a la VM:
gcloudinitgcloudcomputesshUSER@NODE_NAME
Reemplaza USER por el Google Cloud nombre de acceso del usuario.
Crear un usuario nuevo
Una vez que te hayas conectado a la VM a través de SSH, crea un usuario sudo que no sea de SSH para que sea propietario y administre todos los recursos del nodo. Como este usuario no tiene claves SSH en los metadatos de la VM, solo se puede acceder a él si primero te conectas a la máquina a través de uno de los usuarios Google Cloud autenticados.
Crea un usuario sudo nuevo y ejecuta el siguiente comando:
sudouseradd-mNODE_ADMIN
Reemplaza NODE_ADMIN por el ID del usuario nuevo. Por ejemplo, node-admin
Agrega el usuario al grupo sudo:
sudousermod-aGsudoNODE_ADMIN
Cambia a este usuario para terminar de activar el disco externo:
sudosu-NODE_ADMIN
Activa los discos externos
El disco externo que creaste en el paso 2 alojará todos los datos de la cadena de tu nodo. Esta es una práctica recomendada, ya que te permite transferir los datos entre nodos una vez que se cierra la VM, así como configurar fácilmente programas de instantáneas para tus datos de cadena.
Activa el disco. Primero, muestra una lista de todos los discos disponibles en la VM:
sudolsblk
Es probable que el disco externo se encuentre en /dev/sdb. Puedes identificar el disco externo por el tamaño del disco que creaste en el paso 2.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (UTC)"],[[["\u003cp\u003eThis guide provides best practices for setting up RPC nodes across various blockchain networks within a Google Cloud environment.\u003c/p\u003e\n"],["\u003cp\u003eThe tutorial covers creating a custom VPC with regional routing and specific MTU settings, along with the creation of necessary firewall rules for the node.\u003c/p\u003e\n"],["\u003cp\u003eIt also details the process of spinning up a VM, connecting via SSH, and creating a dedicated non-SSH sudo user for node management.\u003c/p\u003e\n"],["\u003cp\u003eInstructions are provided for mounting an external SSD disk to the VM, which is essential for storing blockchain data and allowing for easy portability and snapshot configuration.\u003c/p\u003e\n"],["\u003cp\u003eAfter following this guide, users will have a configured VPC, a VM, a dedicated user, and a mounted disk, ready for the blockchain-specific deployment commands as outlined in the respective documentation.\u003c/p\u003e\n"]]],[],null,["# Common self-managed node setup\n\nThis page contains best practices for running RPC nodes across multiple blockchain networks.\n\nSpecifically, this tutorial will walk you through:\n\n- Creating a new VPC for your node.\n- Spinning up a VM for your node.\n- Setting up a new profile for your node manager.\n- Mounting an external disk to the VM for the chain data.\n\n**This guide assumes you already have a Google Cloud project with billing enabled.**\nFor instructions on how to do this, see [Creating and managing projects](/resource-manager/docs/creating-managing-projects).\n\nCreate a new VPC\n----------------\n\nFor detailed instructions on VPC creation, see [Create and manage VPC networks](/vpc/docs/create-modify-vpc-networks).\n\n1. Create a VPC for your node following these recommendations:\n\n - Create a custom VPC\n - Regional routing mode\n - MTU 1460\n - Enable the default \u003cvar translate=\"no\"\u003eBLOCKCHAIN_VPC_NETWORK\u003c/var\u003e`-allow-ssh` firewall rule for your network. See [Use VPC firewall rules](/firewall/docs/using-firewalls#common-use-cases-allow-ssh) for more.\n\n Replace \u003cvar translate=\"no\"\u003eBLOCKCHAIN_VPC_NETWORK\u003c/var\u003e with the name of the VPC that will hold your node resources, for example `ethereum-vpc`.\n2. [Add an IPv4 subnet](/vpc/docs/create-modify-vpc-networks#add-subnets) for your network. **Make sure the region chosen for your subnet is the same region where you want to deploy your node.**\n\n| **Note:** Refer to VPC and networking requirements in each blockchain-specific node page to see the required ports you need to enable for the VMs in the VPC.\n\nTo learn how to create firewall rules VMs in a VPC, see [Create VPC firewall rules](/firewall/docs/using-firewalls#creating_firewall_rules).\n\nSpin up a VM with an external SSD\n---------------------------------\n\nFor detailed instructions on VM creation and external disk attachment, [see the Compute Engine documentation](/compute/docs/instances/create-start-instance#create_a_vm_instance_with_additional_non-boot_disks).\n\nSpecific instructions for the VM shape that matches the specific requirements for the blockchain network can be found under the `Hardware Requirements and Recommended Machine Type` section in the blockchain-specific node page. Refer to the blockchain-specific documentation to see the CPU and memory requirements, recommended VM shape for your node, and creation commands for your node.\n\nConnect to the VM using SSH and create a new user\n-------------------------------------------------\n\n### Connect to the VM using SSH\n\n1. When the VM is provisioned, connect to the VM using SSH by either navigating to the compute engine page, or by running the following command in [Cloud Shell](/shell/docs/launching-cloud-shell):\n\n gcloud compute ssh \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-nx\"\u003eNODE_NAME\u003c/span\u003e\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eNODE_NAME\u003c/var\u003e with the name of your node. Use lowercase letters, numbers, and hyphens. For example: `my-node`.\n2. If connecting from your own machine, install the Google Cloud CLI as described in [Install the gcloud CLI](https://cloud.google.com/sdk/docs/install).\n\n3. When the Google Cloud CLI installation is complete, login to your project and connect to the VM:\n\n gcloud init\n gcloud compute ssh \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-nx\"\u003eUSER\u003c/span\u003e\u003c/var\u003e@\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-nx\"\u003eNODE_NAME\u003c/span\u003e\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eUSER\u003c/var\u003e with your Google Cloud user login name.\n\n### Create a new user\n\nOnce you have connected to the VM via SSH, create a non-SSH sudo user to own and administrate all the resources for the node. Since this user does not have SSH keys in the VM metadata, it can only be accessed by connecting to the machine first via one of the authenticated Google Cloud users.\n\n1. Create a new sudo user, run:\n\n sudo useradd -m \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-nx\"\u003eNODE_ADMIN\u003c/span\u003e\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eNODE_ADMIN\u003c/var\u003e with the user ID of the new user. For example, `node-admin`.\n2. Add the user to the sudo group:\n\n sudo usermod -aG sudo \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-nx\"\u003eNODE_ADMIN\u003c/span\u003e\u003c/var\u003e\n\n3. Switch to this user to finish mounting the external disk:\n\n sudo su - \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-nx\"\u003eNODE_ADMIN\u003c/span\u003e\u003c/var\u003e\n\nMount the external disks\n------------------------\n\nThe external disk you created in [step 2](#step2) will house all the chain data for your node. This is a best practice since it allows you to port the data across nodes once the VM is shutdown, as well as [easily configure snapshot schedules](/compute/docs/disks/scheduled-snapshots) for your chain data.\n\n1. Mount your disk, first list all the available disks in the VM:\n\n sudo lsblk\n\n Most likely, the external disk will be found under `/dev/sdb`. You can tell the external disk by the size of the disk you create in [step 2](#step2).\n2. Format the disk:\n\n sudo mkfs.ext4 -m 0 -E lazy_itable_init=0,lazy_journal_init=0,discard \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-o\"\u003e/\u003c/span\u003e\u003cspan class=\"devsite-syntax-nx\"\u003edev\u003c/span\u003e\u003cspan class=\"devsite-syntax-o\"\u003e/\u003c/span\u003e\u003cspan class=\"devsite-syntax-nx\"\u003esdb\u003c/span\u003e\u003c/var\u003e\n\n3. Create a directory for the disk and mount it:\n\n sudo mkdir -p /mnt/disks/\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-nx\"\u003eCHAIN_DATA_NAME\u003c/span\u003e\u003c/var\u003e\n sudo mount -o discard,defaults \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-o\"\u003e/\u003c/span\u003e\u003cspan class=\"devsite-syntax-nx\"\u003edev\u003c/span\u003e\u003cspan class=\"devsite-syntax-o\"\u003e/\u003c/span\u003e\u003cspan class=\"devsite-syntax-nx\"\u003esdb\u003c/span\u003e\u003c/var\u003e /mnt/disks/\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-nx\"\u003eCHAIN_DATA_NAME\u003c/span\u003e\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eCHAIN_DATA_NAME\u003c/var\u003e: the name of the data directory for your chain. For example, `my-eth-data`.\n - \u003cvar translate=\"no\"\u003e/dev/sdb\u003c/var\u003e: the location of the disk if different than `/dev/sdb`.\n4. Assign write privileges to \u003cvar translate=\"no\"\u003eNODE_ADMIN\u003c/var\u003e:\n\n sudo chmod a+w /mnt/disks/\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-nx\"\u003eCHAIN_DATA_NAME\u003c/span\u003e\u003c/var\u003e\n\n5. Get the UUID of the disk and add it to `fstab` for automatic remounting on restart:\n\n sudo blkid \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-o\"\u003e/\u003c/span\u003e\u003cspan class=\"devsite-syntax-nx\"\u003edev\u003c/span\u003e\u003cspan class=\"devsite-syntax-o\"\u003e/\u003c/span\u003e\u003cspan class=\"devsite-syntax-nx\"\u003esdb\u003c/span\u003e\u003c/var\u003e\n export DISK_UUID=$(findmnt -n -o UUID \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-o\"\u003e/\u003c/span\u003e\u003cspan class=\"devsite-syntax-nx\"\u003edev\u003c/span\u003e\u003cspan class=\"devsite-syntax-o\"\u003e/\u003c/span\u003e\u003cspan class=\"devsite-syntax-nx\"\u003esdb\u003c/span\u003e\u003c/var\u003e)\n echo \"UUID=$DISK_UUID /mnt/disks/\u003cvar translate=\"no\"\u003eCHAIN_DATA_NAME\u003c/var\u003e ext4 discard,defaults,nofail 0 2\" | sudo tee -a /etc/fstab\n\n6. Your disk is now mounted and ready. To check your mounted disk, run:\n\n df -h\n\nWhat's next?\n------------\n\nThe skeleton of your node is ready to go. By this point, you should have:\n\n- A VPC for your node with SSH access enabled.\n- A VM fitted to the requirements of your node.\n- A new node admin user to own and manage node resources.\n- A mounted external SSD disk fitted to the storage requirements of your node.\n\nMake sure to go back to the blockchain-specific documentation to finish running the deployment commands for your node."]]