getting-started-with-eos.png

Getting started with EOS

18/May/2018

Getting started with EOS

As soon as the news got spread on the launch of EOS, the new blockchain technology aroused a high level of curiosity among its users. It already received numerous amazing interpretations of what EOS stands for and how it makes into future blockchain technology applications. 


The new blockchain EOS is all set to release in the month of June 2018, giving away the answers to all interpretations raised. There is no doubt that the new blockchain technology has the potentiality in scaling to millions of transactions per second, eliminating user fees and allowing a quick and easy deployment of decentralized applications.

EOS come with more dynamic and flexible features compared to its competent Ethereum, giving the users, a totally a new experience in blockchain technology. The main attraction of EOS is that there are no transaction fees. Where Ethereum and other blockchains demand users to pay for every transaction, EOS initiates a free usage. Secondly, with EOS, a blockchain can be created in less time, giving more flexibility. EOS is also user-friendly comparing to Ethereum, as it enables end users to easily interact with.

This blog helps you to get started with EOS. Let’s take a tour to its technical side.

The EOSIO will be using several programs and the most important among them are.
> nodeos - server-side blockchain node component
> cleos - command line interface to interact with the blockchain and to manage wallets
> keosd - a component that manages EOSIO wallets

Once you install the EOS node on your system, all the above programs simultaneously will get successfully added to the system.

Operating system support for EOS are:-
1. Amazon 2017.09 and higher.
2. Centos 7.
3. Fedora 25 and higher (Fedora 27 recommended).
4. Mint 18.
5. Ubuntu 16.04 (Ubuntu 16.10 recommended).
6. MacOS Darwin 10.12 and higher (MacOS 10.13.x recommended).

And while considering the system requirements, it needs-
> 8GB RAM 
> 20GB Disk space

The EOSIO can be easily downloaded from git using the following commands.

git clone https://github.com/EOSIO/eos --recursive
git submodule update --init --recursive
The EOSIO can be built using an automated build script and one can run the build script from an Eos folder.

cd eos
./eosio_build.sh
The build process will create the eos/build folder. And the executables can be found in subfolders within the eos/build/programs folder.
Once you build the EOSIO you can test it using the following command in Linux.

~/opt/mongodb/bin/mongod -f ~/opt/mongodb/mongod.conf &

And followed by this command you have to perform the following commands too.

cd build
sudo make install

We can start the single node blockchain with a single command at build/programs/nodeos

$ cd build/programs/nodeos
$ ./nodeos -e -p eosio --plugin eosio::wallet_api_plugin --plugin eosio::chain_api_plugin --plugin eosio::account_history_api_plugin

If the node is configured successfully then this command will give you the  following result

1376014ms thread-0   producer_plugin.cpp:239  block_production_loo ] eosio generated block fe2c3f76... #9302 @ 2018-05-08T10:22:56.000 with 0 trxs, lib: 9301
 
This will generate new blocks in every 0.5 seconds as follows.

3510551ms thread-0   producer_plugin.cpp:239   	block_production_loo ] eosio generated block 029af2a5... #212308 @ 2018-05-18T09:58:30.500 with 0 trxs, lib: 212307
3511001ms thread-0   producer_plugin.cpp:239    block_production_loo ] eosio generated block f33b522f... #212309 @ 2018-05-18T09:58:31.000 with 0 trxs, lib: 212308
3511503ms thread-0   producer_plugin.cpp:239    block_production_loo ] eosio generated block daa638fd... #212310 @ 2018-05-18T09:58:31.500 with 0 trxs, lib: 212309
3512022ms thread-0   producer_plugin.cpp:239    block_production_loo ] eosio generated block deaf141a... #212311 @ 2018-05-18T09:58:32.000 with 0 trxs, lib: 212310
3512503ms thread-0   producer_plugin.cpp:239    block_production_loo ] eosio generated block 3a61eebb... #212312 @ 2018-05-18T09:58:32.500 with 0 trxs, lib: 212311

Once the installation gets completed and the block production is proper, we can create wallets on the EOS blockchain. Here, the wallets will be the repository for all private keys required to authenticate the actions on the blockchain.

