syncer

package module
v0.0.0-...-d7ddf1b Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2022 License: Apache-2.0 Imports: 11 Imported by: 1

README

chain5j-syncer

简介

chain5j-syncer chain5j链同步模块。

功能

证书

chain5j-syncer 的源码允许用户在遵循 Apache 2.0 开源证书 规则的前提下使用。

版权

Copyright@2022 chain5j

chain5j

Documentation

Overview

Package syncer

@author: xwc1125

Package syncer

@author: xwc1125

Package syncer

@author: xwc1125

Package syncer

@author: xwc1125

Package syncer

@author: xwc1125

Package syncer

@author: xwc1125

Package syncer

@author: xwc1125

Package syncer

@author: xwc1125

Index

Constants

View Source
const (
	StatusMsg          = 0x00
	NewBlockHashesMsg  = 0x01
	TxMsg              = 0x02
	GetBlockHeadersMsg = 0x03
	BlockHeadersMsg    = 0x04
	GetBlockBodiesMsg  = 0x05
	BlockBodiesMsg     = 0x06
	NewBlockMsg        = 0x07
	GetNodeDataMsg     = 0x0d
	NodeDataMsg        = 0x0e
	GetReceiptsMsg     = 0x0f
	ReceiptsMsg        = 0x10
)

Variables

View Source
var (
	MaxHashFetch    = 512 // Amount of hashes to be fetched per retrieval request
	MaxBlockFetch   = 128 // Amount of blocks to be fetched per retrieval request
	MaxHeaderFetch  = 192 // Amount of block headers to be fetched per retrieval request
	MaxSkeletonSize = 128 // Number of header fetches to need for a skeleton assembly
	MaxBodyFetch    = 128 // Amount of block bodies to be fetched per retrieval request
	MaxReceiptFetch = 256 // Amount of transaction receipts to allow fetching per request
	MaxStateFetch   = 384 // Amount of node state values to allow fetching per request

)

Functions

func NewPeerBlock

func NewPeerBlock(header *models.Header) *peerBlock

func NewSyncer

func NewSyncer(rootCtx context.Context, opts ...option) (protocol.Syncer, error)

func WithApps

func WithApps(apps protocol.Apps) option

func WithBlockRW

func WithBlockRW(blockRW protocol.BlockReadWriter) option

func WithHandshake

func WithHandshake(handshake protocol.Handshake) option

func WithP2PService

func WithP2PService(p2pService protocol.P2PService) option

Types

This section is empty.

Jump to

Keyboard shortcuts

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