Beginner’s Guide to EOS and Basic Smart Contracts

Beginner’s Guide to EOS and Basic Smart Contracts

Beginner’s Guide to EOS and Basic Smart Contracts

Beginner’s Guide to EOS and Basic Smart Contracts

Beginner’s Guide to EOS and Basic Smart Contracts

Read Time: 5 minutes

1. What is Eosio?

Eosio is software that introduces a blockchain architecture and claims to be a decentralized operating system which supports Dapps, it has developed under an open-source MIT software license. has built the eosio software, it is a leading blockchain solution company that provides high-performance blockchain solution.

The software provides accounts, authentication, databases, asynchronous communication and the scheduling of applications across multiple CPU cores and/or clusters.

2. How Eosio is different from other Blockchain (mainly Ethereum)?

Eosio is more scalable as it claims to manage millions of transaction per second, they are claiming this because they use DPOS(delegated proof of stake) consensus mechanism.
EOS provides parallel processing of smart contracts through horizontal scalability, they achieve horizontal scalability by adding more system to the resource pool.
They are planning to completely remove transaction fees, Eos works on an ownership model whereby users own and are entitled to use resources proportional to their stake, rather than having to pay for every transaction.

Prior knowledge required:

C/C++ intermediate experience
Blockchain Conceptual knowledge
Linux or command line tool

Architecture of EOSIO

All the terms in the architecture diagram will be explained later on when it is required don’t get confused with the diagram.

Firstly you need to setup the environment and have to install all the dependencies and contract development toolkit to create wallet and accounts on EOS blockchain.

3. Setup Environment

3.1) Download dependencies:


3.2) Setup a development directory

Command :

Mkdir EOStest

Cd EOStest

3.3) Get the Dockers image

The below statement will download an Ubuntu image which contains the compiled software.

docker pull eosio/eos:v1.4.2

3.4) Boot node and Wallet

Command :

docker run — name eosio 
 — publish 8888:8888 
 — publish 
 — volume /home/abhi_21094/Desktop/EOStest:/home/abhi_21094/Desktop/EOStest 
 — detach 
/bin/bash -c 
“keosd — http-server-address= & exec nodeos -e -p eosio — plugin eosio::producer_plugin — plugin eosio::chain_api_plugin — plugin eosio::history_plugin — plugin eosio::history_api_plugin — plugin eosio::http_plugin -d /mnt/dev/data — config-dir /mnt/dev/config — http-server-address= — access-control-allow-origin=* — contracts-console — http-validate-host=false — filter-on=’*’”

These settings accomplish the following:

  1. Forward port 8888 and 5555 to host machine
  2. Alias a work volume on your local drive to the docker container.
  3. Run the Nodeos startup in bash. This command loads all the basic plugins, set the server address, enable CORS and add some contract debugging.
  4. Enable CORS with no restrictions (*)

3.5) Check the Installation

Command :

docker logs — tail 10 eosio

3.6) Check the Wallet

Open a new tab in the terminal

Command :

docker exec -it eosio bash
cleos — wallet-url wallet list

As now keosd is running successfully, now you should know the following terms that we will use during installation and also while developing.

What is Cleos?

(cli + eos = cleos) — command line interface to interact with the blockchain and to manage wallets.

What is Nodeos?

nodeos (node + eos = nodeos) — the core EOSIO node daemon that can be configured with plugins to run a node.

What is Keosd?

(key + eos = keosd) — component that securely stores EOSIO keys in wallets.

3.7) Check Nodeos endpoints

This will check that RPC API working correctly

curl http://localhost:7777/v1/chain/get_info

You can also check this in your Browser provide by chain_api_plugin


3.8) Aliasing Cleos

We don’t need to enter in dockers container bash every time we interact with keosd so a solution for this we can alias it

alias cleos=’docker exec -it eosio /opt/eosio/bin/cleos — url — wallet-url'

Execute this command in your terminal or add this to your .bashrc file , you can find .bashrc file at home it may be a hidden file , use shortcut cntrl + h to show hidden files.

4. Contract Development Toolkit(Install CDT)

CDT for short, is a collection of tools related to contract compilation, use CDT primarily for compiling contracts and generating ABIs.

Install Command :

Wget .rpm
sudo yum install ./eosio.cdt-1.3.2.x86_64–0.x86_64.rpm

Copy this command and execute in your terminal you will get the following result

Till now you have successfully setup the environment and installed Contract development toolkit. Now you will going setup wallet and account that really very interesting part of EOS

blockchain .

5. Create Development Wallet

5.1) create a wallet

To create a wallet you need to enter in a docker container bash by using the following command

Command :

sudo docker exec -it eosio bash

After that enter wallet creation command

cleos wallet create — to-console

— to — console is used because we are using only for development purpose not production for production use — to — file as it will return your wallet private.

Wallets are closed by default

Command :

Cleos wallet open
Cleos wallet list

If you will get the following result then your wallet is created and opened successfully.

By default your cleos wallet is locked you need to unlock it by using the command : cleos wallet unlock, you can see the difference between locked and unlocked wallet when you execute a command cleos wallet list it will return default for now without asterisk when it is locked, after

