2018-09-30 12:35:52 -04:00
# Quick Start
2018-01-09 20:35:47 +00:00
## Overview
2018-04-09 15:42:19 +02:00
This is a quick start guide. If you have a vague idea about how Tendermint
2018-07-05 16:06:11 -04:00
works and want to get started right away, continue.
2018-01-09 20:35:47 +00:00
## Install
### Quick Install
2018-09-30 12:35:52 -04:00
To quickly get Tendermint installed on a fresh
Ubuntu 16.04 machine, use [this script ](https://git.io/fFfOR ).
WARNING: do not run this on your local machine.
2018-01-09 20:35:47 +00:00
```
2018-07-03 18:59:41 -04:00
curl -L https://git.io/fFfOR | bash
2018-01-09 20:35:47 +00:00
source ~/.profile
```
The script is also used to facilitate cluster deployment below.
### Manual Install
2018-09-30 12:35:52 -04:00
For manual installation, see the [install instructions ](install.md )
2018-08-07 18:40:11 -04:00
2018-01-09 20:35:47 +00:00
## Initialization
Running:
```
tendermint init
```
will create the required files for a single, local node.
These files are found in `$HOME/.tendermint` :
```
$ ls $HOME/.tendermint
config.toml data genesis.json priv_validator.json
```
For a single, local node, no further configuration is required.
Configuring a cluster is covered further below.
## Local Node
Start tendermint with a simple in-process application:
```
2018-02-27 14:01:10 +00:00
tendermint node --proxy_app=kvstore
2018-01-09 20:35:47 +00:00
```
and blocks will start to stream in:
```
I[01-06|01:45:15.592] Executed block module=state height=1 validTxs=0 invalidTxs=0
I[01-06|01:45:15.624] Committed state module=state height=1 txs=0 appHash=
```
Check the status with:
```
2018-06-12 02:25:52 -07:00
curl -s localhost:26657/status
2018-01-09 20:35:47 +00:00
```
### Sending Transactions
2018-02-27 14:01:10 +00:00
With the kvstore app running, we can send transactions:
2018-01-09 20:35:47 +00:00
```
2018-06-12 02:25:52 -07:00
curl -s 'localhost:26657/broadcast_tx_commit?tx="abcd"'
2018-01-09 20:35:47 +00:00
```
and check that it worked with:
```
2018-06-12 02:25:52 -07:00
curl -s 'localhost:26657/abci_query?data="abcd"'
2018-01-09 20:35:47 +00:00
```
2018-01-20 14:54:59 -05:00
We can send transactions with a key and value too:
2018-01-09 20:35:47 +00:00
```
2018-06-12 02:25:52 -07:00
curl -s 'localhost:26657/broadcast_tx_commit?tx="name=satoshi"'
2018-01-09 20:35:47 +00:00
```
and query the key:
```
2018-06-12 02:25:52 -07:00
curl -s 'localhost:26657/abci_query?data="name"'
2018-01-09 20:35:47 +00:00
```
where the value is returned in hex.
## Cluster of Nodes
2018-04-09 15:42:19 +02:00
First create four Ubuntu cloud machines. The following was tested on Digital
Ocean Ubuntu 16.04 x64 (3GB/1CPU, 20GB SSD). We'll refer to their respective IP
addresses below as IP1, IP2, IP3, IP4.
2018-01-09 20:35:47 +00:00
2018-07-03 18:59:41 -04:00
Then, `ssh` into each machine, and execute [this script ](https://git.io/fFfOR ):
2018-01-09 20:35:47 +00:00
```
2018-07-03 18:59:41 -04:00
curl -L https://git.io/fFfOR | bash
2018-01-09 20:35:47 +00:00
source ~/.profile
```
This will install `go` and other dependencies, get the Tendermint source code, then compile the `tendermint` binary.
2018-07-03 18:59:41 -04:00
Next, use the `tendermint testnet` command to create four directories of config files (found in `./mytestnet` ) and copy each directory to the relevant machine in the cloud, so that each machine has `$HOME/mytestnet/node[0-3]` directory. Then from each machine, run:
2018-01-09 20:35:47 +00:00
```
2018-07-05 16:06:11 -04:00
tendermint node --home ./mytestnet/node0 --proxy_app=kvstore --p2p.persistent_peers="ID1@IP1:26656 ,ID2@IP2:26656 ,ID3@IP3:26656 ,ID4@IP4:26656 "
tendermint node --home ./mytestnet/node1 --proxy_app=kvstore --p2p.persistent_peers="ID1@IP1:26656 ,ID2@IP2:26656 ,ID3@IP3:26656 ,ID4@IP4:26656 "
tendermint node --home ./mytestnet/node2 --proxy_app=kvstore --p2p.persistent_peers="ID1@IP1:26656 ,ID2@IP2:26656 ,ID3@IP3:26656 ,ID4@IP4:26656 "
tendermint node --home ./mytestnet/node3 --proxy_app=kvstore --p2p.persistent_peers="ID1@IP1:26656 ,ID2@IP2:26656 ,ID3@IP3:26656 ,ID4@IP4:26656 "
2018-01-09 20:35:47 +00:00
```
2018-04-09 15:42:19 +02:00
Note that after the third node is started, blocks will start to stream in
because >2/3 of validators (defined in the `genesis.json` ) have come online.
2018-08-07 18:40:11 -04:00
Seeds can also be specified in the `config.toml` . See [here ](../tendermint-core/configuration.md ) for more information about configuration options.
2018-01-09 20:35:47 +00:00
Transactions can then be sent as covered in the single, local node example above.