github.com/okex/exchain@v1.8.0/libs/tendermint/docs/introduction/quick-start.md (about) 1 --- 2 order: 2 3 --- 4 5 # Quick Start 6 7 ## Overview 8 9 This is a quick start guide. If you have a vague idea about how <df value="tendermint">Tendermint</df> 10 works and want to get started right away, continue. 11 12 ## Install 13 14 ### Quick Install 15 16 To quickly get Tendermint installed on a fresh 17 Ubuntu 16.04 machine, use [this script](https://git.io/fFfOR). 18 19 WARNING: do not run this on your local machine. 20 21 ``` 22 curl -L https://git.io/fFfOR | bash 23 source ~/.profile 24 ``` 25 26 The script is also used to facilitate cluster deployment below. 27 28 ### Manual Install 29 30 For manual installation, see the [install instructions](install.md) 31 32 ## Initialization 33 34 Running: 35 36 ``` 37 tendermint init 38 ``` 39 40 will create the required files for a single, local node. 41 42 These files are found in `$HOME/.tendermint`: 43 44 ``` 45 $ ls $HOME/.tendermint 46 47 config data 48 49 $ ls $HOME/.tendermint/config/ 50 51 config.toml genesis.json node_key.json priv_validator.json 52 ``` 53 54 For a single, local node, no further configuration is required. 55 Configuring a cluster is covered further below. 56 57 ## Local Node 58 59 Start tendermint with a simple in-process application: 60 61 ``` 62 tendermint node --proxy_app=kvstore 63 ``` 64 65 and blocks will start to stream in: 66 67 ``` 68 I[01-06|01:45:15.592] Executed block module=state height=1 validTxs=0 invalidTxs=0 69 I[01-06|01:45:15.624] Committed state module=state height=1 txs=0 appHash= 70 ``` 71 72 Check the status with: 73 74 ``` 75 curl -s localhost:26657/status 76 ``` 77 78 ### Sending Transactions 79 80 With the kvstore app running, we can send transactions: 81 82 ``` 83 curl -s 'localhost:26657/broadcast_tx_commit?tx="abcd"' 84 ``` 85 86 and check that it worked with: 87 88 ``` 89 curl -s 'localhost:26657/abci_query?data="abcd"' 90 ``` 91 92 We can send transactions with a key and value too: 93 94 ``` 95 curl -s 'localhost:26657/broadcast_tx_commit?tx="name=satoshi"' 96 ``` 97 98 and query the key: 99 100 ``` 101 curl -s 'localhost:26657/abci_query?data="name"' 102 ``` 103 104 where the value is returned in hex. 105 106 ## Cluster of Nodes 107 108 First create four Ubuntu cloud machines. The following was tested on Digital 109 Ocean Ubuntu 16.04 x64 (3GB/1CPU, 20GB SSD). We'll refer to their respective IP 110 addresses below as IP1, IP2, IP3, IP4. 111 112 Then, `ssh` into each machine, and execute [this script](https://git.io/fFfOR): 113 114 ``` 115 curl -L https://git.io/fFfOR | bash 116 source ~/.profile 117 ``` 118 119 This will install `go` and other dependencies, get the Tendermint source code, then compile the `tendermint` binary. 120 121 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. 122 123 Before you can start the network, you'll need peers identifiers (IPs are not enough and can change). We'll refer to them as ID1, ID2, ID3, ID4. 124 125 ``` 126 tendermint show_node_id --home ./mytestnet/node0 127 tendermint show_node_id --home ./mytestnet/node1 128 tendermint show_node_id --home ./mytestnet/node2 129 tendermint show_node_id --home ./mytestnet/node3 130 ``` 131 132 Finally, from each machine, run: 133 134 ``` 135 tendermint node --home ./mytestnet/node0 --proxy_app=kvstore --p2p.persistent_peers="ID1@IP1:26656,ID2@IP2:26656,ID3@IP3:26656,ID4@IP4:26656" 136 tendermint node --home ./mytestnet/node1 --proxy_app=kvstore --p2p.persistent_peers="ID1@IP1:26656,ID2@IP2:26656,ID3@IP3:26656,ID4@IP4:26656" 137 tendermint node --home ./mytestnet/node2 --proxy_app=kvstore --p2p.persistent_peers="ID1@IP1:26656,ID2@IP2:26656,ID3@IP3:26656,ID4@IP4:26656" 138 tendermint node --home ./mytestnet/node3 --proxy_app=kvstore --p2p.persistent_peers="ID1@IP1:26656,ID2@IP2:26656,ID3@IP3:26656,ID4@IP4:26656" 139 ``` 140 141 Note that after the third node is started, blocks will start to stream in 142 because >2/3 of validators (defined in the `genesis.json`) have come online. 143 Persistent peers can also be specified in the `config.toml`. See [here](../tendermint-core/configuration.md) for more information about configuration options. 144 145 Transactions can then be sent as covered in the single, local node example above.