github.com/koko1123/flow-go-1@v0.29.6/engine/collection/epochmgr/factory.go (about)

     1  package epochmgr
     2  
     3  import (
     4  	"github.com/koko1123/flow-go-1/consensus/hotstuff"
     5  	"github.com/koko1123/flow-go-1/module"
     6  	"github.com/koko1123/flow-go-1/network"
     7  	"github.com/koko1123/flow-go-1/state/cluster"
     8  	"github.com/koko1123/flow-go-1/state/protocol"
     9  )
    10  
    11  // EpochComponentsFactory is responsible for creating epoch-scoped components
    12  // managed by the epoch manager engine for the given epoch.
    13  type EpochComponentsFactory interface {
    14  
    15  	// Create sets up and instantiates all dependencies for the epoch. It may
    16  	// be used either for an ongoing epoch (for example, after a restart) or
    17  	// for an epoch that will start soon. It is safe to call multiple times for
    18  	// a given epoch counter.
    19  	//
    20  	// Must return ErrNotAuthorizedForEpoch if this node is not authorized in the epoch.
    21  	Create(epoch protocol.Epoch) (
    22  		state cluster.State,
    23  		proposal network.Engine,
    24  		sync network.Engine,
    25  		hotstuff module.HotStuff,
    26  		voteAggregator hotstuff.VoteAggregator,
    27  		err error,
    28  	)
    29  }