Installing EOS (Part 2) — Installing EOSIO

Philip Rutovitz
Coinmonks

--

This is the second part of the installation guide for EOS on Ubuntu with an Oracle VirtualBox Virtual Machine. I assume that you have already loaded Ubuntu 18.04 on your newly created Virtual Machine. I will now cover how to install EOSIO 1.5.2. If you have not yet set up Ubuntu, please refer to part 1. You can find the link here:

The first thing that you need to do is to install the Guest Additions for VirtualBox. This will allow you to share files between Windows and Ubuntu and also to copy and paste which you will find very useful.

The first thing you need to do is to load the Guest Additions CD (no need to worry, you do not actually need to have a CD). Select the menu item Insert Guest Additions CD Image…

You will then be asked to confirm the installation:

Click Run. You will be asked for your password and then it will proceed to install the Guest Additions. These are necessary in order to copy from Windows and paste into Ubuntu. One tip — sometimes you need to reinstall if you are not able to copy from Windows to Ubuntu. Remember that ctrl-v does not work in Ubuntu. Instead you should use right-click + paste or ctrl-shift-v.

First, go to the terminal by typing ctrl-alt-t. Then enter:

sudo apt-get install virtualbox-guest-dkms

You will be prompted to add the required additional disk space.

This will take about 5 minutes to install. Now you add the user you created to the now created vboxsf group by entering:

sudo adduser <username> vboxsf

Now you need to setup the Virtual Machine to allow for Copy and Pasting. In VirtualBox, select Devices\Shared Clipboard\Bidirectional.

In order to download the latest list of packages and dependencies for Ubuntu from the relevant repositories, you need to run the command:

sudo apt update

You will be asked for your password and then the update will run. Once the update is run, you will need to actually upgrade the packages by using the command:

sudo apt upgrade

You will also be asked to confirm the additional space that will be required.

The next step is to get the version control system “git” in order to be able to download the EOS libraries. You need to first go to your root directory by entering cd ~ and then run:

sudo apt install git

You will again be asked to confirm the use of the additional disk space.

The next step is to load the EOS repository using the command

git clone https://github.com/eosio/eos --recursive

Now we come to the meat of the installation which is actually installing EOSIO in order to be able create and deploy EOS smart contracts. First you need to go into the newly created EOS directory by typing cd eos. The run the build script to build and compile the EOS framework. This is accomplished by running the EOSIO build script:

./eosio_build.sh

You will then see a list of dependencies that need to be installed. Here you should select 1 in order to proceed. You will then be prompted for your password and then the build script will run with all the required dependencies.

This will take quite a long time so leave the computer humming and do something else for a while…

You will eventually be asked to enter your password again in order to load MongoDB C++ drivers.

These are drivers for MongoDB which is a database for documents stored as JSON files.

Then after several hours, you should get this message and the EOSIO build is complete.

Next you go into the build directory and install EOSIO:

cd build
sudo make install

You will then be asked for your password again.

The install only takes a minute or two. To make sure that you can run cleos, nodeos and keosd, make sure that /usr/local/eosio/bin is in the path with the following command:

export PATH=$PATH:/usr/local/eosio/bin

The next step you need to follow is to create the genesis node genesis.json. In previous versions of EOSIO this was done by running nodeos, but now you need to extract it using the command:

nodeos — extract-genesis-json genesis.json

You can do this any where, but I would suggest the EOS directory. After running this command, it will say failed to initialize, but do not worry, genesis.json has been created. See below:

You can see that genesis.json now shows up in the EOS directory.

The one last step is to run EOSIO using nodeos which is actually NodeOS, a lightweight operating system built in Javascript using npm.

Now use the following command to run EOSIO the first time from the same directory:

nodeos -e -p eosio --genesis-json genesis.json --delete-all-blocks  --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin

When you run this, all blocks will be deleted and the config.ini file is created. You should now see blocks being generated:

The next time you run nodeos you do not need to delete all blocks or use the genesis node. You can use the following simplified command:

nodeos -e -p eosio --plugin eosio::chain_api_plugin

Congratulations, you are now running an EOS node!

Get Best Software Deals Directly In Your Inbox

--

--

Philip Rutovitz
Coinmonks

Phil Rutovitz is a blockchain and capital markets expert with decades of experience in IT and finance.