diff --git a/cmd/harmony/bls.go b/cmd/harmony/bls.go index 518a4b3c4..c883e8be8 100644 --- a/cmd/harmony/bls.go +++ b/cmd/harmony/bls.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" ) diff --git a/cmd/harmony/config.go b/cmd/harmony/config.go index 12fec4c75..bbe2df751 100644 --- a/cmd/harmony/config.go +++ b/cmd/harmony/config.go @@ -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 diff --git a/cmd/harmony/const.go b/cmd/harmony/const.go index 79156c39a..a6f6146c9 100644 --- a/cmd/harmony/const.go +++ b/cmd/harmony/const.go @@ -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{ diff --git a/cmd/harmony/main.go b/cmd/harmony/main.go index 0ca1c38e9..c2df0ba2d 100644 --- a/cmd/harmony/main.go +++ b/cmd/harmony/main.go @@ -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()