From a42c58604d0116fc86189d2d6c5a83ea705be36a Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 3 Jul 2018 15:42:23 +0400 Subject: [PATCH] remove init_testnet script `tendermint testnet` cmd should be used instead Closes #1774 --- docs/deploy-testnets.md | 39 +++++++++++--------- docs/examples/init_testnet.sh | 69 ----------------------------------- 2 files changed, 22 insertions(+), 86 deletions(-) delete mode 100644 docs/examples/init_testnet.sh diff --git a/docs/deploy-testnets.md b/docs/deploy-testnets.md index e5b300836..334739e50 100644 --- a/docs/deploy-testnets.md +++ b/docs/deploy-testnets.md @@ -23,11 +23,12 @@ Here are the steps to setting up a testnet manually: 4) Compile a list of public keys for each validator into a `genesis.json` file and replace the existing file with it. 5) Run - `tendermint node --proxy_app=kvstore --p2p.persistent_peers=< peer addresses >` - on each node, where `< peer addresses >` is a comma separated list - of the IP:PORT combination for each node. The default port for - Tendermint is `26656`. Thus, if the IP addresses of your nodes were - `192.168.0.1, 192.168.0.2, 192.168.0.3, 192.168.0.4`, the command + `tendermint node --proxy_app=kvstore --p2p.persistent_peers=< peer + addresses >` on each node, where `< peer addresses >` is a comma separated + list of the ID@IP:PORT combination for each node. The default port for + Tendermint is `26656`. The ID of a node can be obtained by running + `tendermint show_node_id` command. Thus, if the IP addresses of your nodes + were `192.168.0.1, 192.168.0.2, 192.168.0.3, 192.168.0.4`, the command would look like: @@ -37,18 +38,22 @@ After a few seconds, all the nodes should connect to each other and start making blocks! For more information, see the Tendermint Networks section of [the guide to using Tendermint](./using-tendermint.md). -But wait! Steps 3 and 4 are quite manual. Instead, use [this -script](https://github.com/tendermint/tendermint/blob/develop/docs/examples/init_testnet.sh), -which does the heavy lifting for you. And it gets better. - -Instead of the previously linked script to initialize the files required -for a testnet, we have the `tendermint testnet` command. By default, -running `tendermint testnet` will create all the required files, just -like the script. Of course, you'll still need to manually edit some -fields in the `config.toml`. Alternatively, see the available flags to -auto-populate the `config.toml` with the fields that would otherwise be -passed in via flags when running `tendermint node`. As you might -imagine, this command is useful for manual or automated deployments. +But wait! Steps 3, 4 and 5 are quite manual. Instead, use the `tendermint +testnet` command. By default, running `tendermint testnet` will create all the +required files, but it won't populate the list of persistent peers. It will do +it however if you provide the `--populate-persistent-peers` flag and optional +`--starting-ip-address` flag. Run `tendermint testnet --help` for more details +on the available flags. + +``` +tendermint testnet --populate-persistent-peers --starting-ip-address 192.168.0.1 +``` + +This command will generate four folders, prefixed with "node" and put them into +the "./mytestnet" directory by default. + +As you might imagine, this command is useful for manual or automated +deployments. ## Automated Deployments diff --git a/docs/examples/init_testnet.sh b/docs/examples/init_testnet.sh deleted file mode 100644 index 84e54674c..000000000 --- a/docs/examples/init_testnet.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env bash - -# make all the files -tendermint init --home ./tester/node0 -tendermint init --home ./tester/node1 -tendermint init --home ./tester/node2 -tendermint init --home ./tester/node3 - -file0=./tester/node0/config/genesis.json -file1=./tester/node1/config/genesis.json -file2=./tester/node2/config/genesis.json -file3=./tester/node3/config/genesis.json - -genesis_time=`cat $file0 | jq '.genesis_time'` -chain_id=`cat $file0 | jq '.chain_id'` - -value0=`cat $file0 | jq '.validators[0].pub_key.value'` -value1=`cat $file1 | jq '.validators[0].pub_key.value'` -value2=`cat $file2 | jq '.validators[0].pub_key.value'` -value3=`cat $file3 | jq '.validators[0].pub_key.value'` - -rm $file0 -rm $file1 -rm $file2 -rm $file3 - -echo "{ - \"genesis_time\": $genesis_time, - \"chain_id\": $chain_id, - \"validators\": [ - { - \"pub_key\": { - \"type\": \"tendermint/PubKeyEd25519\", - \"value\": $value0 - }, - \"power:\": 10, - \"name\":, \"\" - }, - { - \"pub_key\": { - \"type\": \"tendermint/PubKeyEd25519\", - \"value\": $value1 - }, - \"power:\": 10, - \"name\":, \"\" - }, - { - \"pub_key\": { - \"type\": \"tendermint/PubKeyEd25519\", - \"value\": $value2 - }, - \"power:\": 10, - \"name\":, \"\" - }, - { - \"pub_key\": { - \"type\": \"tendermint/PubKeyEd25519\", - \"value\": $value3 - }, - \"power:\": 10, - \"name\":, \"\" - } - ], - \"app_hash\": \"\" -}" >> $file0 - -cp $file0 $file1 -cp $file0 $file2 -cp $file2 $file3