Skip to content

Commit d78d302

Browse files
node: add info message when JWT secret is loaded (ethereum#25095)
Co-authored-by: Felix Lange <[email protected]>
1 parent d8f9638 commit d78d302

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

node/node.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
crand "crypto/rand"
2121
"errors"
2222
"fmt"
23+
"hash/crc32"
2324
"net/http"
2425
"os"
2526
"path/filepath"
@@ -352,10 +353,10 @@ func (n *Node) obtainJWTSecret(cliParam string) ([]byte, error) {
352353
fileName = n.ResolvePath(datadirJWTKey)
353354
}
354355
// try reading from file
355-
log.Debug("Reading JWT secret", "path", fileName)
356356
if data, err := os.ReadFile(fileName); err == nil {
357357
jwtSecret := common.FromHex(strings.TrimSpace(string(data)))
358358
if len(jwtSecret) == 32 {
359+
log.Info("Loaded JWT secret file", "path", fileName, "crc32", fmt.Sprintf("%#x", crc32.ChecksumIEEE(jwtSecret)))
359360
return jwtSecret, nil
360361
}
361362
log.Error("Invalid JWT secret", "path", fileName, "length", len(jwtSecret))

0 commit comments

Comments
 (0)