devb logo reorder

Devb Papers

Setting up Hyperledger Sawtooth in AWS Cloud

Setting up Hyperledger Sawtooth

This paper is an extension of Hyperledger Sawtooth Setup process as narrated in the Hyperledger website. AMIs for Sawtooth are available from AWS, this instance is much more lightweight and easier to debug.

AWS lightsail to define the server instance.

AWS Lightsail access from console

From the different choices in LightSail, I selected the Bitnami Node.JS image.

AWS Lightsail Bitnami NodeJS

The settings below are necessary. Port 8008, 8800 and 4004 are used by Sawtooth for interacting with the REST server, validators and Transaction Processors.

Settings for the instance

Once the LightSail-instance is up and running, SSH into the instance

$ ssh i ~/Downloads/[Your pem file] bitnami@[ your ip address]
$ mkdir sawtooth
$ cd sawtooth

AWS instance

We will be running a series of rapid installation steps. If you wish to know more about this part, please read it here

$ sudo apt-key adv --keyserver hkp:// --recv-keys 8AA7AF1F1091A5FD
$ sudo add-apt-repository 'deb xenial universe'
$ sudo apt-get update

Install Sawtooth

$ sudo apt-get install -y sawtooth

Verify the installation

$ dpkg -l '*sawtooth*'

What's installed

Create a Genesis Block using the Sawtooth CLI

$ sawtooth keygen
$ sawset genesis
$ sudo -u sawtooth sawadm genesis config-genesis.batch

Start a Validator instance, that will listen on local ports

$ sudo sawadm keygen
$ sudo -u sawtooth sawtooth-validator -vv

Start the REST server, that will allow external traffic on port 8008

Ensure you bind on the Internal IP address and not the external one.

$ sudo -u sawtooth sawtooth-rest-api -v --bind
Now check either with the Browser or with cURL
http://[external ip address]:8008/blocks
Copyrights and Trademarks acknowledged.

Hyperledger Composer - copyright of the Linux Foundation
NodeJS is a copyright of NodeJS Foundation and Trademark of Joyent Inc
Intel is a Trademark of Intel Corporation
IBM is a Trademark of International Business Machines