Skip to content

Commit

Permalink
chore: update script to increase timeout broadcast tx commit (#424)
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmic-vagabond authored Mar 25, 2024
1 parent 6276b16 commit 412fb46
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scripts/upgrade-assure/update-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,22 @@ func updateConfig(homePath string) {
configPath := homePath + "/config/config.toml"
appPath := homePath + "/config/app.toml"

// Update config.toml
// Update config.toml for cors_allowed_origins
args := []string{"-i", "", "s/^cors_allowed_origins =.*/cors_allowed_origins = [\\\"*\\\"]/", configPath}

// Execute the sed command
if err := exec.Command("sed", args...).Run(); err != nil {
log.Fatalf(Red+"Error updating config.toml: %v\n", err)
}

// Update config.toml for timeout_broadcast_tx_commit
args = []string{"-i", "", "s/^timeout_broadcast_tx_commit =.*/timeout_broadcast_tx_commit = \\\"30s\\\"/", configPath}

// Execute the sed command
if err := exec.Command("sed", args...).Run(); err != nil {
log.Fatalf(Red+"Error updating config.toml: %v\n", err)
}

// only apply this change if the os is linux
if isLinux() {
args = []string{"-i", "", "s/^db_backend =.*/db_backend = \\\"rocksdb\\\"/", configPath}
Expand All @@ -34,7 +42,7 @@ func updateConfig(homePath string) {
}
}

// Update app.toml
// Update app.toml for enabling the API server
args = []string{"-i", "", "/^# Enable defines if the API server should be enabled./{n;s/enable = false/enable = true/;}", appPath}

// Execute the sed command
Expand Down

0 comments on commit 412fb46

Please sign in to comment.