Add info command
This commit is contained in:
parent
63b76c32f9
commit
6015a0ff15
|
@ -54,6 +54,7 @@ loadConfigFile() {
|
||||||
[[ -n $leaderRotation ]] || usage "Config file invalid, leaderRotation unspecified: $configFile"
|
[[ -n $leaderRotation ]] || usage "Config file invalid, leaderRotation unspecified: $configFile"
|
||||||
[[ ${#fullnodeIpList[@]} -gt 0 ]] || usage "Config file invalid, fullnodeIpList unspecified: $configFile"
|
[[ ${#fullnodeIpList[@]} -gt 0 ]] || usage "Config file invalid, fullnodeIpList unspecified: $configFile"
|
||||||
[[ ${#fullnodeIpListPrivate[@]} -gt 0 ]] || usage "Config file invalid, fullnodeIpListPrivate unspecified: $configFile"
|
[[ ${#fullnodeIpListPrivate[@]} -gt 0 ]] || usage "Config file invalid, fullnodeIpListPrivate unspecified: $configFile"
|
||||||
|
[[ ${#fullnodeIpList[@]} -eq ${#fullnodeIpListPrivate[@]} ]] || usage "Config file invalid, fullnodeIpList/fullnodeIpListPrivate length mismatch: $configFile"
|
||||||
|
|
||||||
if $publicNetwork; then
|
if $publicNetwork; then
|
||||||
entrypointIp=${fullnodeIpList[0]}
|
entrypointIp=${fullnodeIpList[0]}
|
||||||
|
|
32
net/gce.sh
32
net/gce.sh
|
@ -59,6 +59,7 @@ Manage testnet instances
|
||||||
create - create a new testnet (implies 'config')
|
create - create a new testnet (implies 'config')
|
||||||
config - configure the testnet and write a config file describing it
|
config - configure the testnet and write a config file describing it
|
||||||
delete - delete the testnet
|
delete - delete the testnet
|
||||||
|
info - display information about the currently configured testnet
|
||||||
|
|
||||||
common options:
|
common options:
|
||||||
-p [prefix] - Optional common prefix for instance names to avoid
|
-p [prefix] - Optional common prefix for instance names to avoid
|
||||||
|
@ -85,6 +86,9 @@ Manage testnet instances
|
||||||
delete-specific options:
|
delete-specific options:
|
||||||
none
|
none
|
||||||
|
|
||||||
|
info-specific options:
|
||||||
|
none
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
exit $exitcode
|
exit $exitcode
|
||||||
}
|
}
|
||||||
|
@ -93,7 +97,8 @@ EOF
|
||||||
command=$1
|
command=$1
|
||||||
[[ -n $command ]] || usage
|
[[ -n $command ]] || usage
|
||||||
shift
|
shift
|
||||||
[[ $command = create || $command = config || $command = delete ]] || usage "Invalid command: $command"
|
[[ $command = create || $command = config || $command = info || $command = delete ]] ||
|
||||||
|
usage "Invalid command: $command"
|
||||||
|
|
||||||
while getopts "h?p:Pn:c:z:gG:a:d:b" opt; do
|
while getopts "h?p:Pn:c:z:gG:a:d:b" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
|
@ -466,6 +471,31 @@ EOF
|
||||||
config)
|
config)
|
||||||
prepareInstancesAndWriteConfigFile
|
prepareInstancesAndWriteConfigFile
|
||||||
;;
|
;;
|
||||||
|
info)
|
||||||
|
loadConfigFile
|
||||||
|
printNode() {
|
||||||
|
declare nodeType=$1
|
||||||
|
declare ip=$2
|
||||||
|
declare ipPrivate=$3
|
||||||
|
printf " %-16s | %-15s | %-15s\n" "$nodeType" "$ip" "$ipPrivate"
|
||||||
|
}
|
||||||
|
|
||||||
|
printNode "Node Type" "Public IP" "Private IP"
|
||||||
|
echo "-------------------+-----------------+-----------------"
|
||||||
|
nodeType=bootstrap-leader
|
||||||
|
for i in $(seq 0 $(( ${#fullnodeIpList[@]} - 1)) ); do
|
||||||
|
ipAddress=${fullnodeIpList[$i]}
|
||||||
|
ipAddressPrivate=${fullnodeIpListPrivate[$i]}
|
||||||
|
printNode $nodeType "$ipAddress" "$ipAddressPrivate"
|
||||||
|
nodeType=fullnode
|
||||||
|
done
|
||||||
|
|
||||||
|
for i in $(seq 0 $(( ${#clientIpList[@]} - 1)) ); do
|
||||||
|
ipAddress=${clientIpList[$i]}
|
||||||
|
ipAddressPrivate=${clientIpListPrivate[$i]}
|
||||||
|
printNode bench-tps "$ipAddress" "$ipAddressPrivate"
|
||||||
|
done
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
usage "Unknown command: $command"
|
usage "Unknown command: $command"
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in New Issue