docs: small improvements (#2933)

* update docs

- make install_c cmd (install)
- explain node IDs (quick-start)
- update UPGRADING section (using-tendermint)

* use git clone with JS example

JS devs may not have Go installed and we should not force them to.

* rewrite sentence
This commit is contained in:
Anton Kaliaev 2018-11-28 17:25:23 +04:00 committed by Ethan Buchman
parent 1abf34aa91
commit ef9902e602
6 changed files with 56 additions and 35 deletions

View File

@ -32,6 +32,9 @@ build_race:
install: install:
CGO_ENABLED=0 go install $(BUILD_FLAGS) -tags $(BUILD_TAGS) ./cmd/tendermint CGO_ENABLED=0 go install $(BUILD_FLAGS) -tags $(BUILD_TAGS) ./cmd/tendermint
install_c:
CGO_ENABLED=1 go install $(BUILD_FLAGS) -tags "$(BUILD_TAGS) gcc" ./cmd/tendermint
######################################## ########################################
### Protobuf ### Protobuf
@ -328,4 +331,4 @@ build-slate:
# To avoid unintended conflicts with file names, always add to .PHONY # To avoid unintended conflicts with file names, always add to .PHONY
# unless there is a reason not to. # unless there is a reason not to.
# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html # https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
.PHONY: check build build_race build_abci dist install install_abci check_dep check_tools get_tools get_dev_tools update_tools get_vendor_deps draw_deps get_protoc protoc_abci protoc_libs gen_certs clean_certs grpc_dbserver test_cover test_apps test_persistence test_p2p test test_race test_integrations test_release test100 vagrant_test fmt rpc-docs build-linux localnet-start localnet-stop build-docker build-docker-localnode sentry-start sentry-config sentry-stop build-slate protoc_grpc protoc_all .PHONY: check build build_race build_abci dist install install_abci check_dep check_tools get_tools get_dev_tools update_tools get_vendor_deps draw_deps get_protoc protoc_abci protoc_libs gen_certs clean_certs grpc_dbserver test_cover test_apps test_persistence test_p2p test test_race test_integrations test_release test100 vagrant_test fmt rpc-docs build-linux localnet-start localnet-stop build-docker build-docker-localnode sentry-start sentry-config sentry-stop build-slate protoc_grpc protoc_all build_c install_c

View File

@ -11,13 +11,10 @@ Make sure you [have Go installed](https://golang.org/doc/install).
Next, install the `abci-cli` tool and example applications: Next, install the `abci-cli` tool and example applications:
``` ```
go get github.com/tendermint/tendermint mkdir -p $GOPATH/src/github.com/tendermint
``` cd $GOPATH/src/github.com/tendermint
git clone https://github.com/tendermint/tendermint.git
to get vendored dependencies: cd tendermint
```
cd $GOPATH/src/github.com/tendermint/tendermint
make get_tools make get_tools
make get_vendor_deps make get_vendor_deps
make install_abci make install_abci

View File

@ -252,12 +252,11 @@ we'll run a Javascript version of the `counter`. To run it, you'll need
to [install node](https://nodejs.org/en/download/). to [install node](https://nodejs.org/en/download/).
You'll also need to fetch the relevant repository, from You'll also need to fetch the relevant repository, from
[here](https://github.com/tendermint/js-abci) then install it. As go [here](https://github.com/tendermint/js-abci), then install it:
devs, we keep all our code under the `$GOPATH`, so run:
``` ```
go get github.com/tendermint/js-abci &> /dev/null git clone https://github.com/tendermint/js-abci.git
cd $GOPATH/src/github.com/tendermint/js-abci/example cd js-abci/example
npm install npm install
cd .. cd ..
``` ```
@ -276,13 +275,16 @@ tendermint node
``` ```
Once again, you should see blocks streaming by - but now, our Once again, you should see blocks streaming by - but now, our
application is written in javascript! Try sending some transactions, and application is written in Javascript! Try sending some transactions, and
like before - the results should be the same: like before - the results should be the same:
``` ```
curl localhost:26657/broadcast_tx_commit?tx=0x00 # ok # ok
curl localhost:26657/broadcast_tx_commit?tx=0x05 # invalid nonce curl localhost:26657/broadcast_tx_commit?tx=0x00
curl localhost:26657/broadcast_tx_commit?tx=0x01 # ok # invalid nonce
curl localhost:26657/broadcast_tx_commit?tx=0x05
# ok
curl localhost:26657/broadcast_tx_commit?tx=0x01
``` ```
Neat, eh? Neat, eh?

View File

@ -79,11 +79,9 @@ make install
Install [LevelDB](https://github.com/google/leveldb) (minimum version is 1.7). Install [LevelDB](https://github.com/google/leveldb) (minimum version is 1.7).
Build Tendermint with C libraries: `make build_c`.
### Ubuntu ### Ubuntu
Install LevelDB with snappy: Install LevelDB with snappy (optionally):
``` ```
sudo apt-get update sudo apt-get update
@ -112,5 +110,13 @@ db_backend = "cleveldb"
To install Tendermint, run To install Tendermint, run
``` ```
CGO_LDFLAGS="-lsnappy" go install -ldflags "-X github.com/tendermint/tendermint/version.GitCommit=`git rev-parse --short=8 HEAD`" -tags "tendermint gcc" -o build/tendermint ./cmd/tendermint/ CGO_LDFLAGS="-lsnappy" make install_c
``` ```
or run
```
CGO_LDFLAGS="-lsnappy" make build_c
```
to put the binary in `./build`.

View File

@ -40,7 +40,11 @@ These files are found in `$HOME/.tendermint`:
``` ```
$ ls $HOME/.tendermint $ ls $HOME/.tendermint
config.toml data genesis.json priv_validator.json config data
$ ls $HOME/.tendermint/config/
config.toml genesis.json node_key.json priv_validator.json
``` ```
For a single, local node, no further configuration is required. For a single, local node, no further configuration is required.
@ -110,7 +114,18 @@ source ~/.profile
This will install `go` and other dependencies, get the Tendermint source code, then compile the `tendermint` binary. This will install `go` and other dependencies, get the Tendermint source code, then compile the `tendermint` binary.
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: 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.
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.
```
tendermint show_node_id --home ./mytestnet/node0
tendermint show_node_id --home ./mytestnet/node1
tendermint show_node_id --home ./mytestnet/node2
tendermint show_node_id --home ./mytestnet/node3
```
Finally, from each machine, run:
``` ```
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/node0 --proxy_app=kvstore --p2p.persistent_peers="ID1@IP1:26656,ID2@IP2:26656,ID3@IP3:26656,ID4@IP4:26656"
@ -121,6 +136,6 @@ tendermint node --home ./mytestnet/node3 --proxy_app=kvstore --p2p.persistent_pe
Note that after the third node is started, blocks will start to stream in 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. because >2/3 of validators (defined in the `genesis.json`) have come online.
Seeds can also be specified in the `config.toml`. See [here](../tendermint-core/configuration.md) for more information about configuration options. Persistent peers can also be specified in the `config.toml`. See [here](../tendermint-core/configuration.md) for more information about configuration options.
Transactions can then be sent as covered in the single, local node example above. Transactions can then be sent as covered in the single, local node example above.

View File

@ -519,18 +519,16 @@ developers guide](../app-dev/app-development.md) for more details.
### Local Network ### Local Network
To run a network locally, say on a single machine, you must change the To run a network locally, say on a single machine, you must change the `_laddr`
`_laddr` fields in the `config.toml` (or using the flags) so that the fields in the `config.toml` (or using the flags) so that the listening
listening addresses of the various sockets don't conflict. Additionally, addresses of the various sockets don't conflict. Additionally, you must set
you must set `addr_book_strict=false` in the `config.toml`, otherwise `addr_book_strict=false` in the `config.toml`, otherwise Tendermint's p2p
Tendermint's p2p library will deny making connections to peers with the library will deny making connections to peers with the same IP address.
same IP address.
### Upgrading ### Upgrading
The Tendermint development cycle currently includes a lot of breaking changes. See the
Upgrading from an old version to a new version usually means throwing [UPGRADING.md](https://github.com/tendermint/tendermint/blob/master/UPGRADING.md)
away the chain data. Try out the guide. You may need to reset your chain between major breaking releases.
[tm-migrate](https://github.com/hxzqlh/tm-tools) tool written by Although, we expect Tendermint to have fewer breaking releases in the future
[@hxzqlh](https://github.com/hxzqlh) if you are keen to preserve the (especially after 1.0 release).
state of your chain when upgrading to newer versions.