EOS Dawn 3.0 Setup Instructions for Developers

— A Beginning to Dawn 3.0

Anant Anand Gupta
B21Official
6 min readApr 19, 2018

--

Before You Start

This Guide I am preparing while learning EOS. I will keep it updating and correcting, if and when there is anything I find or learn new around it. EOS Dawn 3.0 has been released released recently and I have found it really interesting. Follow this guide if you, like me are the one who is intrigued and want to learn a new technology. Let me tell you that if you are new to the programming this is not for you. Also, this guide assumes that you are aware of linux operating system and know how to use the command lines for work.

This guide will also include the code for the sample contracts I will be preparing for my learning or may be executing the once which I will copy from the other Authors. (Please excuse me, if that code you see over here matches your code … it may actually be. I will try to put credit here when and where possible.)

Environment (VM)

  1. Ubuntu 16.04
  2. 8GB RAM
  3. 40GB HDD
  4. 2 Core CPU

If you are not aware of how to create a VM, please follow these 2 videos, where in the first one I have shown how to install VMWare Player in Windows and the second one shows how to create a Ubuntu VM.

Installing VMWare in Windows
Creating Ubuntu VM

Installation Steps

Install Git

$ sudo apt install git

Get EOS Source from Git

$ cd ~
$ git clone https://github.com/EOSIO/eos --recursive

Build EOS from Source

$ cd eos
$ ./eosio_build.sh

… continue installing the dependencies if prompted … and few hours later (for me on the above configuration it took around 4 hours) you will be returned to the command prompt with EOS build complete (of course if there are no errors found during the build). I was thrown out of the build process stating that the Boost library failed to install. Started the process again and all went well this time.

  _______  _______  _______ _________ _______
( ____ \( ___ )( ____ \\__ __/( ___ )
| ( \/| ( ) || ( \/ ) ( | ( ) |
| (__ | | | || (_____ | | | | | |
| __) | | | |(_____ ) | | | | | |
| ( | | | | ) | | | | | | |
| (____/\| (___) |/\____) |___) (___| (___) |
(_______/(_______)\_______)\_______/(_______)
EOS.IO has been successfully built. 1:58:56To verify your installation run the following commands:/home/anantanandgupta/opt/mongodb/bin/mongod -f /home/anantanandgupta/opt/mongodb/mongod.conf &
export PATH=${HOME}/opt/mongodb/bin:$PATH
cd /home/anantanandgupta/eos/build; make test
For more information:
EOS.IO website: https://eos.io
EOS.IO Telegram channel @ https://t.me/EOSProject
EOS.IO resources: https://eos.io/resources/
EOS.IO wiki: https://github.com/EOSIO/eos/wiki

Validate the Build

If you read the above snippet, you will see that there are no issues with your build and it shares the command to validate the build. just run them sequentially. There will be 32 test which all should pass to give you a green signal. Note: Be patient as it may take a while to install.

Install EOS

$ cd ~/eos/build
$ sudo make install

Above should not take you more than a few minutes, so be patient here.

Configuration Steps

Run EOS Node for the First Time

$ nodeos

Let it run for a couple of seconds and then stop the service by pressing Ctrl+C. This will create the default configuration files in the places, where it should be. At this point before we start modifying the config file, we need to gather a few informations from the system.

Get the location of the genesis.json file

$ sudo find / -name genesis.json
/home/anantanandgupta/.local/share/eosio/nodeos/config/genesis.json
...
...
...

The above command can list a few files … copy the file name with its full path which is located under .local folder of your home directory.

Get the IP Assigned to This System in Local Network

$ ifconfig | grep "inet addr" | grep Bcast | awk -F' ' '{print $2}' | awk -F':' '{print $2}'
192.168.1.11

This will show you the IP adderess of your system. now in the same folder where you have found the genesis.json file, you should be able to locate the config.ini too.

Edit the Configuration (Finally)

I am using the vim editor, but you may choose the one you love.

Change the HTTP Server IP Address
This is required, so that you are able to access the services exposed by the nodeos from outside of the system using only given IP address where you may have multiple network interfaces. If you think that it is not required in your case, you can simply ignore this step.
find the config http-server-address and change the IP part of the address (let's keep the port as it is as of now. we may find the better port and reason to change the same at some later stage). for me it becomes:

http-server-address=192.168.1.11:8888

Change the genesis.json Path
now find the config genesis-json and change the path to the path we have colpied earlier. Remember that you have to provide the absolute path to the file (means from the root / directory )

genesis-json=/path/to/genesis.json

Enable Stale Production
This is an important step as here we are telling the node to produce the stale blocks as it is being configured as a standalone node. We can talk about this later, when we are going to setup multiple nodes. This can however be done through the command line while starting the node. (Just a food for your thought. I will be happy to see the comments on this and let you find the answer on how to this using the command line parameter)
So find the config enable-stale-production and set it to true.

enable-stale-production=true

Set the Producer Name
find producer-name and uncomment that (there will be # in front of it). You can be creative here and choose whatever name you want for your producer, but for the sake of this guide let's call it eosio

producer-name = eosio

Add Plugins
OK, this is the last step in our “change configuration” agenda. Reach to the bottom of the file and insert the below lines:

plugin=eosio::producer_plugin
plugin=eosio::wallet_api_plugin
plugin=eosio::chain_api_plugin
plugin=eosio::http_plugin
plugin=eosio::account_history_api_plugin

Here again, these plugins can also be supplied while starting the node and I will again leave it on you to figure it out. (May be I can help you with that later in this guide … keep reading ;P)

At this point your configuration modifications are done. You can save the file and close the editor.

Run EOS Node for the Second Time

$ nodeos

Here you should see that the node is running now and producing the blocks.

Our Buddy cleos

This is the command line tool for eos and we use this to issue commands and interact with the running node. This tool connects the server over http on local host (IP:127.0.0.1). Do you remember that we have changed the IP in the http-server-address config, so this tool got paralyzed now. If you try running this tool passing the commands, it will simply say failed to connect. e.g.

$ cleos get account eosio
Failed to connect

This is temporarily of course, we are going to fix that, by providing the parameters to this smart guy.

$ cleos -H 192.168.1.11 -p 8888 --wallet-host 192.168.1.11 --wallet-port 8888 get account eosio
{
"account_name": "eosio",
"permissions": [{
"perm_name": "active",
"parent": "owner",
"required_auth": {
"threshold": 1,
"keys": [{
"key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"weight": 1
}
],
"accounts": []
}
},{
"perm_name": "owner",
"parent": "",
"required_auth": {
"threshold": 1,
"keys": [{
"key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"weight": 1
}
],
"accounts": []
}
}
]
}

You may ask now from where that account came? Remember we have changed the name of the producer, this is what that gets translated into, an account. Let’s come back to the problem. Now it is very tedious to every time pass those parameters before executing the commands, isn’t it? We will create an alias for this and name it cleos itself.

Modify the .bash_alaises in our Home Directory

$ vim ~/.bash_aliases

and paste below line at the end of the file, save and close the editor.

alias cleos='cleos -H 192.168.1.11 -p 8888 --wallet-host 192.168.1.11 --wallet-port 8888'

Note: This is the time when we have to restart the terminal.

Try the Command Again

$ cleos get account eosio

This should be working and showing the same results as it did, when we provided the parameters. At this point you have a fully running minimal EOS TestNet node of EOS. I hope that you like this guide and it will help you kick start your development on EOS Blockchain.

--

--

Anant Anand Gupta
B21Official

Technology Enthusiast, Crypto Currency Platform Specialist, Fintech and Payment Processing Platform Architect, Mobile Payment Wallet Consultant