Versions in this module Expand all Collapse all v1 v1.4.10 Dec 9, 2020 Changes in this version + const MinimumExpirationWarningInterval + const RetryTimeout + var EgressQueueCapacityOpts = metrics.GaugeOpts + var EgressQueueLengthOpts = metrics.GaugeOpts + var EgressStreamsCountOpts = metrics.GaugeOpts + var EgressTLSConnectionCountOpts = metrics.GaugeOpts + var EgressWorkersOpts = metrics.GaugeOpts + var ErrForbidden = errors.New("forbidden pulling the channel") + var ErrNotInChannel = errors.New("not in the channel") + var ErrRetryCountExhausted = errors.New("retry attempts exhausted") + var ErrServiceUnavailable = errors.New("service unavailable") + var ErrSkipped = errors.New("skipped") + var IngressStreamsCountOpts = metrics.GaugeOpts + var MessageSendTimeOpts = metrics.HistogramOpts + var MessagesDroppedCountOpts = metrics.CounterOpts + func AnyChannel(_ string) bool + func BlockToString(block *common.Block) string + func ChannelCreationBlockToGenesisBlock(block *common.Block) (*common.Block, error) + func ConfigFromBlock(block *common.Block) (*common.ConfigEnvelope, error) + func DERtoPEM(der []byte) string + func IsNewChannelBlock(block *common.Block) (string, error) + func LastConfigBlock(block *common.Block, blockRetriever BlockRetriever) (*common.Block, error) + func NewStreamsByType() map[OperationType]map[uint64]*Stream + func Participant(puller ChainPuller, analyzeLastConfBlock SelfMembershipPredicate) error + func PullLastConfigBlock(puller ChainPuller) (*common.Block, error) + func SignatureSetFromBlock(block *common.Block) ([]*common.SignedData, error) + func VerifyBlockHash(indexInBuffer int, blockBuff []*common.Block) error + func VerifyBlockSignature(block *common.Block, verifier BlockVerifier, config *common.ConfigEnvelope) error + func VerifyBlocks(blockBuff []*common.Block, signatureVerifier BlockVerifier) error + type BlockCommitFunc func(block *common.Block, channel string) + type BlockPuller struct + Channel string + Dialer Dialer + Endpoints []EndpointCriteria + FetchTimeout time.Duration + Logger *flogging.FabricLogger + MaxPullBlockRetries uint64 + MaxTotalBufferBytes int + RetryTimeout time.Duration + Signer crypto.LocalSigner + TLSCert []byte + VerifyBlockSequence BlockSequenceVerifier + func BlockPullerFromConfigBlock(conf PullerConfig, block *common.Block, verifierRetriever VerifierRetriever) (*BlockPuller, error) + func (p *BlockPuller) Clone() *BlockPuller + func (p *BlockPuller) Close() + func (p *BlockPuller) HeightsByEndpoints() (map[string]uint64, error) + func (p *BlockPuller) PullBlock(seq uint64) *common.Block + type BlockRetriever interface + Block func(number uint64) *common.Block + type BlockSequenceVerifier func(blocks []*common.Block, channel string) error + type BlockValidationPolicyVerifier struct + Channel string + Logger *flogging.FabricLogger + PolicyMgr policies.Manager + func (bv *BlockValidationPolicyVerifier) VerifyBlockSignature(sd []*common.SignedData, envelope *common.ConfigEnvelope) error + type BlockVerifier interface + VerifyBlockSignature func(sd []*common.SignedData, config *common.ConfigEnvelope) error + type BlockVerifierAssembler struct + Logger *flogging.FabricLogger + func (bva *BlockVerifierAssembler) VerifierFromConfig(configuration *common.ConfigEnvelope, channel string) (BlockVerifier, error) + type CertificateComparator func([]byte, []byte) bool + func CachePublicKeyComparisons(f CertificateComparator) CertificateComparator + type ChainInspector struct + LastConfigBlock *common.Block + Logger *flogging.FabricLogger + Puller ChainPuller + func (ci *ChainInspector) Channels() []ChannelGenesisBlock + func (ci *ChainInspector) Close() + type ChainPuller interface + Close func() + HeightsByEndpoints func() (map[string]uint64, error) + PullBlock func(seq uint64) *common.Block + type ChannelExtractor interface + TargetChannel func(message proto.Message) string + type ChannelGenesisBlock struct + ChannelName string + GenesisBlock *common.Block + type ChannelLister interface + Channels func() []ChannelGenesisBlock + Close func() + type ChannelPredicate func(channelName string) bool + type ClusterClient interface + Step func(ctx context.Context, opts ...grpc.CallOption) (orderer.Cluster_StepClient, error) + type Comm struct + CertExpWarningThreshold time.Duration + Chan2Members MembersByChannel + ChanExt ChannelExtractor + CompareCertificate CertificateComparator + Connections *ConnectionStore + H Handler + Lock sync.RWMutex + Logger *flogging.FabricLogger + Metrics *Metrics + MinimumExpirationWarningInterval time.Duration + SendBufferSize int + func (c *Comm) Configure(channel string, newNodes []RemoteNode) + func (c *Comm) DispatchConsensus(ctx context.Context, request *orderer.ConsensusRequest) error + func (c *Comm) DispatchSubmit(ctx context.Context, request *orderer.SubmitRequest) error + func (c *Comm) Remote(channel string, id uint64) (*RemoteContext, error) + func (c *Comm) Shutdown() + type Communicator interface + Configure func(channel string, members []RemoteNode) + Remote func(channel string, id uint64) (*RemoteContext, error) + Shutdown func() + type ComparisonMemoizer struct + F func(a, b []byte) bool + MaxEntries uint16 + func (cm *ComparisonMemoizer) Compare(a, b []byte) bool + func (cm *ComparisonMemoizer) Size() int + type ConnByCertMap map[string]*grpc.ClientConn + func (cbc ConnByCertMap) Lookup(cert []byte) (*grpc.ClientConn, bool) + func (cbc ConnByCertMap) Put(cert []byte, conn *grpc.ClientConn) + func (cbc ConnByCertMap) Remove(cert []byte) + func (cbc ConnByCertMap) Size() int + type ConnectionMapper interface + Lookup func(cert []byte) (*grpc.ClientConn, bool) + Put func(cert []byte, conn *grpc.ClientConn) + Remove func(cert []byte) + Size func() int + type ConnectionStore struct + Connections ConnectionMapper + func NewConnectionStore(dialer SecureDialer, tlsConnectionCount metrics.Gauge) *ConnectionStore + func (c *ConnectionStore) Connection(endpoint string, expectedServerCert []byte) (*grpc.ClientConn, error) + func (c *ConnectionStore) Disconnect(expectedServerCert []byte) + type Dialer interface + Dial func(endpointCriteria EndpointCriteria) (*grpc.ClientConn, error) + type Dispatcher interface + DispatchConsensus func(ctx context.Context, request *orderer.ConsensusRequest) error + DispatchSubmit func(ctx context.Context, request *orderer.SubmitRequest) error + type EndpointCriteria struct + Endpoint string + TLSRootCAs [][]byte + func EndpointconfigFromConfigBlock(block *common.Block) ([]EndpointCriteria, error) + type GenesisBlocks []ChannelGenesisBlock + func (gbs GenesisBlocks) Names() []string + type Handler interface + OnConsensus func(channel string, sender uint64, req *orderer.ConsensusRequest) error + OnSubmit func(channel string, sender uint64, req *orderer.SubmitRequest) error + type ImpatientStream struct + func (stream *ImpatientStream) Recv() (*orderer.DeliverResponse, error) + type ImpatientStreamCreator func() (*ImpatientStream, error) + func NewImpatientStream(conn *grpc.ClientConn, waitTimeout time.Duration) ImpatientStreamCreator + type LedgerFactory interface + GetOrCreate func(chainID string) (LedgerWriter, error) + type LedgerInterceptor struct + Channel string + InterceptBlockCommit BlockCommitFunc + func (interceptor *LedgerInterceptor) Append(block *common.Block) error + type LedgerWriter interface + Append func(block *common.Block) error + Height func() uint64 + type MemberMapping struct + SamePublicKey CertificateComparator + func (mp *MemberMapping) Foreach(f func(id uint64, stub *Stub)) + func (mp *MemberMapping) Put(stub *Stub) + func (mp *MemberMapping) Remove(ID uint64) + func (mp MemberMapping) ByID(ID uint64) *Stub + func (mp MemberMapping) LookupByClientCert(cert []byte) *Stub + func (mp MemberMapping) ServerCertificates() StringSet + type MembersByChannel map[string]MemberMapping + type Metrics struct + EgressQueueCapacity metrics.Gauge + EgressQueueLength metrics.Gauge + EgressStreamsCount metrics.Gauge + EgressTLSConnectionCount metrics.Gauge + EgressWorkerCount metrics.Gauge + IngressStreamsCount metrics.Gauge + MessageSendTime metrics.Histogram + MessagesDroppedCount metrics.Counter + func NewMetrics(provider MetricsProvider) *Metrics + type MetricsProvider interface + NewCounter func(opts metrics.CounterOpts) metrics.Counter + NewGauge func(opts metrics.GaugeOpts) metrics.Gauge + NewHistogram func(opts metrics.HistogramOpts) metrics.Histogram + type NoopBlockVerifier struct + func (*NoopBlockVerifier) VerifyBlockSignature(sd []*common.SignedData, config *common.ConfigEnvelope) error + type OperationType int + const ConsensusOperation + const SubmitOperation + type PredicateDialer struct + func (dialer *PredicateDialer) Dial(address string, verifyFunc RemoteVerifier) (*grpc.ClientConn, error) + func (dialer *PredicateDialer) UpdateRootCAs(serverRootCAs [][]byte) + type PullerConfig struct + Channel string + MaxTotalBufferBytes int + Signer crypto.LocalSigner + TLSCert []byte + TLSKey []byte + Timeout time.Duration + func PullerConfigFromTopLevelConfig(systemChannel string, conf *localconfig.TopLevel, tlsKey, tlsCert []byte, ...) PullerConfig + type RPC struct + Channel string + Comm Communicator + Logger *flogging.FabricLogger + StreamsByType map[OperationType]map[uint64]*Stream + Timeout time.Duration + func (s *RPC) SendConsensus(destination uint64, msg *orderer.ConsensusRequest) error + func (s *RPC) SendSubmit(destination uint64, request *orderer.SubmitRequest) error + type RemoteContext struct + Channel string + Client orderer.ClusterClient + Logger *flogging.FabricLogger + Metrics *Metrics + ProbeConn func(conn *grpc.ClientConn) error + SendBuffSize int + func (rc *RemoteContext) Abort() + func (rc *RemoteContext) NewStream(timeout time.Duration) (*Stream, error) + type RemoteNode struct + ClientTLSCert []byte + Endpoint string + ID uint64 + ServerTLSCert []byte + func (rm RemoteNode) String() string + type RemoteVerifier func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error + type Replicator struct + AmIPartOfChannel SelfMembershipPredicate + BootBlock *common.Block + ChannelLister ChannelLister + DoNotPanicIfClusterNotReachable bool + Filter ChannelPredicate + LedgerFactory LedgerFactory + Logger *flogging.FabricLogger + Puller *BlockPuller + SystemChannel string + func (r *Replicator) IsReplicationNeeded() (bool, error) + func (r *Replicator) PullChannel(channel string) error + func (r *Replicator) ReplicateChains() []string + type SecureDialer interface + Dial func(address string, verifyFunc RemoteVerifier) (*grpc.ClientConn, error) + type SelfMembershipPredicate func(configBlock *common.Block) error + type Service struct + CertExpWarningThreshold time.Duration + Dispatcher Dispatcher + Logger *flogging.FabricLogger + MinimumExpirationWarningInterval time.Duration + StepLogger *flogging.FabricLogger + StreamCountReporter *StreamCountReporter + func (s *Service) Step(stream orderer.Cluster_StepServer) error + type StandardDialer struct + func (dialer *StandardDialer) Dial(endpointCriteria EndpointCriteria) (*grpc.ClientConn, error) + type StepClient interface + Recv func() (*orderer.StepResponse, error) + Send func(*orderer.StepRequest) error + type StepStream interface + Recv func() (*orderer.StepRequest, error) + Send func(response *orderer.StepResponse) error + type Stream struct + Cancel func(error) + Channel string + Endpoint string + ID uint64 + Logger *flogging.FabricLogger + NodeName string + Timeout time.Duration + func (stream *Stream) Canceled() bool + func (stream *Stream) Recv() (*orderer.StepResponse, error) + func (stream *Stream) Send(request *orderer.StepRequest) error + type StreamCountReporter struct + Metrics *Metrics + func (scr *StreamCountReporter) Decrement() + func (scr *StreamCountReporter) Increment() + type StreamOperation func() (*orderer.StepResponse, error) + type StringSet map[string]struct + type Stub struct + func (stub *Stub) Activate(createRemoteContext func() (*RemoteContext, error)) error + func (stub *Stub) Active() bool + func (stub *Stub) Deactivate() + type VerificationRegistry struct + LoadVerifier func(chain string) BlockVerifier + Logger *flogging.FabricLogger + VerifierFactory VerifierFactory + VerifiersByChannel map[string]BlockVerifier + func (vr *VerificationRegistry) BlockCommitted(block *common.Block, channel string) + func (vr *VerificationRegistry) RegisterVerifier(chain string) + func (vr *VerificationRegistry) RetrieveVerifier(channel string) BlockVerifier + type VerifierFactory interface + VerifierFromConfig func(configuration *common.ConfigEnvelope, channel string) (BlockVerifier, error) + type VerifierRetriever interface + RetrieveVerifier func(channel string) BlockVerifier