state

package
v0.0.0-...-95b87ed Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefStateCheckInterval   = 10 * time.Second
	DefStateResponseTimeout = 3 * time.Second
	DefStateBatchSize       = 10
	DefStateMaxRetries      = 3
	DefStateBlockBufferSize = 100
	DefStateChannelSize     = 100
	DefStateEnabled         = true
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	AntiEntropyInterval             time.Duration
	AntiEntropyStateResponseTimeout time.Duration
	AntiEntropyBatchSize            uint64
	MaxBlockDistance                int
	AntiEntropyMaxRetries           int
	ChannelBufferSize               int
	EnableStateTransfer             bool
}

type GossipAdapter

type GossipAdapter interface {
	Send(msg *proto.GossipMessage, peers ...*comm.RemotePeer)

	Accept(acceptor common2.MessageAcceptor, passThrough bool) (<-chan *proto.GossipMessage, <-chan protoext.ReceivedMessage)

	UpdateLedgerHeight(height uint64, channelID common2.ChannelID)

	PeersOfChannel(common2.ChannelID) []discovery.NetworkMember
}

type GossipStateProvider

type GossipStateProvider interface {
	AddPayload(payload *proto.Payload) error

	Stop()
}

func NewGossipStateProvider

func NewGossipStateProvider(
	chainID string,
	services *ServicesMediator,
	ledger ledgerResources,
	stateMetrics *metrics.StateMetrics,
	blockingMode bool,
	config *StateConfig,
) GossipStateProvider

type GossipStateProviderImpl

type GossipStateProviderImpl struct {
	// contains filtered or unexported fields
}

func (*GossipStateProviderImpl) AddPayload

func (s *GossipStateProviderImpl) AddPayload(payload *proto.Payload) error

func (*GossipStateProviderImpl) Stop

func (s *GossipStateProviderImpl) Stop()

type MCSAdapter

type MCSAdapter interface {
	VerifyBlock(channelID common2.ChannelID, seqNum uint64, signedBlock *common.Block) error

	VerifyByChannel(channelID common2.ChannelID, peerIdentity api.PeerIdentityType, signature, message []byte) error
}

type PayloadsBuffer

type PayloadsBuffer interface {
	Push(payload *proto.Payload)

	Next() uint64

	Pop() *proto.Payload

	Size() int

	Ready() chan struct{}

	Close()
}

func NewPayloadsBuffer

func NewPayloadsBuffer(next uint64) PayloadsBuffer

type PayloadsBufferImpl

type PayloadsBufferImpl struct {
	// contains filtered or unexported fields
}

func (*PayloadsBufferImpl) Close

func (b *PayloadsBufferImpl) Close()

func (*PayloadsBufferImpl) Next

func (b *PayloadsBufferImpl) Next() uint64

func (*PayloadsBufferImpl) Pop

func (b *PayloadsBufferImpl) Pop() *proto.Payload

func (*PayloadsBufferImpl) Push

func (b *PayloadsBufferImpl) Push(payload *proto.Payload)

func (*PayloadsBufferImpl) Ready

func (b *PayloadsBufferImpl) Ready() chan struct{}

func (*PayloadsBufferImpl) Size

func (b *PayloadsBufferImpl) Size() int

type ServicesMediator

type ServicesMediator struct {
	GossipAdapter
	MCSAdapter
}

type StateConfig

type StateConfig struct {
	StateCheckInterval   time.Duration
	StateResponseTimeout time.Duration
	StateBatchSize       uint64
	StateMaxRetries      int
	StateBlockBufferSize int
	StateChannelSize     int
	StateEnabled         bool
}

func GlobalConfig

func GlobalConfig() *StateConfig

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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