Build a Cosmos SDK Blockchain on Digital Ocean

Build a Cosmos SDK Blockchain on Digital Ocean

To complete this tutorial, you will need an account with a VPS cloud provider. There are many options available, such as:

For this tutorial, we will use Digital Ocean. However, feel free to use any provider you prefer.

Step 1: Create a New Project on Digital Ocean

  1. Log into your Digital Ocean account. You should see a page like the one below. Click +New Project. We will use a bare minimum system for this tutorial, but you can choose a more advanced version with higher RAM if needed.

    Screenshot

  2. Input your project information. You can use any name you like. Click Create, then click "Skip for Now" on the next page.

    Screenshot

  3. Choose a location close to you for better performance.

    Screenshot

  4. For this tutorial, select Ubuntu LTS 22.04.

    Screenshot

  5. Choose a Shared CPU option, as it is the most cost-effective choice.

    Screenshot

  6. Select the Regular CPU and SSD option.

    Screenshot

  7. Choose the password login option instead of the public key option (or use a public key if you prefer). Remember to keep your password secure, as you will need it to access your server.

  8. Click Create at the bottom of the page.

  9. You will see your droplet being created. Once it finishes, it will display the IP address for your server. Copy this IP address.

    Screenshot

Step 2: Access Your Server

  1. Open a terminal or command prompt on your local machine.

  2. Connect to your server using SSH:

    ssh root@your.server.ip.address
    
  3. Type yes if prompted.

  4. Enter your password when prompted.

  5. If successful, you should see a root prompt that looks something like this:

    Screenshot

Step 3: Install Dependencies

Run the following commands to update your system and install the necessary dependencies:

sudo apt update
sudo apt install build-essential
sudo apt install gcc
sudo apt install wget
sudo apt install curl 

Step 4: Install Golang

  1. Download and install Golang:

    sudo wget https://go.dev/dl/go1.21.1.linux-amd64.tar.gz
    sudo tar -C /usr/local -xzf go1.21.1.linux-amd64.tar.gz
    

Step 5: Update the .bashrc File

  1. Open the .bashrc file for editing:

    sudo nano ~/.bashrc
    
  2. Copy and paste the following lines into the file:

    export GOROOT=/usr/local/go
    export PATH=$PATH:$GOROOT/bin
    export PATH=$PATH:~/go/bin
    
  3. Save the file and exit the editor (Ctrl + X, then Y, then Enter).

  4. Source the .bashrc file to apply the changes:

    source ~/.bashrc
    

Step 6: Verify Golang Installation

Check if Golang was installed correctly:

go version

You should see an output similar to this:

Screenshot

Step 7: Install Ignite CLI

Now that Golang is installed, you can install the Ignite CLI to build a Cosmos SDK blockchain.

  1. Install Ignite CLI:

    sudo curl https://get.ignite.com/cli@v0.26.1 | sudo bash
    
  2. Move Ignite to your /usr/local/bin/ directory:

    sudo mv ignite /usr/local/bin/
    
  3. Verify if Ignite CLI was installed correctly:

    ignite version
    
  4. Scaffold an example Blockchain

    ignite scaffold chain example
    
    cd example
    
    ignite chain serve
    

Conclusion

Congratulations! You have successfully installed Ignite CLI on a cloud server and built an example Cosmos SDK Blockchain. You are now ready to start building your blockchain!

For more articles on creating application-specific blockchains, please visit our website:

Cosmos Journey