executing unlock command you can see the asterisk sign which shows now wallet is unlocked.

Now we have to import the key in the wallet

cleos wallet create_key

Result: Created a new private key with a public key of: “EOS8PEJ…GDJQY5Y”

By executing this command you will get the public key as shown below copy that key.

5.2) Import Development Key

cleos wallet import

Now enter eosio development key provided below:


The default wallet is now unlocked and a key has been loaded. You are ready to proceed.

Use case: Deploy, Issue and transfer Tokens

We are implementing a token contract to issue token and transfer to any account/user.

Source Code is available at EOSIO’S GitHub:

Command :

git clone — branch v1.4.0 — single-branch

Make sure you are in the eosio contract directory:

cd eosio.contracts/eosio.token

6) Create Account

An account is a collection of authorizations, stored on the blockchain, and used to identify a sender/recipient.

cleos create account eosio eosio.token EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV

6.1) Compile Contract

eosio-cpp -I include -o eosio.token.wasm src/eosio.token.cpp — abigen

6.2) Deploy Contract

cleos set contract eosio.token /home/abhi_21094/Desktop/EOStest/eosio.contracts/eosio.token — abi eosio.token.abi -p eosio.token@active

6.3) Create Token

cleos push action eosio.token create ‘[ “eosio”, “1000000000.0000 SYS”]’ -p eosio.token@active

6.4) Issue Token

cleos push action eosio.token create ‘{“issuer”:”eosio”, “maximum_supply”:”1000000000.0000 SYS”}’ -p eosio.token@active

6.5) Transfer Tokens from one account to another account

cleos push action eosio.token transfer ‘[ “alice”, “bob”, “25.0000 SYS”, “m” ]’ -p alice@active

6.6) Return a Transaction in JSON

cleos push action eosio.token issue ‘[“alice”, “100.0000 SYS”, “memo”]’ -p eosio@active -d -j

6.7) To check the balance of any account using the account name

cleos get currency balance eosio.token bob SYS
25.00 SYS
cleos get currency balance eosio.token alice SYS
75.00 SYS

Well Done You have successfully Set Up Environment, Created Wallet, Accounts, compiled and Deployed Smart Contract of Token on EOSIO Blockchain.

We’re available for EOS smart contract development and security auditing work. You can fill this form to get in touch.

Thanks for reading. Also, do check out our earlier blog posts.

At QuillHash, we understand the Potential of Blockchain and have a good team of developers who can develop any blockchain applications like Smart Contracts, dApps,Smart Coins, DeFi, DEX on the any Blockchain Platform like Ethereum, EOS and Hyperledger.

To be up to date with our work, Join Our Community :-

Telegram | Twitter | Facebook | LinkedIn


Blockchain for dog nose wrinkles' Ponzi makes off ~$127M🐶

Project promised up to 150% returns on investment in 100 days, raising about 166.4 billion South Korean won — or about $127 million — from 22,000 people.

Latest blogs for this week

Understanding Fuzzing and Fuzz Testing: A Vital Tool in Web3 Security

Read Time: 5 minutes When it comes to smart contracts, ensuring the robustness and security of code is paramount. Many techniques are employed to safeguard these contracts against vulnerabilities
Read More

How EigenLayer’s Restaking Enhances Security and Rewards in DeFi

Read Time: 7 minutes Decentralized finance (DeFi) relies on Ethereum staking to secure the blockchain and maintain consensus. Restaking allows liquid staking tokens to be staked with validators in
Read More

ERC 404 Standard: Everything You Need to Know

Read Time: 7 minutes Introduction Ethereum has significantly shaped the crypto world with its introduction of smart contracts and decentralized applications (DApps). This has led to innovative developments in
Read More

DNS Attacks:  Cascading Effects and Mitigation Strategies

Read Time: 8 minutes Introduction DNS security is vital for a safe online space. DNS translates domain names to IP addresses, crucial for internet functionality. DNS ensures unique name-value
Read More

EIP-4844 Explained: The Key to Ethereum’s Scalability with Protodanksharding

Read Time: 7 minutes Introduction  Ethereum, the driving force behind dApps, has struggled with scalability. High fees and slow processing have limited its potential. They have kept it from
Read More

QuillAudits Powers Supermoon at ETH Denver!

Read Time: 4 minutes Calling all the brightest minds and leaders in the crypto world! Are you ready to build, connect, and innovate at the hottest event during ETH
Read More

Decoding the Role of Artificial Intelligence in Metaverse and Web3

Read Time: 7 minutes Introduction  Experts predict a transformative shift in global software, driven by AI and ML, marking the dawn of a new era. PwC predicts AI will
Read More

Transforming Assets: Unlocking Real-World Asset Tokenization

Read Time: 7 minutes In the blockchain, real-world assets (RWAs) are digital tokens that stand for tangible and conventional financial assets, including money, raw materials, stocks, and bonds. As
Read More
Scroll to Top

Become a Quiffiliate!
Join our mission to safeguard web3

Sounds Interesting, Right? All you have to do is:


Refer QuillAudits to Web3 projects for audits.


Earn rewards as we conclude the audits.


Thereby help us Secure web3 ecosystem.

Total Rewards Shared Out: $200K+