Skip to content

Commit

Permalink
fix multiple api keys found in the database (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
LexLuthr authored Oct 9, 2024
1 parent 053902f commit 9243d8a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/curio/guidedsetup/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,13 @@ func SaveConfigToLayerMigrateSectors(db *harmonydb.DB, minerRepoPath, chainApiIn
return minerAddress, xerrors.Errorf("Cannot delete existing layer: %w", err)
}

_, err = db.Exec(ctx, "INSERT INTO harmony_config (title, config) VALUES ($1, $2)", layerName, configTOML.String())
// Express as new toml to avoid adding StorageRPCSecret in more than 1 layer
ct := &bytes.Buffer{}
if err = toml.NewEncoder(ct).Encode(curioCfg); err != nil {
return minerAddress, err
}

_, err = db.Exec(ctx, "INSERT INTO harmony_config (title, config) VALUES ($1, $2)", layerName, ct.String())
if err != nil {
return minerAddress, xerrors.Errorf("Cannot insert layer after layer created message: %w", err)
}
Expand Down

0 comments on commit 9243d8a

Please sign in to comment.