Skip to content

Commit

Permalink
remove temporal fixes (#845)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelm41 committed Oct 29, 2021
1 parent a93f2b1 commit 110d869
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 34 deletions.
18 changes: 3 additions & 15 deletions demo/node/node_subprocess.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,7 @@ func (n *NodeProc) setup() {
// call drand binary
n.priv = key.NewKeyPair(n.privAddr)

args := []string{"generate-keypair", "--folder", n.base}

// FIXME After merging to master, we MUST remove this check (master has no --id on this CLI cmd)
if n.isCandidate {
args = append(args, "--id", n.beaconID)
}
args := []string{"generate-keypair", "--folder", n.base, "--id", n.beaconID}

if !n.tls {
args = append(args, "--tls-disable")
Expand All @@ -127,15 +122,8 @@ func (n *NodeProc) setup() {
newKey := exec.Command(n.binary, args...)
runCommand(newKey)

// FIXME After merging to master, we MUST remove this as master will be able to handle the new files structure.
// We have to act differently because the previous version cannot handle the new files structure. We will load
// the store accordingly to the drand version we are running.
if n.isCandidate {
config := core.NewConfig(core.WithConfigFolder(n.base))
n.store = key.NewFileStore(config.ConfigFolderMB(), n.beaconID)
} else {
n.store = key.NewFileStoreSB(n.base)
}
config := core.NewConfig(core.WithConfigFolder(n.base))
n.store = key.NewFileStore(config.ConfigFolderMB(), n.beaconID)

// verify it's done
n.priv, err = n.store.LoadKeyPair()
Expand Down
19 changes: 0 additions & 19 deletions key/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,25 +112,6 @@ func NewFileStore(baseFolder, beaconID string) Store {
return store
}

// FIXME After merging to master, we should remove this as master will be able
// to handle the new files structure. (created only for regression test)
// deprecated
// NewFileStoreSB is used to create the config folder and all the subfolders in an old way.
// If a folder alredy exists, we simply check the rights
func NewFileStoreSB(baseFolder string) Store {
store := &fileStore{baseFolder: baseFolder}

keyFolder := fs.CreateSecureFolder(path.Join(baseFolder, KeyFolderName))
groupFolder := fs.CreateSecureFolder(path.Join(baseFolder, GroupFolderName))

store.privateKeyFile = path.Join(keyFolder, keyFileName) + privateExtension
store.publicKeyFile = path.Join(keyFolder, keyFileName) + publicExtension
store.groupFile = path.Join(groupFolder, groupFileName)
store.shareFile = path.Join(groupFolder, shareFileName)
store.distKeyFile = path.Join(groupFolder, distKeyFileName)
return store
}

// SaveKeyPair first saves the private key in a file with tight permissions and then
// saves the public part in another file.
func (f *fileStore) SaveKeyPair(p *Pair) error {
Expand Down

0 comments on commit 110d869

Please sign in to comment.