-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #929 from bnb-chain/develop
release: draft the release v0.10.8
- Loading branch information
Showing
15 changed files
with
657 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package utils | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/cosmos/cosmos-sdk/types" | ||
"github.com/spf13/cobra" | ||
"github.com/tendermint/tendermint/privval" | ||
) | ||
|
||
const ( | ||
outputPathFlag = "output-path" | ||
) | ||
|
||
func genConsensusKeyCommand() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "gen-consensus-key", | ||
Short: "generate the JSON file containing the private key to use as a validator in the consensus protocol", | ||
RunE: runGenConsensusKeyCmd, | ||
} | ||
cmd.Flags().String(outputPathFlag, "./priv_validator_key.json", "The target path of the output file") | ||
return cmd | ||
} | ||
|
||
func runGenConsensusKeyCmd(cmd *cobra.Command, args []string) error { | ||
flags := cmd.Flags() | ||
|
||
outputPath, _ := flags.GetString(outputPathFlag) | ||
|
||
filePv := privval.GenFilePV(outputPath, "") | ||
filePv.Key.Save() | ||
fmt.Printf("The consensus key has been generated and saved to %s successfully\n", outputPath) | ||
pubkey := types.MustBech32ifyConsPub(filePv.Key.PubKey) | ||
fmt.Printf("The consensus pubkey is %s\n", pubkey) | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package utils | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func Commands() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "utils", | ||
Short: "Utilities for interacting with BNB Beacon Chain", | ||
} | ||
cmd.AddCommand( | ||
genConsensusKeyCommand(), | ||
) | ||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.