import "github.com/iotexproject/iotex-core/chainservice"
type ChainService struct {
// contains filtered or unexported fields
}
ChainService is a blockchain service with all blockchain components.
func New( cfg config.Config, p2pAgent *p2p.Agent, dispatcher dispatcher.Dispatcher, opts ...Option, ) (*ChainService, error)
New creates a ChainService from config and network.Overlay and dispatcher.Dispatcher.
func (cs *ChainService) APIServer() *api.Server
APIServer returns the API server
func (cs *ChainService) ActionPool() actpool.ActPool
ActionPool returns the Action pool
func (cs *ChainService) BlockDAO() blockdao.BlockDAO
BlockDAO returns the blockdao
func (cs *ChainService) BlockSync() blocksync.BlockSync
BlockSync returns the block syncer
func (cs *ChainService) Blockchain() blockchain.Blockchain
Blockchain returns the Blockchain
func (cs *ChainService) ChainID() uint32
ChainID returns ChainID.
func (cs *ChainService) Consensus() consensus.Consensus
Consensus returns the consensus instance
func (cs *ChainService) HandleAction(ctx context.Context, actPb *iotextypes.Action) error
HandleAction handles incoming action request.
func (cs *ChainService) HandleBlock(ctx context.Context, pbBlock *iotextypes.Block) error
HandleBlock handles incoming block request.
func (cs *ChainService) HandleBlockSync(ctx context.Context, pbBlock *iotextypes.Block) error
HandleBlockSync handles incoming block sync request.
func (cs *ChainService) HandleConsensusMsg(msg *iotextypes.ConsensusMessage) error
HandleConsensusMsg handles incoming consensus message.
func (cs *ChainService) HandleSyncRequest(ctx context.Context, peer peerstore.PeerInfo, sync *iotexrpc.BlockSync) error
HandleSyncRequest handles incoming sync request.
func (cs *ChainService) Registry() *protocol.Registry
Registry returns a pointer to the registry
func (cs *ChainService) Start(ctx context.Context) error
Start starts the server
func (cs *ChainService) StateFactory() factory.Factory
StateFactory returns the state factory
func (cs *ChainService) Stop(ctx context.Context) error
Stop stops the server
Option sets ChainService construction parameter.
WithSubChain is an option to create subChainService
WithTesting is an option to create a testing ChainService.
Package chainservice imports 34 packages (graph) and is imported by 1 packages. Updated 2019-12-13. Refresh now. Tools for package owners.