-
Notifications
You must be signed in to change notification settings - Fork 21
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
Decouple config loading & log initialization #471
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,8 +92,7 @@ func (vdb *VspDatabase) WriteHotBackupFile() error { | |
// - the provided extended pubkey (to be used for deriving fee addresses). | ||
// - an ed25519 keypair to sign API responses. | ||
// - a secret key to use for initializing a HTTP cookie store. | ||
func CreateNew(dbFile, feeXPub string, log slog.Logger) error { | ||
log.Infof("Initializing new database at %s", dbFile) | ||
func CreateNew(dbFile, feeXPub string) error { | ||
|
||
db, err := bolt.Open(dbFile, 0600, &bolt.Options{Timeout: 1 * time.Second}) | ||
if err != nil { | ||
|
@@ -115,8 +114,6 @@ func CreateNew(dbFile, feeXPub string, log slog.Logger) error { | |
return err | ||
} | ||
|
||
log.Info("Generating ed25519 signing key") | ||
|
||
// Generate ed25519 key | ||
_, signKey, err := ed25519.GenerateKey(rand.Reader) | ||
if err != nil { | ||
|
@@ -128,7 +125,6 @@ func CreateNew(dbFile, feeXPub string, log slog.Logger) error { | |
} | ||
|
||
// Generate a secret key for initializing the cookie store. | ||
log.Info("Generating cookie secret") | ||
secret := make([]byte, 32) | ||
_, err = rand.Read(secret) | ||
if err != nil { | ||
|
@@ -139,7 +135,6 @@ func CreateNew(dbFile, feeXPub string, log slog.Logger) error { | |
return err | ||
} | ||
|
||
log.Info("Storing extended public key") | ||
// Store fee xpub | ||
err = vspBkt.Put(feeXPubK, []byte(feeXPub)) | ||
if err != nil { | ||
|
@@ -165,8 +160,6 @@ func CreateNew(dbFile, feeXPub string, log slog.Logger) error { | |
return err | ||
} | ||
|
||
log.Info("Database initialized") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems like a log you wouldn't want to lose. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Per #465, creating the database will soon be in a new dedicated binary, so this is somewhat temporary/irrelevant. |
||
|
||
return nil | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now these won't be in the logs.