Before creating the wallets, one has to make sure that the EOS blockchain is running. So, in a local machine one can open two terminal,  first terminal for running in EOS node, where you can see the blocks producing in every 0.5 seconds and second terminal for executing other commands. Here one can enter commands for creating wallets in EOS

$ cleos wallet create -n mywallet
Creating wallet: mywallet
Save password to use in the future to unlock this wallet.
Without password, imported keys will not be retrievable.
"PW5HuLthaKBJiMZCPKo4tnMzLtpwRxcQdKLuuxQhAkC3s4EYpETay"

When a wallet gets created, it provides a password for securely keeping the wallet. This password should be confidential and securely placed for unlocking the wallet in future. In addition, whenever an EOS node is restarted, it automatically locks your wallet initiating you to unlock them.

The generated password is different from the private key. In EOS, this is just a password. One can generate a private key for the wallet using the following command

$ cleos create key
Private key: 5KU8shPaW3uHC1jCTJzdwxF6NXoCY3n2GeqHHqUKStmX7EaaGoo
Public key: EOS5gv45FFCfPWbHAwVy6918uuhTiKUDT5vmFbcXd1idzGVRaJaHT
$ cleos create key
Private key: 5KByj3LTT5xSa9McyULbrzWhcgAVCtkZcFrFsnW6SEmF4kwjt3h
Public key: EOS7xpcs6kZVsJaU73GLdwk3h1nuQC77p6WMer3AxMHGngfee4kox

I have created two keys as we have to manage two permission level. One the user and second the tester. One can also use a single key for both accounts.
> user authority symbolizes ownership of an account. 
> tester authority is used for transferring funds, voting for producers and making other high-level account changes.

And the accounts can be created as follows:-
/*Creating the first account

cleos create account eosio user 
EOS5gv45FFCfPWbHAwVy6918uuhTiKUDT5vmFbcXd1idzGVRaJaHT
EOS5gv45FFCfPWbHAwVy6918uuhTiKUDT5vmFbcXd1idzGVRaJaHT

executed transaction:

0424897d9d44b5c340366e9e96051fe6ef16ea39c685aa6d0c7cf1de8fa20465  352 bytes  102400 cycles
# eosio <= eosio::newaccount {"creator":"eosio","name":"user","owner":{"threshold":1,"keys":[{"key":"EOS6ziZNE8MLRf4oFDRF4zWSg1ud…

 /* Creating a second account 

cleos create account eosio tester 
EOS7xpcs6kZVsJaU73GLdwk3h1nuQC77p6WMer3AxMHGngfee4kox
EOS7xpcs6kZVsJaU73GLdwk3h1nuQC77p6WMer3AxMHGngfee4kox

executed transaction:

519e53dcadf2b2367c20a56ae4f1d15c9810a05a29e0c325956ed0d6f101d3d7  352 bytes  102400 cycles
# eosio <= eosio::newaccount {"creator":"eosio","name":"tester","owner":{"threshold":1,"keys":[{"key":"EOS6ziZNE8MLRf4oFDRF4zWSg1…

In the above commands, the first key is the OwnerKey and second one is ActiveKey here I have used the same key for both.
The accounts can be listed as follows: 

cleos get accounts EOS6ziZNE8MLRf4oFDRF4zWSg1udweWUHGxDheoPTjnM1eFywRQ7y
{
  "account_names": [
"tester",
"user"
  ]
}
Once you create the keys and accounts you can further import these keys into your wallet. Once you import the private key to the wallet, then the public key will be automatically taken to the wallet. The import can be done with the following command 

$ cleos wallet import -n  mywallet
5KU8shPaW3uHC1jCTJzdwxF6NXoCY3n2GeqHHqUKStmX7EaaGoo
imported private key for:
5KU8shPaW3uHC1jCTJzdwxF6NXoCY3n2GeqHHqUKStmX7EaaGoo
When you restart the EOSIO then you have to unlock your wallet again, the wallet can be unlocked with the help of the following command

cleos wallet unlock -n mywallet
password: 
Unlocked: mywallet

Once you create the accounts you can add your contracts to it. You can create Eosio. token, Exchange, and Eosio.msig Contracts and so on

I hope this article was useful and you got an insight into the essential steps you need to take care of before starting the EOS development.

Comments

0

Leave a comment