Open tjanez opened 4 years ago
May be related to the separate file signer directory?
May be related to the separate file signer directory?
Yes.
func doInit(cmd *cobra.Command, args []string) {
if err := cmdCommon.Init(); err != nil {
cmdCommon.EarlyLogAndExit(err)
}
dataDir, err := cmdSigner.CLIDirOrPwd()
if err != nil {
logger.Error("failed to query data directory",
"err", err,
)
os.Exit(1)
}
// CLIDirOrPwd returns the directory with the entity files, (and the signer
// keys for file-based signer).
//
// XXX: Why this doesn't use the perfectly good datadir is beyond me.
func CLIDirOrPwd() (string, error) {
signerDir := viper.GetString(CfgCLISignerDir)
if signerDir == "" {
var err error
if signerDir, err = os.Getwd(); err != nil {
return "", err
}
}
return signerDir, nil
}
The separate file signer flag seems to be because we used to treat file signer dir = entity dir. The correct fix for this should be to introduce a flag specific to the file signer like --signer.file.path
which if empty would default to the general datadir.
SUMMARY
Running
oasis-node registry entity init --datadir entity/
CLI command creates a new emptyentity/
directory but puts the generated files (entity_genesis.json
,entity.json
,entity.pem
) to the current directory.ISSUE TYPE
OASIS NODE VERSION
STEPS TO REPRODUCE
ACTUAL RESULTS
EXPECTED RESULTS