Skip to content

Commit

Permalink
Issue #1 and #2 fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
zenodeapp committed Jan 13, 2024
1 parent 569e46a commit e2c98e4
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.toml.bak
*.toml.bak
17 changes: 17 additions & 0 deletions examples/client.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This is a TOML config file.
# For more information, see https://github.com/toml-lang/toml

###############################################################################
### Client Configuration ###
###############################################################################

# The network chain ID
chain-id = ""
# The keyring's backend, where the keys are stored (os|file|kwallet|pass|test|memory)
keyring-backend = "os"
# CLI output format (text|json)
output = "text"
# <host>:<port> to Tendermint RPC interface for this chain
node = "tcp://localhost:26657"
# Transaction broadcasting mode (sync|async|block)
broadcast-mode = "sync"
2 changes: 2 additions & 0 deletions quick-shift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ JSON_RPC_WS_ADDRESS=8546
JSON_RPC_METRICS_ADDRESS=6065

# Create a backup
cp $CONFIG_PATH/client.toml $CONFIG_PATH/client.toml.bak
cp $CONFIG_PATH/config.toml $CONFIG_PATH/config.toml.bak
cp $CONFIG_PATH/app.toml $CONFIG_PATH/app.toml.bak

# Shift ports
sed -i "/^node/ s/\(node = \".*\):\([0-9]*\)/\1:$((RPC_LADDR + INCREMENT))/" $CONFIG_PATH/client.toml
sed -i "/^proxy_app/ s/\(proxy_app = \".*\):\([0-9]*\)/\1:$((PROXY_APP + INCREMENT))/" $CONFIG_PATH/config.toml
sed -i "/^\[rpc\]/,/\[.*\]/ s/\(laddr = \".*\):\([0-9]*\)/\1:$((RPC_LADDR + INCREMENT))/" $CONFIG_PATH/config.toml
sed -i "/^pprof_laddr/ s/\(pprof_laddr = \".*\):\([0-9]*\)/\1:$((PPROF_LADDR + INCREMENT))/" $CONFIG_PATH/config.toml
Expand Down
11 changes: 9 additions & 2 deletions shift-wizard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ if [ -z "$CONFIG_PATH" ]; then
fi

# Check if config files exist
if [ ! -f "$CONFIG_PATH/config.toml" ] || [ ! -f "$CONFIG_PATH/app.toml" ]; then
echo "Error: One or both of the config files ($CONFIG_PATH/config.toml or $CONFIG_PATH/app.toml) not found."
if [ ! -f "$CONFIG_PATH/client.toml" ] || [ ! -f "$CONFIG_PATH/client.toml" ] || [ ! -f "$CONFIG_PATH/app.toml" ]; then
echo "Error: One of the config files ($CONFIG_PATH/client.toml, $CONFIG_PATH/config.toml or $CONFIG_PATH/app.toml) not found."
exit 1
fi

Expand Down Expand Up @@ -57,6 +57,7 @@ prompt_for_port() {
}

# backup
cp $CONFIG_PATH/client.toml $CONFIG_PATH/client.toml.bak
cp $CONFIG_PATH/config.toml $CONFIG_PATH/config.toml.bak
cp $CONFIG_PATH/app.toml $CONFIG_PATH/app.toml.bak

Expand All @@ -76,6 +77,12 @@ if [ "$CUSTOM" = "y" ]; then
PROMETHEUS_LISTEN_ADDR=$(prompt_for_port "prometheus_listen_addr" $PROMETHEUS_LISTEN_ADDR)
fi

# Client.toml
sed -i "/^node/ s/\(node = \".*\):\([0-9]*\)/\1:$((RPC_LADDR + INCREMENT))/" $CONFIG_PATH/client.toml

echo "Port has been replaced in $CONFIG_PATH/client.toml"
echo ""

sed -i "/^proxy_app/ s/\(proxy_app = \".*\):\([0-9]*\)/\1:$((PROXY_APP + INCREMENT))/" $CONFIG_PATH/config.toml
sed -i "/^\[rpc\]/,/\[.*\]/ s/\(laddr = \".*\):\([0-9]*\)/\1:$((RPC_LADDR + INCREMENT))/" $CONFIG_PATH/config.toml
sed -i "/^pprof_laddr/ s/\(pprof_laddr = \".*\):\([0-9]*\)/\1:$((PPROF_LADDR + INCREMENT))/" $CONFIG_PATH/config.toml
Expand Down

0 comments on commit e2c98e4

Please sign in to comment.