iotex-core: github.com/iotexproject/iotex-core/chainservice Index | Files

package chainservice

import "github.com/iotexproject/iotex-core/chainservice"

Index

Package Files

chainservice.go

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) ActionPool Uses

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

ActionPool returns the Action pool

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) ElectionCommittee Uses

func (cs *ChainService) ElectionCommittee() committee.Committee

ElectionCommittee returns the election committee

func (*ChainService) HandleAction Uses

func (cs *ChainService) HandleAction(_ 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) RegisterProtocol Uses

func (cs *ChainService) RegisterProtocol(id string, p protocol.Protocol) error

RegisterProtocol register a protocol

func (*ChainService) Registry Uses

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

Registry returns a pointer to the registry

func (*ChainService) RollDPoSProtocol Uses

func (cs *ChainService) RollDPoSProtocol() *rolldpos.Protocol

RollDPoSProtocol returns the roll dpos protocol

func (*ChainService) Start Uses

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

Start starts the server

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 WithTesting Uses

func WithTesting() Option

WithTesting is an option to create a testing ChainService.

Package chainservice imports 23 packages (graph) and is imported by 1 packages. Updated 2019-08-13. Refresh now. Tools for package owners.