New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tendermint testnet: Allow for better hostname control #3661
Conversation
This allows one to specify the `--hostname` flag multiple times, each time providing an additional custom hostname for a respective peer (validator or non-validator). This overrides any of the `--hostname-prefix` or `--starting-ip-address` flags. The string array approach is taken instead of the string slice approach (see the pflag docs: https://godoc.org/github.com/spf13/pflag#StringArray) because the string slice approach (a comma-separated string) doesn't allow for cleaner multi-line BASH scripts - where this feature is intended to be used.
Codecov Report
@@ Coverage Diff @@
## develop #3661 +/- ##
===========================================
+ Coverage 63.18% 63.34% +0.15%
===========================================
Files 218 218
Lines 18194 18226 +32
===========================================
+ Hits 11496 11545 +49
+ Misses 5727 5721 -6
+ Partials 971 960 -11
|
The current approach to generating monikers for testnet nodes assigns the local hostname of the machine on which the testnet config was generated to all nodes. This results in the same moniker for each and every node. This commit makes use of the supplied `--hostname-prefix` and `--hostname-suffix`, or `--hostname` parameters to generate unique monikers for each node. Alternatively, another parameter (`--random-monikers`) allows one to forcibly override all of the other options with random hexadecimal strings.
The latest commit now adds support for the generation of unique monikers for each node configuration generated using the same scheme as for generating peer hostnames (except if Previously the command would just use your local hostname, resulting in the same moniker for all nodes. This is not particularly useful when generating configurations for remote nodes, and results in needing to use tools like |
This attempts to address issue #3660. It adds two additional flags to the
tendermint testnet
command:--hostname-suffix
- to automatically append a suffix to each and every generated (non-IP) hostname--hostname
- a StringArray parameter to manually override all peer hostnames. Using this flag causestendermint testnet
to completely ignore the--hostname-prefix
,--hostname-suffix
and--starting-ip-address
fields.Example 1 with
--hostname-suffix
:Example 2 with
--hostname
: