lotus/node/modules/stmgr.go

24 lines
695 B
Go
Raw Normal View History

package modules
import (
"go.uber.org/fx"
2022-06-14 15:00:51 +00:00
"github.com/filecoin-project/lotus/chain/beacon"
"github.com/filecoin-project/lotus/chain/stmgr"
"github.com/filecoin-project/lotus/chain/store"
2022-06-14 15:00:51 +00:00
"github.com/filecoin-project/lotus/chain/vm"
2023-02-27 17:27:48 +00:00
"github.com/filecoin-project/lotus/node/modules/dtypes"
)
2023-02-27 17:27:48 +00:00
func StateManager(lc fx.Lifecycle, cs *store.ChainStore, exec stmgr.Executor, sys vm.SyscallBuilder, us stmgr.UpgradeSchedule, b beacon.Schedule, metadataDs dtypes.MetadataDS) (*stmgr.StateManager, error) {
sm, err := stmgr.NewStateManager(cs, exec, sys, us, b, metadataDs)
if err != nil {
return nil, err
}
lc.Append(fx.Hook{
OnStart: sm.Start,
OnStop: sm.Stop,
})
return sm, nil
}