Add keystore option to cli

This commit is contained in:
Jerry 2022-06-13 20:43:34 -07:00
parent 342bf3089e
commit 33e646eea1
3 changed files with 11 additions and 0 deletions

View file

@ -12,6 +12,8 @@ The ```bor server``` command runs the Bor client.
- ```datadir```: Path of the data directory to store information - ```datadir```: Path of the data directory to store information
- ```keystore```: Path of the directory to store keystores
- ```config```: File for the config file - ```config```: File for the config file
- ```syncmode```: Blockchain sync mode ("fast", "full", or "snap") - ```syncmode```: Blockchain sync mode ("fast", "full", or "snap")

View file

@ -52,6 +52,9 @@ type Config struct {
// DataDir is the directory to store the state in // DataDir is the directory to store the state in
DataDir string `hcl:"data-dir,optional"` DataDir string `hcl:"data-dir,optional"`
// KeyStoreDir is the directory to store keystores
KeyStoreDir string `hcl:"keystore-dir,optional"`
// SyncMode selects the sync protocol // SyncMode selects the sync protocol
SyncMode string `hcl:"sync-mode,optional"` SyncMode string `hcl:"sync-mode,optional"`
@ -894,6 +897,7 @@ func (c *Config) buildNode() (*node.Config, error) {
cfg := &node.Config{ cfg := &node.Config{
Name: clientIdentifier, Name: clientIdentifier,
DataDir: c.DataDir, DataDir: c.DataDir,
KeyStoreDir: c.KeyStoreDir,
UseLightweightKDF: c.Accounts.UseLightweightKDF, UseLightweightKDF: c.Accounts.UseLightweightKDF,
InsecureUnlockAllowed: c.Accounts.AllowInsecureUnlock, InsecureUnlockAllowed: c.Accounts.AllowInsecureUnlock,
Version: params.VersionWithCommit(gitCommit, gitDate), Version: params.VersionWithCommit(gitCommit, gitDate),

View file

@ -33,6 +33,11 @@ func (c *Command) Flags() *flagset.Flagset {
Value: &c.cliConfig.DataDir, Value: &c.cliConfig.DataDir,
Default: c.cliConfig.DataDir, Default: c.cliConfig.DataDir,
}) })
f.StringFlag(&flagset.StringFlag{
Name: "keystore",
Usage: "Path of the directory to store keystores",
Value: &c.cliConfig.KeyStoreDir,
})
f.SliceStringFlag(&flagset.SliceStringFlag{ f.SliceStringFlag(&flagset.SliceStringFlag{
Name: "config", Name: "config",
Usage: "File for the config file", Usage: "File for the config file",