How To: Run an Expanse Node on AWS

Speedrunner
3 min readFeb 11, 2019

With the popularity of blockchain technology, the size of nodes is growing. Therefore, it’s becoming more and more difficult to have a local node for interacting with the world of decentralization. In this tutorial, step by step I will tell you how to create your Instance on AWS (using free-tier), how to work with it, and how to install and run your gexp on it (Expanse node).

All you need is an AWS account and a basic understanding of the Linux command line. Let’s start.

Launch EC2 Instance

Now, let’s create the EC2 instance where our node will run. We’ll use stable Ubuntu 18.04.

Open your AWS Managment Console, find Instances and click Launch Instance’:

Select Ubuntu Server 18.04 LTS (HVM), SSD Volume Type and go to the next step.

Free-tier gives access to the use of t2.micro with 1 GB RAM and 30 GB of Amazon Elastic Block Storage, this will be enough to synchronize the entire node and its constant work.

On the third, fourth and fifth step, you can change nothing and go directly to the “Configure Security Group”, on this step you need to specify what IP-addresses will have access to your instance. For better security, select Custom and input your IP.

On the final step click Launch and create new key pair, download it and save. You’ll need this key to connect to your instance.

Open list of Instances, find your new instance and click “connect”, you will see detailed manual, follow it.
SSH into your instance with your downloaded keypair file.

ssh -i /path/to/<YOUR-KEY-NAME>.pem ubuntu@<YOUR-PUBLIC-DNS-NAME>

If everything is ok, you will something like ubuntu@<ip-of-instance>

Connect to Expanse Network

Once connected into the instance, create new folder and download go-expanse from github.

mkdir gexp
cd gexp
git clone https://github.com/expanse-org/go-expanse

You’ll need to install 1.7 version of GO before compiling gexp. Let’s create new folder GO and download it

wget https://storage.googleapis.com/golang/go1.7.1.linux-amd64.tar.gz

To extract the downloaded archive file and move to the desired location on system, use the following commands:

sudo tar -zxvf go1.7.1.linux-amd64.tar.gz -C /usr/local/

Now, you need to set Go environment, use this commands:

export GOROOT=/usr/local/go
export GOPATH=$HOME/tutorialspoint/sample
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

Let’s check go version with following command:

go version

If you see something like “go version go1.7.1 linux/amd64", than we can compile our gexp, return to gexp folder, open go-expanse folder and run:

make gexp

If everything is ok, open /build/bin folder and try to run gexp with rpc flag

./gexp --rpc console

You should see the synchronization process (downloading the entire blockchain), this process may take about 10–15 minutes before full synchronization. After full sync you can interact with gexp just like you would on local instance!

> eth.getBlock("latest")
{
difficulty: 5060050616819,
extraData: "0x73656f32",
gasLimit: 4708126,
gasUsed: 0,
...
}

Learn more about Expanse Blockchain here

--

--

Speedrunner

Working on some blockchain projects, love cryptoanarhysm ideas.