-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Log out important directories for validator client #5653
Log out important directories for validator client #5653
Conversation
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.
We do log this today for beacon node
[2020-04-27 13:04:49] INFO node: Checking DB database-path=/Users/terencetsao/Library/Eth2/beaconchaindata
Codecov Report
@@ Coverage Diff @@
## master #5653 +/- ##
==========================================
- Coverage 26.80% 5.62% -21.18%
==========================================
Files 241 116 -125
Lines 21193 9328 -11865
==========================================
- Hits 5681 525 -5156
+ Misses 14423 8702 -5721
+ Partials 1089 101 -988 |
slasher/db/kv/kv.go
Outdated
@@ -76,6 +77,7 @@ func NewKVStore(dirPath string, cfg *Config) (*Store, error) { | |||
if err := os.MkdirAll(dirPath, 0700); err != nil { | |||
return nil, err | |||
} | |||
logrus.Infof(".db & validator keys dir is: %v", dirPath) |
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.
This isn't needed, the slasher already logs out the datadir.
validator/db/db.go
Outdated
@@ -68,6 +68,7 @@ func NewKVStore(dirPath string, pubKeys [][48]byte) (*Store, error) { | |||
if err := os.MkdirAll(dirPath, 0700); err != nil { | |||
return nil, err | |||
} | |||
log.Infof(".db & validator keys dir is: %v", dirPath) |
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.
This is not correct, the validator keys are not in this directory. You will need another log to declare where they are. Look at how the Checking DB
log is put out and mirror that for this one.
validator/db/db.go
Outdated
@@ -68,6 +69,8 @@ func NewKVStore(dirPath string, pubKeys [][48]byte) (*Store, error) { | |||
if err := os.MkdirAll(dirPath, 0700); err != nil { | |||
return nil, err | |||
} | |||
log.WithField("database-path", dirPath).Info("Checking DB") | |||
log.WithField("validator-keys-path", cmd.DataDirFlag.Name).Info("Checking Validator Keys") |
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.
Wouldn't this print validator-keys-path=datadir
?
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.
By this i mean, you are printing the flag name, not the value of the flag.
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.
Oh sorry, What is the property I have to use to get the datadir?
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.
Hi @ShawkiS typically we can use something like cliCtx.GlobalString(cmd.DataDirFlag.Name)
validator/node/node.go
Outdated
@@ -101,6 +101,7 @@ func NewValidatorClient(ctx *cli.Context) (*ValidatorClient, error) { | |||
if err := clearDB(dataDir, pubkeys, forceClearFlag); err != nil { | |||
return nil, err | |||
} | |||
log.WithField("database-path and validator-keys-path", dataDir).Info("Checking DB and Validator Keys") |
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.
log.WithField("database-path and validator-keys-path", dataDir).Info("Checking DB and Validator Keys") | |
log.WithField("path", dataDir).Info("Checking DB and validator keystore path") |
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.
Ok, thank you. I changed it.
validator/node/node.go
Outdated
@@ -101,6 +101,7 @@ func NewValidatorClient(ctx *cli.Context) (*ValidatorClient, error) { | |||
if err := clearDB(dataDir, pubkeys, forceClearFlag); err != nil { | |||
return nil, err | |||
} | |||
log.WithField("path", dataDir).Info("Checking DB path") |
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.
Can you mirror this to the beacon node log? So Checking DB
and the field name databasePath
.
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.
Okay, done
@@ -45,6 +45,7 @@ func NewKeystore(input string) (KeyManager, string, error) { | |||
if opts.Path == "" { | |||
opts.Path = accounts.DefaultValidatorDir() | |||
} | |||
log.WithField("path", opts.Path).Info("Checking validator keystore path") |
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.
Same here, can you change the text to "Checking validator keys" and the field to "keystorePath"?
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.
Okay, done
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.
Meant to just comment, my bad
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.
Resolves #5617
Description
Write why you are making the changes in this pull request
I want to print the .db and validator keys location at the beginning of the process.
Write a summary of the changes you are making:
-Logging the DB path in validator client in
NewValidatorClient
invalidator/node/node.go
-Logging the Keystore path in validator client in
NewKeystore
function invalidator/keymanager/direct_keystore.go