Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
otherview committed Jun 10, 2021
1 parent 40816a6 commit fa9bd99
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ func avalancheFlagSet() *flag.FlagSet {
// Staking
fs.Uint(StakingPortKey, 9651, "Port of the consensus server")
fs.Bool(StakingEnabledKey, true, "Enable staking. If enabled, Network TLS is required.")
fs.Bool(FakeStakingCerts, false, "Forces the node to use fake, ephemeral staking certificates. Defaults to false")
fs.String(StakingKeyPathKey, defaultStakingKeyPath, "Path to the TLS private key for staking")
fs.String(StakingCertPathKey, defaultStakingCertPath, "Path to the TLS certificate for staking")
fs.Uint64(StakingDisabledWeightKey, 1, "Weight to provide to each peer when staking is disabled")
Expand Down Expand Up @@ -482,7 +483,7 @@ func getConfigsFromViper(v *viper.Viper) (node.Config, process.Config, error) {
return node.Config{}, process.Config{}, errInvalidStakerWeights
}

if nodeConfig.FetchOnly {
if nodeConfig.FetchOnly || v.GetBool(FakeStakingCerts) {
// In fetch only mode, use an ephemeral staking key/cert
cert, err := staking.NewTLSCert()
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions config/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const (
BootstrapIDsKey = "bootstrap-ids"
StakingPortKey = "staking-port"
StakingEnabledKey = "staking-enabled"
FakeStakingCerts = "fake-staking-certs-enabled"
StakingKeyPathKey = "staking-tls-key-file"
StakingCertPathKey = "staking-tls-cert-file"
StakingDisabledWeightKey = "staking-disabled-weight"
Expand Down

0 comments on commit fa9bd99

Please sign in to comment.