[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" "os"
"sync" "sync"
nodeconfig "github.com/harmony-one/harmony/internal/configs/node"
"github.com/harmony-one/harmony/internal/blsgen" "github.com/harmony-one/harmony/internal/blsgen"
nodeconfig "github.com/harmony-one/harmony/internal/configs/node"
"github.com/harmony-one/harmony/multibls" "github.com/harmony-one/harmony/multibls"
) )

@ -7,15 +7,14 @@ import (
"strings" "strings"
"github.com/harmony-one/harmony/internal/cli" "github.com/harmony-one/harmony/internal/cli"
"github.com/spf13/cobra"
nodeconfig "github.com/harmony-one/harmony/internal/configs/node" nodeconfig "github.com/harmony-one/harmony/internal/configs/node"
"github.com/pelletier/go-toml" "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 { type harmonyConfig struct {
Version string Version string
General generalConfig General generalConfig
@ -118,7 +117,7 @@ type devnetConfig struct {
HmyNodeSize int HmyNodeSize int
} }
// TODO: make this revert to a separate command // TODO: make `revert` to a separate command
type revertConfig struct { type revertConfig struct {
RevertBeacon bool RevertBeacon bool
RevertTo int RevertTo int

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

@ -265,7 +265,7 @@ func setupNodeAndRun(hc harmonyConfig) {
currentNode.SupportBeaconSyncing() 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() chain := currentNode.Blockchain()
if hc.Revert.RevertBeacon { if hc.Revert.RevertBeacon {
chain = currentNode.Beaconchain() chain = currentNode.Beaconchain()

Loading…
Cancel
Save