Documentation ¶
Index ¶
- Constants
- Variables
- func UpdateLogger()
- type ChainService
- func (cs *ChainService) GetBest(p peer.ID) (types.ID, uint32, error)
- func (cs *ChainService) GetBlock(p peer.ID, blockID types.ID) (*blocks.Block, error)
- func (cs *ChainService) GetBlockID(p peer.ID, height uint32) (types.ID, error)
- func (cs *ChainService) GetBlockTxids(p peer.ID, blockID types.ID) ([]types.ID, error)
- func (cs *ChainService) GetBlockTxs(p peer.ID, blockID types.ID, txIndexes []uint32) ([]*transactions.Transaction, error)
- func (cs *ChainService) GetBlockTxsStream(p peer.ID, startHeight uint32) (<-chan *blocks.BlockTxs, error)
- func (cs *ChainService) GetHeadersStream(p peer.ID, startHeight uint32) (<-chan *blocks.BlockHeader, error)
- func (cs *ChainService) HandleNewStream(s inet.Stream)
- type ConsensusChooser
- type FetchBlockFunc
- type SyncManager
Constants ¶
View Source
const ( ChainServiceProtocol = "/chainservice/" ChainServiceProtocolVersion = "1.0.0" )
Variables ¶
View Source
var ErrNotCurrent = errors.New("peer not current")
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
func UpdateLogger ¶
func UpdateLogger()
Types ¶
type ChainService ¶
type ChainService struct {
// contains filtered or unexported fields
}
func NewChainService ¶
func NewChainService(ctx context.Context, fetchBlock FetchBlockFunc, chain *blockchain.Blockchain, network *net.Network, params *params.NetworkParams) *ChainService
func (*ChainService) GetBlockID ¶
func (*ChainService) GetBlockTxids ¶
func (*ChainService) GetBlockTxs ¶
func (cs *ChainService) GetBlockTxs(p peer.ID, blockID types.ID, txIndexes []uint32) ([]*transactions.Transaction, error)
func (*ChainService) GetBlockTxsStream ¶
func (*ChainService) GetHeadersStream ¶
func (cs *ChainService) GetHeadersStream(p peer.ID, startHeight uint32) (<-chan *blocks.BlockHeader, error)
func (*ChainService) HandleNewStream ¶
func (cs *ChainService) HandleNewStream(s inet.Stream)
type SyncManager ¶
type SyncManager struct {
// contains filtered or unexported fields
}
func NewSyncManager ¶
func NewSyncManager(ctx context.Context, chain *blockchain.Blockchain, network *net.Network, params *params.NetworkParams, cs *ChainService, chooser ConsensusChooser, isCurrentCallback func()) *SyncManager
func (*SyncManager) Close ¶
func (sm *SyncManager) Close()
func (*SyncManager) IsCurrent ¶
func (sm *SyncManager) IsCurrent() bool
func (*SyncManager) SetCurrent ¶
func (sm *SyncManager) SetCurrent()
func (*SyncManager) Start ¶
func (sm *SyncManager) Start()
Click to show internal directories.
Click to hide internal directories.