Documentation ¶
Index ¶
- type BeaconChain
- func (b *BeaconChain) ActiveState() *types.ActiveState
- func (b *BeaconChain) CanProcessBlock(fetcher powchain.POWBlockFetcher, block *types.Block) (bool, error)
- func (b *BeaconChain) CrystallizedState() *types.CrystallizedState
- func (b *BeaconChain) GenesisBlock() *types.Block
- func (b *BeaconChain) MutateActiveState(activeState *types.ActiveState) error
- func (b *BeaconChain) MutateCrystallizedState(crystallizedState *types.CrystallizedState) error
- type ChainService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BeaconChain ¶
type BeaconChain struct {
// contains filtered or unexported fields
}
BeaconChain represents the core PoS blockchain object containing both a crystallized and active state.
func NewBeaconChain ¶
func NewBeaconChain(db essdb.Database) (*BeaconChain, error)
NewBeaconChain initializes an instance using genesis state parameters if none provided.
func (*BeaconChain) ActiveState ¶
func (b *BeaconChain) ActiveState() *types.ActiveState
ActiveState exposes a getter to external services.
func (*BeaconChain) CanProcessBlock ¶
func (b *BeaconChain) CanProcessBlock(fetcher powchain.POWBlockFetcher, block *types.Block) (bool, error)
CanProcessBlock decides if an incoming p2p block can be processed into the chain's block trie.
func (*BeaconChain) CrystallizedState ¶
func (b *BeaconChain) CrystallizedState() *types.CrystallizedState
CrystallizedState exposes a getter to external services.
func (*BeaconChain) GenesisBlock ¶
func (b *BeaconChain) GenesisBlock() *types.Block
GenesisBlock returns the canonical, genesis block.
func (*BeaconChain) MutateActiveState ¶
func (b *BeaconChain) MutateActiveState(activeState *types.ActiveState) error
MutateActiveState allows external services to modify the active state.
func (*BeaconChain) MutateCrystallizedState ¶
func (b *BeaconChain) MutateCrystallizedState(crystallizedState *types.CrystallizedState) error
MutateCrystallizedState allows external services to modify the crystallized state.
type ChainService ¶
type ChainService struct {
// contains filtered or unexported fields
}
ChainService represents a service that handles the internal logic of managing the full PoS beacon chain.
func NewChainService ¶
func NewChainService(ctx context.Context, beaconDB *database.BeaconDB, web3Service *powchain.Web3Service) (*ChainService, error)
NewChainService instantiates a new service instance that will be registered into a running beacon node.
func (*ChainService) Start ¶
func (c *ChainService) Start()
Start a blockchain service's main event loop.
func (*ChainService) Stop ¶
func (c *ChainService) Stop() error
Stop the blockchain service's main event loop and associated goroutines.