Skip to content

Commit

Permalink
Fixed genesis height not being 0
Browse files Browse the repository at this point in the history
  • Loading branch information
maoueh committed Jan 10, 2024
1 parent 509f583 commit ca1073b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
4 changes: 0 additions & 4 deletions core/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ type Engine struct {
func NewEngine(genesisHeight, stopHeight uint64, rate int) Engine {
blockRate := time.Minute / time.Duration(rate)

if genesisHeight == 0 {
genesisHeight = 1
}

return Engine{
genesisHeight: genesisHeight,
stopHeight: stopHeight,
Expand Down
2 changes: 1 addition & 1 deletion core/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func NewNode(
}

func (node *Node) Initialize() error {
logrus.Info("initializing node")
logrus.WithField("genesis_height", node.store.genesisHeight).Info("initializing node")

logrus.Info("initializing store")
if err := node.store.Initialize(); err != nil {
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func initLogger() error {
}

logrus.SetLevel(level)
logrus.SetOutput(os.Stderr)
logrus.SetFormatter(&logrus.TextFormatter{FullTimestamp: true})

return nil
Expand All @@ -81,7 +82,7 @@ func makeInitCommand() *cobra.Command {
Short: "Initialize local blockchain state",
SilenceUsage: true,
RunE: func(cmd *cobra.Command, args []string) error {
logrus.WithField("dir", cliOpts.StoreDir).Info("initializing chain store")
logrus.WithField("dir", cliOpts.StoreDir).WithField("genesis_height", cliOpts.GenesisHeight).Info("initializing chain store")

store := core.NewStore(cliOpts.StoreDir, cliOpts.GenesisHeight)
return store.Initialize()
Expand Down

0 comments on commit ca1073b

Please sign in to comment.