Merge pull request #1871 from tendermint/1774-remove-init-testnet-script

remove init_testnet script
This commit is contained in:
Alexander Simmerl 2018-07-03 17:42:58 +02:00 committed by GitHub
commit 2f29aa9605
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 85 deletions

View File

@ -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 4) Compile a list of public keys for each validator into a
`genesis.json` file and replace the existing file with it. `genesis.json` file and replace the existing file with it.
5) Run 5) Run
`tendermint node --proxy_app=kvstore --p2p.persistent_peers=< peer addresses >` `tendermint node --proxy_app=kvstore --p2p.persistent_peers=< peer
on each node, where `< peer addresses >` is a comma separated list addresses >` on each node, where `< peer addresses >` is a comma separated
of the IP:PORT combination for each node. The default port for list of the ID@IP:PORT combination for each node. The default port for
Tendermint is `26656`. Thus, if the IP addresses of your nodes were Tendermint is `26656`. The ID of a node can be obtained by running
`192.168.0.1, 192.168.0.2, 192.168.0.3, 192.168.0.4`, the command `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: 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 start making blocks! For more information, see the Tendermint Networks
section of [the guide to using Tendermint](./using-tendermint.md). section of [the guide to using Tendermint](./using-tendermint.md).
But wait! Steps 3 and 4 are quite manual. Instead, use [this But wait! Steps 3, 4 and 5 are quite manual. Instead, use the `tendermint
script](https://github.com/tendermint/tendermint/blob/develop/docs/examples/init_testnet.sh), testnet` command. By default, running `tendermint testnet` will create all the
which does the heavy lifting for you. And it gets better. 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.
Instead of the previously linked script to initialize the files required ```
for a testnet, we have the `tendermint testnet` command. By default, tendermint testnet --populate-persistent-peers --starting-ip-address 192.168.0.1
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 This command will generate four folders, prefixed with "node" and put them into
auto-populate the `config.toml` with the fields that would otherwise be the "./mytestnet" directory by default.
passed in via flags when running `tendermint node`. As you might
imagine, this command is useful for manual or automated deployments. As you might imagine, this command is useful for manual or automated
deployments.
## Automated Deployments ## Automated Deployments

View File

@ -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