Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 15 Next »

Binance Smart Chain Full-Node Deployment with Erigon – From Source

Description

A tutorial demonstrating the process of connecting to a remote server running Linux Ubuntu, setting up and running a full node on Binance Smart Chain using the Erigon client.

Content Type

Guided Demo

Assigned To / By

C. J. (Unlicensed)

Key Resource

Node Provider Demo - 10 Feb 2022 (Meeting Recording)

Document Status

DRAFT

 Script Syntax
:'BINANCE SMART CHAIN
    FULL NODE WITH ERIGON CLIENT
      SETUP INSTRUCTIONS'
      
# February 2022
# C. Wooten

# Enable admin privileges for the user.
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock*
sudo dpkg --configure -a

# Generate a new SSH key pair for enhanced security.
ssh-keygen -b 4096

# Update existing Linux packages. 
sudo apt update && apt upgrade && apt automremove -y

# Use the 'apt' command to install or remove software.
sudo apt purge golang*    #Removes existing GoLang version.

sudo apt install git && sudo apt install npm && sudo apt install axel


# Uninstall & reinstall GoLang.
go version
sudo apt purge golang*
sudo apt install snapd
sudo snap install go --classic 
sudo tar -C /usr/local -xzf go0.00.00linux-amd64.tar.gz
  # Replace [go0.00.00] with the updated version
  
# Create a new Go directory & set the $PATH location.
mkdir ~/.go
GOROOT=/usr/local/go
GOPATH=~/.go
PATH=$PATH:$GOROOT/bin:$GOPATH/bin

# Update GoLang command & set the location of /bin/go.
sudo update-alternatives --install "/usr/bin/go" "go" "/usr/local/go/bin/go" 0
sudo update-alternatives --set go /usr/local/go/bin/go

# Additional Installations
sudo apt install git && sudo apt install npm && sudo apt install axel 
sudo apt-get install ntp -y && service ntp start && date

# Configure the node specifications. 
sudo apt install mdadm

Roadblocks

init 6
:'This command closes the connection and 
    termporarily locks user out of the server.'

00 PREREQUISITES

0.1 – System Requirements

Specification

Minimum Requirement

Used for Demo

Hardware

Linux / Mac / Windows system running the latest OS version

MacBook Pro running MacOS Monterey 12.2

SSD / NVMe Storage

≥ 2 TB

7.68 TB

RAM

≥ 16 GB

256 GB

Server OS

Linux OS (64-bit)

Ubuntu Server 20.04.3

Network Settings

  • SSH enabled

  • TDP / UDP traffic enabled

0.2 – Hardware & Software

  1. Linux, Mac, or Windows computer running the latest operating system (OS) version.
    (For Demo: MacBook Pro + MacOS Monterey 12.2)

  2. Terminal Emulator / SSH Client

  3. Login credentials for the server being accessed.

0.3 – Enabling / Disabling Secure Shell (SSH)

To access the server remotely, the user must enable Secure Shell (SSH) on their home system.

  1. Enter the following command/s in Terminal to enable / disable SSH on the system:

    sudo systemsetup -setremotelogin on   
      #Enable SSH
      
    sudo systemsetup -setremotelogin off    
      #Disable SSH
      
    Password: [?]   
      #System password

01 SETTING UP THE REMOTE SERVER

1.1 – Connecting to the Remote Server

  1. To access the server with SSH, run the following Terminal command/s (replacing the details inside the {brackets} with your provided credentials):

    ssh {user}@{server.ip}
      #Server access login
      
    Password: [?]
      #Access password
      
    #Use [CTRL+D] at anytime to suspend the connection. 

1.2 – Optimize the Server for Node Operations

Once you’re connected to the server with SSH, follow the steps below to setup and install the dependencies required for your node.

  1. Update the Ubuntu System and upgrade the OS components.

    sudo apt update && apt upgrade && autoremove -y 

  1. Install the latest version of GoLang.

    1. Check and remove the existing GoLang version.

      go version  
        #displays the existing version
      sudo apt purge golang*  
        #removes the existing Go version

    2. Use purge to remove the existing version; then, use wget to install the latest version.

      sudo apt purge golang*    #Removes the existing Go version. 
      wget https://go.dev/dl/go1.17.7.linux-amd64.tar.gz  #Installs the current version (go1.17.7 as of 2022-02-14).
      sudo tar -C /usr/local -xzf go1.11.4.linux-amd64.tar.gz   #Extracts Go in the /usr/local folder
      mkdir ~/.go

    3. Set the environmental variables and $PATH location.

      GOROOT=/usr/local/go
      GOPATH=~/.go
      PATH=$PATH:$GOROOT/bin:$GOPATH/bin

    4. Update the Go command.

      sudo update-alternatives --install "/usr/bin/go" "go" "/usr/local/go/bin/go" 0
      sudo update-alternatives --set go /usr/local/go/bin/go
    5. Confirm Go was updated to the latest version.

      go version

  2. go version

02 Install Dependencies

2.1 Viewing and Verifying the Server’s Components

Run the List Block command to view drives and partitions installed on the server.

lsblk

$ sudo apt-get update
$ sudo apt dist-upgrade -y
$ sudo apt autoremove -y
$ sudo apt install git
$ sudo apt install npm

Top-level Updates

The following demonstration will exhibit the step-by-step processes of:

  1. Logging into the system

    1. Username & password login by default

    2. Secure user credentials with a Public SSH Key.

      1. Option A → Run ssh-keygen command:

        ssh-keygen -t rsa

         
      2. Option B → ls -al .ssh

      3. fdafdasd

        ssh-keygen -t rsa
  2. Get Erigon

  3. Run Erigon + Setup as a service so it will run again after rebooting

  4. Change the hostname of the server

  5. Make an exception for SSH, then turn on the firewall.

  6. Open Erigon port 30303 through the firewall to allow incoming connections to the node (allows for a trustless, distributed system).

  7. Setup DNS so it can be accessed with a domain name.

  • No labels