Welcome to the EOS.IO source code repository! EOS.IO software enables developers to create and deploy high-performance, horizontally scalable, blockchain infrastructure upon which decentralized applications can be built.
This code is currently alpha-quality and under rapid development. That said, there is plenty early experimenters can do including, running a private multi-node test network and develop applications (smart contracts).
- EOS.IO Website
- Documentation
- Blog
- Community Telegram Group
- Developer Telegram Group
- White Paper
- Roadmap
- Getting Started
- Setting up a build/development environment
- Building EOS and running a node
- Example Currency Contract Walkthrough
- Running local testnet
- Doxygen documentation
- Running EOS in Docker
- Manual installation of the dependencies
The following instructions overview the process of getting the software, building it, running a simple test network that produces blocks, creating an account, and uploading a sample contract to the blockchain.
For Ubuntu 16.10 and MacOS Sierra, there is an automated build script that can install all dependencies and build EOS.
It is called build.sh with the following inputs:
- architecture [ubuntu|darwin]
- optional mode [full|build]
The second optional input can be full
or build
where full
implies that it installs dependencies and builds EOS. If you omit this input, then the build script will install dependencies and then builds EOS.
./build.sh <architecture> <optional mode>
Clone EOS repository recursively as below and run build.sh located in root eos
folder.
git clone https://github.com/eosio/eos --recursive
cd eos
./build.sh ubuntu
Now you can proceed to the next step - Creating and launching a single-node testnet
Before running the script, make sure you have updated XCode and Homebrew:
xcode-select --install
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
git clone https://github.com/eosio/eos --recursive
cd eos
./build.sh darwin
Now you can proceed to the next step - Creating and launching a single-node testnet
To download all of the code, download EOS source code and a recursion or two of submodules. The easiest way to get all of this is to do a recursive clone:
git clone https://github.com/eosio/eos --recursive
If a repo is cloned without the --recursive
flag, the submodules can be retrieved after the fact by running this command from within the repo:
git submodule update --init --recursive
The WASM_LLVM_CONFIG environment variable is used to find our recently built WASM compiler.
This is needed to compile the example contracts inside eos/contracts
folder and their respective tests.
cd ~
git clone https://github.com/eosio/eos --recursive
mkdir -p ~/eos/build && cd ~/eos/build
cmake -DBINARYEN_BIN=~/binaryen/bin -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib ..
make -j4
Out-of-source builds are also supported. To override clang's default choice in compiler, add these flags to the CMake command:
-DCMAKE_CXX_COMPILER=/path/to/c++ -DCMAKE_C_COMPILER=/path/to/cc
For a debug build, add -DCMAKE_BUILD_TYPE=Debug
. Other common build types include Release
and RelWithDebInfo
.
To run the test suite after building, run the chain_test
executable in the tests
folder.
EOS comes with a number of programs you can find in ~/eos/build/programs
. They are listed below:
- eosiod - server-side blockchain node component
- eosioc - command line interface to interact with the blockchain
- eos-walletd - EOS wallet
- launcher - application for nodes network composing and deployment; more on launcher
After successfully building the project, the eosiod
binary should be present in the build/programs/eosiod
directory. Go ahead and run eosiod
-- it will probably exit with an error, but if not, close it immediately with Ctrl-C. Note that eosiod
created a directory named data-dir
containing the default configuration (config.ini
) and some other internals. This default data storage path can be overridden by passing --data-dir /path/to/data
to eosiod
.
Edit the config.ini
file, adding the following settings to the defaults already in place:
# Load the testnet genesis state, which creates some initial block producers with the default key
genesis-json = /path/to/eos/source/genesis.json
# Enable production on a stale chain, since a single-node test chain is pretty much always stale
enable-stale-production = true
# Enable block production with the testnet producers
producer-name = inita
producer-name = initb
producer-name = initc
producer-name = initd
producer-name = inite
producer-name = initf
producer-name = initg
producer-name = inith
producer-name = initi
producer-name = initj
producer-name = initk
producer-name = initl
producer-name = initm
producer-name = initn
producer-name = inito
producer-name = initp
producer-name = initq
producer-name = initr
producer-name = inits
producer-name = initt
producer-name = initu
# Load the block producer plugin, so you can produce blocks
plugin = eosio::producer_plugin
# Wallet plugin
plugin = eosio::wallet_api_plugin
# As well as API and HTTP plugins
plugin = eosio::chain_api_plugin
plugin = eosio::http_plugin
Now it should be possible to run eosiod
and see it begin producing blocks.
When running eosiod
you should get log messages similar to below. It means the blocks are successfully produced.
1575001ms thread-0 chain_controller.cpp:235 _push_block ] initm #1 @2017-09-04T04:26:15 | 0 trx, 0 pending, exectime_ms=0
1575001ms thread-0 producer_plugin.cpp:207 block_production_loo ] initm generated block #1 @ 2017-09-04T04:26:15 with 0 trxs 0 pending
1578001ms thread-0 chain_controller.cpp:235 _push_block ] initc #2 @2017-09-04T04:26:18 | 0 trx, 0 pending, exectime_ms=0
1578001ms thread-0 producer_plugin.cpp:207 block_production_loo ] initc generated block #2 @ 2017-09-04T04:26:18 with 0 trxs 0 pending
...
EOS comes with example contracts that can be uploaded and run for testing purposes. Next we demonstrate how to upload and interact with the sample contract "currency".
First, run the node
cd ~/eos/build/programs/eosiod/
./eosiod
As you've previously added plugin = eosio::wallet_api_plugin
into config.ini
, EOS wallet will be running as a part of eosiod
process. Every contract requires an associated account, so first, create a wallet.
cd ~/eos/build/programs/eosioc/
./eosioc wallet create # Outputs a password that you need to save to be able to lock/unlock the wallet