README.md 18.4 KB
Newer Older
D
Daniel Larimer 已提交
1
# EOS.IO - The Most Powerful Infrastructure for Decentralized Applications
N
Nathan Hourt 已提交
2

peterwillcn's avatar
peterwillcn 已提交
3 4
[![Build Status](https://travis-ci.org/EOSIO/eos.svg?branch=master)](https://travis-ci.org/EOSIO/eos)

D
Daniel Larimer 已提交
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
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).  

# Resources
1. [EOS.IO Website](https://eos.io)
2. [Blog](https://steemit.com/@eosio)
2. [Roadmap](https://github.com/EOSIO/Documentation/blob/master/Roadmap.md)
3. [Telegram](https://eos.io/chat)
4. [Documentation](https://eosio.github.io/eos/)
5. [White Paper](https://github.com/EOSIO/Documentation/blob/master/TechnicalWhitePaper.md)
N
Nathan Hourt 已提交
20

21 22 23
# Table of contents

1. [Getting Started](#gettingstarted)
S
Serg Metelin 已提交
24
2. [Setting up a build/development environment](#setup)
25
	1. [Automated build script](#autobuild)
S
Serg Metelin 已提交
26
	    1. [Clean install Ubuntu 16.10](#autoubuntu)
27 28 29 30
	    2. [macOS Sierra 10.12.6](#automac)
	2. [Manual installation of the dependencies](#manualdep)
        1. [Clean install Ubuntu 16.10](#ubuntu)
        2. [macOS Sierra 10.12.6](#macos)
S
Serg Metelin 已提交
31
3. [Building EOS and running a node](#runanode)
32 33 34
	1. [Getting the code](#getcode)
	2. [Building from source code](#build)
	3. [Creating and launching a single-node testnet](#singlenode)
S
Sandwich 已提交
35 36
4. [Example Currency Contract Walkthrough](#smartcontracts)
	1. [Example Contracts](#smartcontractexample)
37 38 39
	2. [Setting up a wallet and importing account key](#walletimport)
	3. [Creating accounts for your smart contracts](#createaccounts)
	4. [Upload sample contract to blockchain](#uploadsmartcontract)
40
	5. [Pushing a message to a sample contract](#pushamessage)
41 42
	6. [Reading Currency Contract Balance](#readingcontract)
5. [Running local testnet](#localtestnet)
S
Serg Metelin 已提交
43 44
6. [Doxygen documentation](#doxygen)
7. [Running EOS in Docker](#docker)
45

S
Serg Metelin 已提交
46 47
<a name="gettingstarted"></a>
## Getting Started
48
The following instructions overview the process of getting the software, building it, running a simple test network that produces blocks, account creation and uploading a sample contract to the blockchain.
N
Nathan Hourt 已提交
49

S
Serg Metelin 已提交
50 51
<a name="setup"></a>
## Setting up a build/development environment
52

53 54 55 56 57
<a name="autobuild"></a>
### Automated build script

For Ubuntu 16.10 and macOS Sierra, there is an automated build script that can install all dependencies and builds EOS.

58 59 60 61
Clone EOS repository recursively as below and run build.sh located in root `eos` folder.

<a name="autoubuntu"></a>
#### Clean install Ubuntu 16.10 
62 63 64 65 66

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

cd eos
S
Sandwich 已提交
67
./build.sh ubuntu 
68 69
```

70 71
Now you can proceed to the next step - [Creating and launching a single-node testnet](#singlenode)

72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
<a name="automac"></a>
#### macOS Sierra

Before running the script make sure you have updated XCode and brew:

```bash
xcode-select --install
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
```

```bash
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](#singlenode)

<a name="manualdep"></a>
### Manual installation of the dependencies

If you prefer to manually build dependencies - follow the steps below.
95

96 97 98 99 100 101 102 103 104 105 106
This project is written primarily in C++14 and uses CMake as its build system. An up-to-date Clang and the latest version of CMake is recommended.

Dependencies:

* Clang 4.0.0
* CMake 3.5.1
* Boost 1.64
* OpenSSL
* LLVM 4.0
* [secp256k1-zkp (Cryptonomex branch)](https://github.com/cryptonomex/secp256k1-zkp.git)
* [binaryen](https://github.com/WebAssembly/binaryen.git)
107

S
Serg Metelin 已提交
108
<a name="ubuntu"></a>
109
#### Clean install Ubuntu 16.10 
110 111 112

Install the development toolkit:

113
```bash
114
sudo apt-get update
115 116 117
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo apt-get install clang-4.0 lldb-4.0 cmake make \
                     libbz2-dev libssl-dev libgmp3-dev \
118
                     autotools-dev build-essential \
119
                     libbz2-dev libicu-dev python-dev \
120 121 122 123 124
                     autoconf libtool git
```

Install Boost 1.64:

125
```bash
126 127 128 129
cd ~
wget -c 'https://sourceforge.net/projects/boost/files/boost/1.64.0/boost_1_64_0.tar.bz2/download' -O boost_1.64.0.tar.bz2
tar xjf boost_1.64.0.tar.bz2
cd boost_1_64_0/
S
Serg Metelin 已提交
130 131
echo "export BOOST_ROOT=$HOME/opt/boost_1_64_0" >> ~/.bash_profile
source ~/.bash_profile
132 133
./bootstrap.sh "--prefix=$BOOST_ROOT"
./b2 install
S
Serg Metelin 已提交
134
source ~/.bash_profile
135 136
```

137 138
Install [secp256k1-zkp (Cryptonomex branch)](https://github.com/cryptonomex/secp256k1-zkp.git):
        
139
```bash
140 141 142 143 144 145 146 147 148
cd ~
git clone https://github.com/cryptonomex/secp256k1-zkp.git
cd secp256k1-zkp
./autogen.sh
./configure
make
sudo make install
```

149
To use the WASM compiler, EOS has an external dependency on [binaryen](https://github.com/WebAssembly/binaryen.git):
S
Serg Metelin 已提交
150

151
```bash
S
Serg Metelin 已提交
152 153 154 155 156 157 158 159
cd ~
git clone https://github.com/WebAssembly/binaryen.git
cd ~/binaryen
git checkout tags/1.37.14
cmake . && make

```

L
Liu-Cheng Xu 已提交
160
Add `BINARYEN_ROOT` to your .bash_profile:
S
Serg Metelin 已提交
161

162
```bash
S
Serg Metelin 已提交
163 164 165
echo "export BINARYEN_ROOT=~/binaryen" >> ~/.bash_profile
source ~/.bash_profile
```
D
Daniel Larimer 已提交
166

S
Serg Metelin 已提交
167
By default LLVM and clang do not include the WASM build target, so you will have to build it yourself:
168

169
```bash
170 171 172 173 174 175 176 177 178 179
mkdir  ~/wasm-compiler
cd ~/wasm-compiler
git clone --depth 1 --single-branch --branch release_40 https://github.com/llvm-mirror/llvm.git
cd llvm/tools
git clone --depth 1 --single-branch --branch release_40 https://github.com/llvm-mirror/clang.git
cd ..
mkdir build
cd build
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=.. -DLLVM_TARGETS_TO_BUILD= -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly -DCMAKE_BUILD_TYPE=Release ../
make -j4 install
180
```
181

S
Serg Metelin 已提交
182 183
Your environment is set up. Now you can <a href="#runanode">build EOS and run a node</a>. 

S
Serg Metelin 已提交
184
<a name="macos"></a>
185
#### macOS Sierra 10.12.6 
186 187

macOS additional Dependencies:
S
Serg Metelin 已提交
188

189 190 191 192 193
* Brew
* Newest XCode

Upgrade your XCode to the newest version:

194
```bash
195
xcode-select --install
196 197
```

198
Install homebrew:
199

200
```bash
201 202 203 204 205
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
```

Install the dependencies:

206
```bash
207
brew update
S
Serg Metelin 已提交
208
brew install git automake libtool boost openssl llvm@4 gmp
209
```
210

211 212
Install [secp256k1-zkp (Cryptonomex branch)](https://github.com/cryptonomex/secp256k1-zkp.git):
        
213
```bash
214 215 216 217 218 219 220
cd ~
git clone https://github.com/cryptonomex/secp256k1-zkp.git
cd secp256k1-zkp
./autogen.sh
./configure
make
sudo make install
221
```
222

S
Serg Metelin 已提交
223 224
Install [binaryen v1.37.14](https://github.com/WebAssembly/binaryen.git):

225
```bash
S
Serg Metelin 已提交
226 227 228 229 230 231 232
cd ~
git clone https://github.com/WebAssembly/binaryen.git
cd ~/binaryen
git checkout tags/1.37.14
cmake . && make
```

L
Liu-Cheng Xu 已提交
233
Add `BINARYEN_ROOT` to your .bash_profile:
S
Serg Metelin 已提交
234

235
```bash
S
Serg Metelin 已提交
236 237 238 239 240
echo "export BINARYEN_ROOT=~/binaryen" >> ~/.bash_profile
source ~/.bash_profile
```


241 242
Build LLVM and clang for WASM:

243
```bash
244 245 246 247 248 249 250 251 252 253 254 255
mkdir  ~/wasm-compiler
cd ~/wasm-compiler
git clone --depth 1 --single-branch --branch release_40 https://github.com/llvm-mirror/llvm.git
cd llvm/tools
git clone --depth 1 --single-branch --branch release_40 https://github.com/llvm-mirror/clang.git
cd ..
mkdir build
cd build
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=.. -DLLVM_TARGETS_TO_BUILD= -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly -DCMAKE_BUILD_TYPE=Release ../
make -j4 install
```

S
Serg Metelin 已提交
256
Add `WASM_LLVM_CONFIG` and `LLVM_DIR` to your `.bash_profile`:
257

258
```bash
259 260
echo "export WASM_LLVM_CONFIG=~/wasm-compiler/llvm/bin/llvm-config" >> ~/.bash_profile
echo "export LLVM_DIR=/usr/local/Cellar/llvm/4.0.1/lib/cmake/llvm" >> ~/.bash_profile
S
Serg Metelin 已提交
261
source ~/.bash_profile
262 263
```

S
Serg Metelin 已提交
264
<a name="runanode"></a>
S
Serg Metelin 已提交
265
## Building EOS and running a node 
S
Serg Metelin 已提交
266

S
Serg Metelin 已提交
267 268
<a name="getcode"></a>
### Getting the code 
S
Serg Metelin 已提交
269

270
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:
N
Nathan Hourt 已提交
271

272 273 274
```bash
git clone https://github.com/eosio/eos --recursive
```
N
Nathan Hourt 已提交
275 276 277

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:

278 279 280
```bash
git submodule update --init --recursive
```
N
Nathan Hourt 已提交
281

S
Serg Metelin 已提交
282 283
<a name="build"></a>
### Building from source code 
284

285 286
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.
287

288
```bash
S
Serg Metelin 已提交
289
cd ~
290
git clone https://github.com/eosio/eos --recursive
S
Serg Metelin 已提交
291
mkdir -p ~/eos/build && cd ~/eos/build
J
jaehong park 已提交
292
cmake -DBINARYEN_BIN=~/binaryen/bin -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib ..
293 294 295 296
make -j4
```

Out-of-source builds are also supported. To override clang's default choice in compiler, add these flags to the CMake command:
N
Nathan Hourt 已提交
297 298 299 300 301

`-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`.

302
To run the test suite after building, run the `chain_test` executable in the `tests` folder.
N
Nathan Hourt 已提交
303

S
Serg Metelin 已提交
304 305 306 307 308
EOS comes with a number of programs you can find in `~/eos/build/programs`. They are listed below:

* eosd - server-side blockchain node component
* eosc - command line interface to interact with the blockchain
* eos-walletd - EOS wallet
S
Serg Metelin 已提交
309
* launcher - application for nodes network composing and deployment; [more on launcher](https://github.com/EOSIO/eos/blob/master/testnet.md)
S
Serg Metelin 已提交
310

S
Serg Metelin 已提交
311 312
<a name="singlenode"></a>
### Creating and launching a single-node testnet 
S
Serg Metelin 已提交
313

L
Liu-Cheng Xu 已提交
314
After successfully building the project, the `eosd` binary should be present in the `programs/eosd` directory. Go ahead and run `eosd` -- it will probably exit with an error, but if not, close it immediately with <kbd>Ctrl-C</kbd>. Note that `eosd` 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 `eosd`.
N
Nathan Hourt 已提交
315

N
Nathan Hourt 已提交
316
Edit the `config.ini` file, adding the following settings to the defaults already in place:
N
Nathan Hourt 已提交
317 318

```
N
Nathan Hourt 已提交
319 320 321 322 323
# 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
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344
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
S
Serg Metelin 已提交
345
# Load the block producer plugin, so you can produce blocks
N
Nathan Hourt 已提交
346
plugin = eos::producer_plugin
S
Serg Metelin 已提交
347
# Wallet plugin
348
plugin = eos::wallet_api_plugin
S
Serg Metelin 已提交
349
# As well as API and HTTP plugins
350 351
plugin = eos::chain_api_plugin
plugin = eos::http_plugin
N
Nathan Hourt 已提交
352 353
```

354
Now it should be possible to run `eosd` and see it begin producing blocks.
peterwillcn's avatar
peterwillcn 已提交
355

S
Serg Metelin 已提交
356 357 358 359 360 361 362 363 364 365 366 367 368 369
When running `eosd` 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
1581001ms thread-0   chain_controller.cpp:235      _push_block          ] initd #3 @2017-09-04T04:26:21  | 0 trx, 0 pending, exectime_ms=0
1581001ms thread-0   producer_plugin.cpp:207       block_production_loo ] initd generated block #3 @ 2017-09-04T04:26:21 with 0 trxs  0 pending
1584000ms thread-0   chain_controller.cpp:235      _push_block          ] inite #4 @2017-09-04T04:26:24  | 0 trx, 0 pending, exectime_ms=0
1584000ms thread-0   producer_plugin.cpp:207       block_production_loo ] inite generated block #4 @ 2017-09-04T04:26:24 with 0 trxs  0 pending
1587000ms thread-0   chain_controller.cpp:235      _push_block          ] initf #5 @2017-09-04T04:26:27  | 0 trx, 0 pending, exectime_ms=0
```

S
Sandwich 已提交
370
<a name="accountssmartcontracts"></a>
S
Sandwich 已提交
371
## Example "Currency" Contract Walkthrough
S
Serg Metelin 已提交
372

S
Sandwich 已提交
373
EOS comes with example contracts that can be uploaded and run for testing purposes. Below is demonstrated how to upload and interact with the sample contract "currency". 
S
Serg Metelin 已提交
374

S
Serg Metelin 已提交
375
<a name="smartcontractexample"></a>
S
Sandwich 已提交
376
### Example smart contracts
377

S
Sandwich 已提交
378
First, run the node
S
Serg Metelin 已提交
379

380
```bash
S
Serg Metelin 已提交
381
cd ~/eos/build/programs/eosd/
S
Serg Metelin 已提交
382
./eosd
S
Serg Metelin 已提交
383
```
384

S
Serg Metelin 已提交
385 386
<a name="walletimport"></a>
### Setting up a wallet and importing account key 
S
Serg Metelin 已提交
387

S
Sandwich 已提交
388
As you've previously added `plugin = eos::wallet_api_plugin` into `config.ini`, EOS wallet will be running as a part of `eosd` process. Every contract requires an associated account, so first, create a wallet.
S
Serg Metelin 已提交
389

390
```bash
S
Serg Metelin 已提交
391
cd ~/eos/build/programs/eosc/
392
./eosc wallet create # Outputs a password that you need to save to be able to lock/unlock the wallet
S
Serg Metelin 已提交
393 394
```

S
Sandwich 已提交
395
For the purpose of this walkthrough, import the private key of the `inita` account, a test account included within genesis.json, so that you're able to issue API commands under authority of an existing account. The private key referenced below is found within your `config.ini` and is provided to you for testing purposes. 
S
Sandwich 已提交
396

S
Sandwich 已提交
397
```bash
S
Sandwich 已提交
398 399
./eosc wallet import 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3
```
S
Serg Metelin 已提交
400

S
Serg Metelin 已提交
401
<a name="createaccounts"></a>
S
Sandwich 已提交
402
### Creating accounts for sample "currency" contract
S
Serg Metelin 已提交
403

S
Sandwich 已提交
404
First, generate some public/private key pairs that will be later assigned as `owner_key` and `active_key`.
405

406
```bash
407
cd ~/eos/build/programs/eosc/
408 409
./eosc create key # owner_key
./eosc create key # active_key
410 411
```

S
Sandwich 已提交
412
This will output two pairs of public and private keys
413 414 415 416 417 418

```
Private key: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Public key:  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
```

S
Sandwich 已提交
419
**Important:**
420 421
Save the values for future reference.

S
Sandwich 已提交
422
Run the `create` command where `inita` is the account authorizing the creation of the `currency` account and `PUBLIC_KEY_1` and `PUBLIC_KEY_2` are the values generated by the `create key` command
423

424
```bash
425
./eosc create account inita currency PUBLIC_KEY_1 PUBLIC_KEY_2 
426 427
```

S
Sandwich 已提交
428
You should then get a json response back with a transaction ID confirming it was executed successfully.
429

S
Sandwich 已提交
430
Go ahead and check that the account was successfully created
431

432
```bash
S
Serg Metelin 已提交
433
./eosc get account currency
434 435
```

S
Sandwich 已提交
436
If all went well, you will receive output similar to the following
437 438 439

```json
{
S
Serg Metelin 已提交
440
  "name": "currency",
441 442 443 444 445 446 447
  "eos_balance": 0,
  "staked_balance": 1,
  "unstaking_balance": 0,
  "last_unstaking_time": "2106-02-07T06:28:15"
}
```

S
Sandwich 已提交
448
Now import the active private key generated previously in the wallet:
449 450 451 452 453

```bash
./eosc wallet import XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
```

S
Serg Metelin 已提交
454
<a name="uploadsmartcontract"></a>
S
Sandwich 已提交
455
### Upload sample "currency" contract to blockchain 
456

S
Sandwich 已提交
457
Before uploading a contract, verify that there is no current contract:
D
Daniel Larimer 已提交
458

459
```bash
D
Daniel Larimer 已提交
460 461 462 463
./eosc get code currency 
code hash: 0000000000000000000000000000000000000000000000000000000000000000
```

S
Sandwich 已提交
464
With an account for a contract created, upload a sample contract:
465

466
```bash
467
./eosc set contract currency ../../contracts/currency/currency.wast ../../contracts/currency/currency.abi
S
Serg Metelin 已提交
468 469 470 471
```

As a response you should get a json with a `transaction_id` field. Your contract was successfully uploaded!

S
Sandwich 已提交
472
You can also verify that the code has been set with the following command
D
Daniel Larimer 已提交
473

474
```bash
D
Daniel Larimer 已提交
475
./eosc get code currency
S
Sandwich 已提交
476 477 478 479
```

It will return something like
```bash
D
Daniel Larimer 已提交
480 481 482
code hash: 9b9db1a7940503a88535517049e64467a6e8f4e9e03af15e9968ec89dd794975
```

S
Sandwich 已提交
483
Next verify the currency contract has the proper initial balance:
D
Daniel Larimer 已提交
484

485
```bash
D
Daniel Larimer 已提交
486 487 488 489 490 491 492 493 494 495 496
./eosc get table currency currency account
{
  "rows": [{
     "account": "account",
     "balance": 1000000000
     }
  ],
  "more": false
}
```

S
Serg Metelin 已提交
497
<a name="pushamessage"></a>
S
Sandwich 已提交
498
### Pushing a message to sample "currency" contract 
S
Serg Metelin 已提交
499

S
Sandwich 已提交
500
Send a message from the **currency** account to account **inita** 
S
Serg Metelin 已提交
501

502
```bash
503
./eosc push message currency transfer '{"from":"currency","to":"inita","amount":50}' --scope currency,inita --permission currency@active
D
Daniel Larimer 已提交
504 505
```

S
Sandwich 已提交
506
As a confirmation of a successfully submitted transaction you will receive json output that includes a `transaction_id` field.
D
Daniel Larimer 已提交
507

S
Serg Metelin 已提交
508
<a name="readingcontract"></a>
S
Sandwich 已提交
509
### Reading sample "currency" contract balance 
510

S
Sandwich 已提交
511
So now check the state of both of the accounts involved in the previous transaction. 
D
Daniel Larimer 已提交
512

513
```bash
D
Daniel Larimer 已提交
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531
./eosc get table inita currency account
{
  "rows": [{
      "account": "account",
      "balance": 50 
       }
    ],
  "more": false
}
./eosc get table currency currency account
{
  "rows": [{
      "account": "account",
      "balance": 999999950
    }
  ],
  "more": false
}
S
Serg Metelin 已提交
532 533
```

S
Sandwich 已提交
534
As expected, the receiving account **inita** now has a balance of **50** tokens, and the sending account now has **50** less tokens than its initial supply. 
S
Sandwich 已提交
535

S
Serg Metelin 已提交
536 537
<a name="localtestnet"></a>
## Running local testnet 
S
Serg Metelin 已提交
538

S
Serg Metelin 已提交
539
To run a local testnet you can use a `launcher` application provided in `~/eos/build/programs/launcher` folder.
S
Serg Metelin 已提交
540

S
Serg Metelin 已提交
541
For testing purposes you will run 2 local production nodes talking to each other.
S
Serg Metelin 已提交
542

543
```bash
S
Serg Metelin 已提交
544 545
cd ~/eos/build
cp ../genesis.json ./
B
bitcoiners 已提交
546
./programs/launcher/launcher -p2 --skip-signature
S
Serg Metelin 已提交
547 548
```

549
This command will generate 2 data folders for each instance of the node: `tn_data_0` and `tn_data_1`.
S
Serg Metelin 已提交
550 551 552

You should see a following response:

553
```bash
S
Serg Metelin 已提交
554 555 556 557 558 559 560 561
adding hostname ip-XXX-XXX-XXX
found interface 127.0.0.1
found interface XXX.XX.XX.XX
spawning child, programs/eosd/eosd --skip-transaction-signatures --data-dir tn_data_0
spawning child, programs/eosd/eosd --skip-transaction-signatures --data-dir tn_data_1
```

To confirm the nodes are running, run following `eosc` commands:
562
```bash
S
Serg Metelin 已提交
563 564 565 566 567
~/eos/build/programs/eosc
./eosc -p 8888 get info
./eosc -p 8889 get info
```

S
Serg Metelin 已提交
568
For each you should get a json with a blockchain information.
S
Serg Metelin 已提交
569

S
Serg Metelin 已提交
570 571
You can read more on launcher and its settings [here](https://github.com/EOSIO/eos/blob/master/testnet.md)

S
Serg Metelin 已提交
572 573
<a name="doxygen"></a>
## Doxygen documentation 
S
Serg Metelin 已提交
574 575 576

You can find more detailed API documentation in Doxygen reference: https://eosio.github.io/eos/

S
Serg Metelin 已提交
577 578
<a name="docker"></a>
## Running EOS in Docker 
peterwillcn's avatar
peterwillcn 已提交
579

S
Sandwich 已提交
580
You can find up to date information about EOS Docker in the [Docker Readme](https://github.com/EOSIO/eos/blob/master/Docker/README.md)