Skip to content

Commit b9f7887

Browse files
Merge pull request #7762 from onflow/sre/jp/update-transit
Address bugs in transit tooling
2 parents 280591d + 50409e1 commit b9f7887

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

cmd/bootstrap/transit/cmd/generate_root_block_vote.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,13 @@ func generateVote(c *cobra.Command, args []string) {
5252
}
5353

5454
// load DKG private key
55-
path := fmt.Sprintf(bootstrap.PathRandomBeaconPriv, nodeID)
56-
data, err := io.ReadFile(filepath.Join(flagBootDir, path))
55+
path := filepath.Join(flagBootDir, fmt.Sprintf(bootstrap.PathRandomBeaconPriv, nodeID))
56+
// If output directory is specified, use it for the root-block.json
57+
if flagOutputDir != "" {
58+
path = filepath.Join(flagOutputDir, bootstrap.FilenameRandomBeaconPriv)
59+
}
60+
61+
data, err := io.ReadFile(path)
5762
if err != nil {
5863
log.Fatal().Err(err).Msg("could not read DKG private key file")
5964
}

cmd/bootstrap/transit/cmd/pull_root_block.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func pullRootBlock(c *cobra.Command, args []string) {
7878
// this will set the path used to download the random beacon file and unwrap it
7979
if flagOutputDir != "" {
8080
fullRandomBeaconPath = filepath.Join(flagOutputDir, filepath.Base(objectName))
81-
unWrappedRandomBeaconPath = filepath.Join(flagOutputDir, filepath.Base(objectName))
81+
unWrappedRandomBeaconPath = filepath.Join(flagOutputDir, bootstrap.FilenameRandomBeaconPriv)
8282
}
8383

8484
log.Info().Msgf("downloading random beacon key: %s", objectName)

0 commit comments

Comments
 (0)