[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[[["\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."]]