Eris – How to Setup a Private Blockchain

September 13, 2018

Author: Duncan Brown

Tutorial - MLG Blockchain

Get tools docker and Golang. You can download both by clicking these links.

Docker: www.docker.com
Golang: www.golang.org

Read more on the getting started docs on the Eris Industries website and see docs for installation setup.

Docs for contract deployment can be found below.

Getting Started: https://docs.erisindustries.com/tutorials/getting-started/
Contract Deployment: https://docs.erisindustries.com/tutorials/getting-started/
Advanced Contract Deployment: https://docs.erisindustries.com/tutorials/advanced/contracts-deploying/

You can interact with your local Eris blockchain by deploying a node.js app.js.

To read the Eris docs on how interact with a smart contract go here: https://docs.erisindustries.com/tutorials/contracts-interacting/

Once you have setup an app.js file to interact with the contract you set up a REST API with code given from an Eris curl command. The port is not defined though, which complicates things when you are asked to curl PUT data on it. An example is with the following command.

$ curl --request PUT --data 1234 $host:8082

A simple fix to this is to hard code the port number, for example port 8083, into app.js at the very bottom of the script

server.listen(8082, function () {
console.log('Listening for https requests on port ' + 8082 + '.')

This step might need to be changed in production but it a quick fix for learning and testing. The last step is to install the dependencies.

npm install

MLG Blockchain is a blockchain development and consulting firm based in Toronto that is focused on building next generation applications using blockchain and smart contract technology. View all our blockchain development tutorials at www.mlgblockchain.com/learn.html.