iotex-core: Index | Files

package chainservice

import ""


Package Files


type ChainService Uses

type ChainService struct {
    // contains filtered or unexported fields

ChainService is a blockchain service with all blockchain components.

func New Uses

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 (*ChainService) APIServer Uses

func (cs *ChainService) APIServer() *api.Server

APIServer returns the API server

func (*ChainService) ActionPool Uses

func (cs *ChainService) ActionPool() actpool.ActPool

ActionPool returns the Action pool

func (*ChainService) BlockDAO Uses

func (cs *ChainService) BlockDAO() blockdao.BlockDAO

BlockDAO returns the blockdao

func (*ChainService) BlockSync Uses

func (cs *ChainService) BlockSync() blocksync.BlockSync

BlockSync returns the block syncer

func (*ChainService) Blockchain Uses

func (cs *ChainService) Blockchain() blockchain.Blockchain

Blockchain returns the Blockchain

func (*ChainService) ChainID Uses

func (cs *ChainService) ChainID() uint32

ChainID returns ChainID.

func (*ChainService) Consensus Uses

func (cs *ChainService) Consensus() consensus.Consensus

Consensus returns the consensus instance

func (*ChainService) HandleAction Uses

func (cs *ChainService) HandleAction(ctx context.Context, actPb *iotextypes.Action) error

HandleAction handles incoming action request.

func (*ChainService) HandleBlock Uses

func (cs *ChainService) HandleBlock(ctx context.Context, pbBlock *iotextypes.Block) error

HandleBlock handles incoming block request.

func (*ChainService) HandleBlockSync Uses

func (cs *ChainService) HandleBlockSync(ctx context.Context, pbBlock *iotextypes.Block) error

HandleBlockSync handles incoming block sync request.

func (*ChainService) HandleConsensusMsg Uses

func (cs *ChainService) HandleConsensusMsg(msg *iotextypes.ConsensusMessage) error

HandleConsensusMsg handles incoming consensus message.

func (*ChainService) HandleSyncRequest Uses

func (cs *ChainService) HandleSyncRequest(ctx context.Context, peer peerstore.PeerInfo, sync *iotexrpc.BlockSync) error

HandleSyncRequest handles incoming sync request.

func (*ChainService) Registry Uses

func (cs *ChainService) Registry() *protocol.Registry

Registry returns a pointer to the registry

func (*ChainService) Start Uses

func (cs *ChainService) Start(ctx context.Context) error

Start starts the server

func (*ChainService) StateFactory Uses

func (cs *ChainService) StateFactory() factory.Factory

StateFactory returns the state factory

func (*ChainService) Stop Uses

func (cs *ChainService) Stop(ctx context.Context) error

Stop stops the server

type Option Uses

type Option func(ops *optionParams) error

Option sets ChainService construction parameter.

func WithSubChain Uses

func WithSubChain() Option

WithSubChain is an option to create subChainService

func WithTesting Uses

func WithTesting() Option

WithTesting is an option to create a testing ChainService.

Package chainservice imports 36 packages (graph) and is imported by 1 packages. Updated 2020-03-29. Refresh now. Tools for package owners.