Configuring the validator node
If you configured attached storage, follow these instructions to mount the drive to your VM. (Boot disk will automatically be mounted). Use “df -h” to see VM storage, confirm disk capacity is available.
Create a bbachain
linux user to run the BBA Chain validator under. You may not want the bbachain
user as part of the sudoers group after installation for security reasons.
Connect to Validator SSH
To connect to your Ubuntu server via SSH, use the following command:
ssh username@your_server_ip
Replace username
with your actual username and your_server_ip
with the IP address of your server. If you are using a custom SSH port, you can specify it with the -p
option:
ssh username@your_server_ip -p custom_port
Make sure you have your SSH key added to your SSH agent or provide the path to your private key using the -i
option:
ssh -i /path/to/your/private/key username@your_server_ip
Update Your Ubuntu Packages
To update and upgrade your Ubuntu packages, run the following commands:
sudo apt-get update
sudo apt-get upgrade -y
Create User
To create a new bbachain
user, run the following command:
sudo adduser bbachain
To delete the password for the bbachain
user, run the following command:
sudo passwd -d bbachain
To add the bbachain
user to the sudo group (optional — you may remove it after installation), run the following command:
sudo usermod -aG sudo bbachain
This command creates a new user named bbachain
without a password and with default user information. You can then switch to the bbachain
user with:
sudo su - bbachain
Hard Drive
- To list all available block devices, use the following command:
- This command will display detailed information about all block devices, including their mount points, sizes, and types.
lsblk -l
- Format the disk device using the mkfs tool. This command deletes all data from the specified disk, so make sure that you specify the disk device correctly.
-
You can use any file format that you need, but we recommend a single ext4 file system without a partition table. You can increase the size of your disk later without having to modify disk partitions.
-
To maximize disk performance, use the recommended formatting options with the -E flag. It is not necessary to reserve space for the root volume on this secondary disk, so specify -m 0 to use all of the available disk space. The following command formats the entire disk with no partition table.
sudo mkfs.ext4 -m 0 -E lazy_itable_init=0,lazy_journal_init=0,discard /dev/<DEVICE_NAME>
Replace DEVICE_NAME: the device name of the disk that you are formatting. For example, using the example output from the first step, you would use sdb for the device name.
- Mount the disk
-
Create a directory that serves as the mount point for the new disk on the VM. You can use any directory. The following example creates a directory under /mnt/disks/.
sudo mkdir -p /mnt/disks/MOUNT_DIR
Replace MOUNT_DIR with the directory at which to mount disk.
- Use the mount tool to mount the disk to the instance, and enable the discard option:
-
Run following commands:
sudo mount -o discard,defaults /dev/DEVICE_NAME /mnt/disks/MOUNT_DIR
Replace the following:
- DEVICE_NAME: the device name of the disk to mount.
- MOUNT_DIR: the directory in which to mount your disk.
- Configure read and write permissions on the disk. For this example, grant write access to the disk for all users.
-
Run following commands:
sudo chmod a+w /mnt/disks/MOUNT_DIR
Replace MOUNT_DIR with the directory where you mounted your disk.
- Configure automatic mounting on VM restart
-
Add the disk to your
/etc/fstab
file, so that the disk automatically mounts again when the VM restarts. On Linux operating systems, the device name can change with each reboot, but the device UUID always points to the same volume, even when you move disks between systems. Because of this, we recommend using the device UUID instead of the device name to configure automatic mounting on VM restart. -
Create a backup of your current
/etc/fstab
file.sudo cp /etc/fstab /etc/fstab.backup
-
Use the
blkid
command to list the UUID for the disk.sudo blkid /dev/DEVICE_NAME
Replace the following:
- DEVICE_NAME: the device name of the disk that you want to automatically mount. If you created a partition table on the disk, specify the partition that you want to mount by adding the suffix appended to the device name. For example, if sdb is the device name for the disk, sdb1 might be the name for the partition.
-
Open the
/etc/fstab
file in a text editor and create an entry that includes the UUID. For example:UUID=UUID_VALUE /mnt/disks/MOUNT_DIR ext4 discard,defaults,MOUNT_OPTION 0 2
Replace the following:
- UUID_VALUE: the UUID of the disk, listed in the output of the previous step
- MOUNT_DIR: the directory where you mounted your disk
- FILE_SYSTEM_TYPE: the file system type. For example, ext2, ext3, ext4, or xfs.
- MOUNT_OPTION: specifies what the operating system does if it cannot mount the zonal persistent disk at boot time. For valid values, see The fourth field in the Linux fstab documentation. To let the system boot even if the disk is unavailable, use the nofail mount option.
-
Use the cat command to verify that your /etc/fstab entries are correct:
cat /etc/fstab
Always keep the /etc/fstab
file in sync with the devices that are attached to a VM. If you want to detach a disk or create a snapshot from the boot disk for a VM, edit the /etc/fstab
file and remove the entry for the disk. Even if you set MOUNT_OPTION to nofail
or nobootwait
, remove the entry before you create your boot disk snapshot or detach the disk.