[cmd] small changes and fixes

pull/3278/head
Jacky Wang 4 years ago
parent 93574bc4ee
commit 2c72098a3e
No known key found for this signature in database
GPG Key ID: 1085CE5F4FF5842C
  1. 3
      cmd/harmony/bls.go
  2. 11
      cmd/harmony/config.go
  3. 6
      cmd/harmony/const.go
  4. 2
      cmd/harmony/main.go

@ -5,9 +5,8 @@ import (
"os"
"sync"
nodeconfig "github.com/harmony-one/harmony/internal/configs/node"
"github.com/harmony-one/harmony/internal/blsgen"
nodeconfig "github.com/harmony-one/harmony/internal/configs/node"
"github.com/harmony-one/harmony/multibls"
)

@ -7,15 +7,14 @@ import (
"strings"
"github.com/harmony-one/harmony/internal/cli"
"github.com/spf13/cobra"
nodeconfig "github.com/harmony-one/harmony/internal/configs/node"
"github.com/pelletier/go-toml"
"github.com/spf13/cobra"
)
const tomlConfigVersion = "1.0.0"
// harmonyConfig contains all the configs user can set for running harmony binary. Served as the bridge
// from user set flags to internal node configs. Also user can persist this structure to a toml file
// to avoid inputting all arguments.
type harmonyConfig struct {
Version string
General generalConfig
@ -118,7 +117,7 @@ type devnetConfig struct {
HmyNodeSize int
}
// TODO: make this revert to a separate command
// TODO: make `revert` to a separate command
type revertConfig struct {
RevertBeacon bool
RevertTo int

@ -2,12 +2,10 @@ package main
import nodeconfig "github.com/harmony-one/harmony/internal/configs/node"
const (
defNetworkType = nodeconfig.Mainnet
)
const tomlConfigVersion = "1.0.0"
const (
mainnetDnsZone = "t.hmny.io"
defNetworkType = nodeconfig.Mainnet
)
var defaultConfig = harmonyConfig{

@ -265,7 +265,7 @@ func setupNodeAndRun(hc harmonyConfig) {
currentNode.SupportBeaconSyncing()
}
if hc.Revert != nil && hc.Revert.RevertBefore != -1 && hc.Revert.RevertTo != -1 {
if hc.Revert != nil && hc.Revert.RevertBefore != 0 && hc.Revert.RevertTo != 0 {
chain := currentNode.Blockchain()
if hc.Revert.RevertBeacon {
chain = currentNode.Beaconchain()

Loading…
Cancel
Save