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