blockchain

package
v0.0.0-...-dde17ac Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2018 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL