{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v1.4.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cluster\n\n## Constants\n\n```go\nconst (\n\t// MinimumExpirationWarningInterval is the default minimum time interval\n\t// between consecutive warnings about certificate expiration.\n\tMinimumExpirationWarningInterval = time.Minute * 5\n)\n```\n\n```go\nconst (\n\t// RetryTimeout is the time the block puller retries.\n\tRetryTimeout = time.Second * 10\n)\n```\n\n## Variables\n\n```go\nvar (\n\tEgressQueueLengthOpts = metrics.GaugeOpts{\n\t\tNamespace:    \"cluster\",\n\t\tSubsystem:    \"comm\",\n\t\tName:         \"egress_queue_length\",\n\t\tHelp:         \"Length of the egress queue.\",\n\t\tLabelNames:   []string{\"host\", \"msg_type\", \"channel\"},\n\t\tStatsdFormat: \"%{#fqname}.%{host}.%{msg_type}.%{channel}\",\n\t}\n\n\tEgressQueueCapacityOpts = metrics.GaugeOpts{\n\t\tNamespace:    \"cluster\",\n\t\tSubsystem:    \"comm\",\n\t\tName:         \"egress_queue_capacity\",\n\t\tHelp:         \"Capacity of the egress queue.\",\n\t\tLabelNames:   []string{\"host\", \"msg_type\", \"channel\"},\n\t\tStatsdFormat: \"%{#fqname}.%{host}.%{msg_type}.%{channel}\",\n\t}\n\n\tEgressWorkersOpts = metrics.GaugeOpts{\n\t\tNamespace:    \"cluster\",\n\t\tSubsystem:    \"comm\",\n\t\tName:         \"egress_queue_workers\",\n\t\tHelp:         \"Count of egress queue workers.\",\n\t\tLabelNames:   []string{\"channel\"},\n\t\tStatsdFormat: \"%{#fqname}.%{channel}\",\n\t}\n\n\tIngressStreamsCountOpts = metrics.GaugeOpts{\n\t\tNamespace:    \"cluster\",\n\t\tSubsystem:    \"comm\",\n\t\tName:         \"ingress_stream_count\",\n\t\tHelp:         \"Count of streams from other nodes.\",\n\t\tStatsdFormat: \"%{#fqname}\",\n\t}\n\n\tEgressStreamsCountOpts = metrics.GaugeOpts{\n\t\tNamespace:    \"cluster\",\n\t\tSubsystem:    \"comm\",\n\t\tName:         \"egress_stream_count\",\n\t\tHelp:         \"Count of streams to other nodes.\",\n\t\tLabelNames:   []string{\"channel\"},\n\t\tStatsdFormat: \"%{#fqname}.%{channel}\",\n\t}\n\n\tEgressTLSConnectionCountOpts = metrics.GaugeOpts{\n\t\tNamespace:    \"cluster\",\n\t\tSubsystem:    \"comm\",\n\t\tName:         \"egress_tls_connection_count\",\n\t\tHelp:         \"Count of TLS connections to other nodes.\",\n\t\tStatsdFormat: \"%{#fqname}\",\n\t}\n\n\tMessageSendTimeOpts = metrics.HistogramOpts{\n\t\tNamespace:    \"cluster\",\n\t\tSubsystem:    \"comm\",\n\t\tName:         \"msg_send_time\",\n\t\tHelp:         \"The time it takes to send a message in seconds.\",\n\t\tLabelNames:   []string{\"host\", \"channel\"},\n\t\tStatsdFormat: \"%{#fqname}.%{host}.%{channel}\",\n\t}\n\n\tMessagesDroppedCountOpts = metrics.CounterOpts{\n\t\tNamespace:    \"cluster\",\n\t\tSubsystem:    \"comm\",\n\t\tName:         \"msg_dropped_count\",\n\t\tHelp:         \"Count of messages dropped.\",\n\t\tLabelNames:   []string{\"host\", \"channel\"},\n\t\tStatsdFormat: \"%{#fqname}.%{host}.%{channel}\",\n\t}\n)\n```\n\n```go\nvar ErrForbidden = errors.New(\"forbidden pulling the channel\")\n```\nErrForbidden denotes that an ordering node refuses sending blocks due to access control.\n\n```go\nvar ErrNotInChannel = errors.New(\"not in the channel\")\n```\nErrNotInChannel denotes that an ordering node is not in the channel\n\n```go\nvar ErrRetryCountExhausted = errors.New(\"retry attempts exhausted\")\n```\n\n```go\nvar ErrServiceUnavailable = errors.New(\"service unavailable\")\n```\nErrServiceUnavailable denotes that an ordering node is not servicing at the moment.\n\n```go\nvar ErrSkipped = errors.New(\"skipped\")\n```\nErrSkipped denotes that replicating a chain was skipped\n\n## Functions\n\n```go\nfunc AnyChannel(_ string) bool\n```\nAnyChannel accepts all channels.\n\n```go\nfunc BlockToString(block *common.Block) string\n```\nBlockToString returns a string representation of this block.\n\n```go\nfunc ChannelCreationBlockToGenesisBlock(block *common.Block) (*common.Block, error)\n```\nChannelCreationBlockToGenesisBlock converts a channel creation block to a genesis block\n\n```go\nfunc ConfigFromBlock(block *common.Block) (*common.ConfigEnvelope, error)\n```\nConfigFromBlock returns a ConfigEnvelope if exists, or a \\*NotAConfigBlock error. It may also return some other error in case parsing failed.\n\n```go\nfunc DERtoPEM(der []byte) string\n```\nDERtoPEM returns a PEM representation of the DER encoded certificate\n\n```go\nfunc IsNewChannelBlock(block *common.Block) (string, error)\n```\nIsNewChannelBlock returns a name of the channel in case it holds a channel create transaction, or empty string otherwise.\n\n```go\nfunc LastConfigBlock(block *common.Block, blockRetriever BlockRetriever) (*common.Block, error)\n```\nLastConfigBlock returns the last config block relative to the given block.\n\n```go\nfunc NewStreamsByType() map[OperationType]map[uint64]*Stream\n```\nNewStreamsByType returns a mapping of operation type to a mapping of destination to stream.\n\n```go\nfunc Participant(puller ChainPuller, analyzeLastConfBlock SelfMembershipPredicate) error\n```\nParticipant returns whether the caller participates in the chain. It receives a ChainPuller that should already be calibrated for the chain, and a SelfMembershipPredicate that is used to detect whether the caller should service the chain. It returns nil if the caller participates in the chain. It may return: ErrNotInChannel in case the caller doesn't participate in the chain. ErrForbidden in case the caller is forbidden from pulling the block. ErrServiceUnavailable in case all orderers reachable cannot complete the request. ErrRetryCountExhausted in case no orderer is reachable.\n\n```go\nfunc PullLastConfigBlock(puller ChainPuller) (*common.Block, error)\n```\nPullLastConfigBlock pulls the last configuration block, or returns an error on failure.\n\n```go\nfunc SignatureSetFromBlock(block *common.Block) ([]*common.SignedData, error)\n```\nSignatureSetFromBlock creates a signature set out of a block.\n\n```go\nfunc VerifyBlockHash(indexInBuffer int, blockBuff []*common.Block) error\n```\nVerifyBlockHash verifies the hash chain of the block with the given index among the blocks of the given block buffer.\n\n```go\nfunc VerifyBlockSignature(block *common.Block, verifier BlockVerifier, config *common.ConfigEnvelope) error\n```\nVerifyBlockSignature verifies the signature on the block with the given BlockVerifier and the given config.\n\n```go\nfunc VerifyBlocks(blockBuff []*common.Block, signatureVerifier BlockVerifier) error\n```\nVerifyBlocks verifies the given consecutive sequence of blocks is valid, and returns nil if it's valid, else an error.\n\n## Types\n\n```go\ntype BlockCommitFunc func(block *common.Block, channel string)\n```\nBlockCommitFunc signals a block commit.\n\n```go\ntype BlockPuller struct {\n\t// Configuration\n\tMaxPullBlockRetries uint64\n\tMaxTotalBufferBytes int\n\tSigner              crypto.LocalSigner\n\tTLSCert             []byte\n\tChannel             string\n\tFetchTimeout        time.Duration\n\tRetryTimeout        time.Duration\n\tLogger              *flogging.FabricLogger\n\tDialer              Dialer\n\tVerifyBlockSequence BlockSequenceVerifier\n\tEndpoints           []EndpointCriteria\n\t// contains filtered or unexported fields\n}\n```\nBlockPuller pulls blocks from remote ordering nodes. Its operations are not thread safe.\n\n```go\nfunc BlockPullerFromConfigBlock(conf PullerConfig, block *common.Block, verifierRetriever VerifierRetriever) (*BlockPuller, error)\n```\nBlockPullerFromConfigBlock returns a BlockPuller that doesn't verify signatures on blocks.\n\n```go\nfunc (p *BlockPuller) Clone() *BlockPuller\n```\nClone returns a copy of this BlockPuller initialized for the given channel\n\n```go\nfunc (p *BlockPuller) Close()\n```\nClose makes the BlockPuller close the connection and stream with the remote endpoint, and wipe the internal block buffer.\n\n```go\nfunc (p *BlockPuller) HeightsByEndpoints() (map[string]uint64, error)\n```\nHeightsByEndpoints returns the block heights by endpoints of orderers\n\n```go\nfunc (p *BlockPuller) PullBlock(seq uint64) *common.Block\n```\nPullBlock blocks until a block with the given sequence is fetched from some remote ordering node, or until consecutive failures of fetching the block exceed MaxPullBlockRetries.\n\n```go\ntype BlockRetriever interface {\n\t// Block returns a block with the given number,\n\t// or nil if such a block doesn't exist.\n\tBlock(number uint64) *common.Block\n}\n```\nBlockRetriever retrieves blocks\n\n```go\ntype BlockSequenceVerifier func(blocks []*common.Block, channel string) error\n```\nBlockSequenceVerifier verifies that the given consecutive sequence of blocks is valid.\n\n```go\ntype BlockValidationPolicyVerifier struct {\n\tLogger    *flogging.FabricLogger\n\tChannel   string\n\tPolicyMgr policies.Manager\n}\n```\nBlockValidationPolicyVerifier verifies signatures based on the block validation policy.\n\n```go\nfunc (bv *BlockValidationPolicyVerifier) VerifyBlockSignature(sd []*common.SignedData, envelope *common.ConfigEnvelope) error\n```\nVerifyBlockSignature verifies the signed data associated to a block, optionally with the given config envelope.\n\n```go\ntype BlockVerifier interface {\n\t// VerifyBlockSignature verifies a signature of a block.\n\t// It has an optional argument of a configuration envelope\n\t// which would make the block verification to use validation rules\n\t// based on the given configuration in the ConfigEnvelope.\n\t// If the config envelope passed is nil, then the validation rules used\n\t// are the ones that were applied at commit of previous blocks.\n\tVerifyBlockSignature(sd []*common.SignedData, config *common.ConfigEnvelope) error\n}\n```\nBlockVerifier verifies block signatures.\n\n```go\ntype BlockVerifierAssembler struct {\n\tLogger *flogging.FabricLogger\n}\n```\nBlockVerifierAssembler creates a BlockVerifier out of a config envelope\n\n```go\nfunc (bva *BlockVerifierAssembler) VerifierFromConfig(configuration *common.ConfigEnvelope, channel string) (BlockVerifier, error)\n```\nVerifierFromConfig creates a BlockVerifier from the given configuration.\n\n```go\ntype ChainInspector struct {\n\tLogger          *flogging.FabricLogger\n\tPuller          ChainPuller\n\tLastConfigBlock *common.Block\n}\n```\nChainInspector walks over a chain\n\n```go\nfunc (ci *ChainInspector) Channels() []ChannelGenesisBlock\n```\nChannels returns the list of ChannelGenesisBlocks for all channels. Each such ChannelGenesisBlock contains the genesis block of the channel.\n\n```go\nfunc (ci *ChainInspector) Close()\n```\nClose closes the ChainInspector\n\n```go\ntype ChainPuller interface {\n\t// PullBlock pulls the given block from some orderer node\n\tPullBlock(seq uint64) *common.Block\n\n\t// HeightsByEndpoints returns the block heights by endpoints of orderers\n\tHeightsByEndpoints() (map[string]uint64, error)\n\n\t// Close closes the ChainPuller\n\tClose()\n}\n```\nChainPuller pulls blocks from a chain\n\n```go\ntype ChannelExtractor interface {\n\tTargetChannel(message proto.Message) string\n}\n```\nChannelExtractor extracts the channel of a given message, or returns an empty string if that's not possible\n\n```go\ntype ChannelGenesisBlock struct {\n\tChannelName  string\n\tGenesisBlock *common.Block\n}\n```\nChannelGenesisBlock wraps a Block and its channel name\n\n```go\ntype ChannelLister interface {\n\t// Channels returns a list of channels\n\tChannels() []ChannelGenesisBlock\n\t// Close closes the ChannelLister\n\tClose()\n}\n```\nChannelLister returns a list of channels\n\n```go\ntype ChannelPredicate func(channelName string) bool\n```\nChannelPredicate accepts channels according to their names.\n\n```go\ntype ClusterClient interface {\n\tStep(ctx context.Context, opts ...grpc.CallOption) (orderer.Cluster_StepClient, error)\n}\n```\nClusterClient creates streams that point to a remote cluster member.\n\n```go\ntype Comm struct {\n\tMinimumExpirationWarningInterval time.Duration\n\tCertExpWarningThreshold          time.Duration\n\n\tSendBufferSize int\n\tLock           sync.RWMutex\n\tLogger         *flogging.FabricLogger\n\tChanExt        ChannelExtractor\n\tH              Handler\n\tConnections    *ConnectionStore\n\tChan2Members   MembersByChannel\n\tMetrics        *Metrics\n\t// contains filtered or unexported fields\n}\n```\nComm implements Communicator\n\n```go\nfunc (c *Comm) Configure(channel string, newNodes []RemoteNode)\n```\nConfigure configures the channel with the given RemoteNodes\n\n```go\nfunc (c *Comm) DispatchConsensus(ctx context.Context, request *orderer.ConsensusRequest) error\n```\nDispatchConsensus identifies the channel and sender of the step request and passes it to the underlying Handler\n\n```go\nfunc (c *Comm) DispatchSubmit(ctx context.Context, request *orderer.SubmitRequest) error\n```\nDispatchSubmit identifies the channel and sender of the submit request and passes it to the underlying Handler\n\n```go\nfunc (c *Comm) Remote(channel string, id uint64) (*RemoteContext, error)\n```\nRemote obtains a RemoteContext linked to the destination node on the context of a given channel\n\n```go\nfunc (c *Comm) Shutdown()\n```\nShutdown shuts down the instance\n\n```go\ntype Communicator interface {\n\t// Remote returns a RemoteContext for the given RemoteNode ID in the context\n\t// of the given channel, or error if connection cannot be established, or\n\t// the channel wasn't configured\n\tRemote(channel string, id uint64) (*RemoteContext, error)\n\t// Configure configures the communication to connect to all\n\t// given members, and disconnect from any members not among the given\n\t// members.\n\tConfigure(channel string, members []RemoteNode)\n\t// Shutdown shuts down the communicator\n\tShutdown()\n}\n```\nCommunicator defines communication for a consenter\n\n```go\ntype ConnByCertMap map[string]*grpc.ClientConn\n```\nConnByCertMap maps certificates represented as strings to gRPC connections\n\n```go\nfunc (cbc ConnByCertMap) Lookup(cert []byte) (*grpc.ClientConn, bool)\n```\nLookup looks up a certificate and returns the connection that was mapped to the certificate, and whether it was found or not\n\n```go\nfunc (cbc ConnByCertMap) Put(cert []byte, conn *grpc.ClientConn)\n```\nPut associates the given connection to the certificate\n\n```go\nfunc (cbc ConnByCertMap) Remove(cert []byte)\n```\nRemove removes the connection that is associated to the given certificate\n\n```go\nfunc (cbc ConnByCertMap) Size() int\n```\n\n```go\ntype ConnectionMapper interface {\n\tLookup(cert []byte) (*grpc.ClientConn, bool)\n\tPut(cert []byte, conn *grpc.ClientConn)\n\tRemove(cert []byte)\n\tSize() int\n}\n```\nConnectionMapper maps certificates to connections\n\n```go\ntype ConnectionStore struct {\n\tConnections ConnectionMapper\n\t// contains filtered or unexported fields\n}\n```\nConnectionStore stores connections to remote nodes\n\n```go\nfunc NewConnectionStore(dialer SecureDialer, tlsConnectionCount metrics.Gauge) *ConnectionStore\n```\nNewConnectionStore creates a new ConnectionStore with the given SecureDialer\n\n```go\nfunc (c *ConnectionStore) Connection(endpoint string, expectedServerCert []byte) (*grpc.ClientConn, error)\n```\nConnection obtains a connection to the given endpoint and expects the given server certificate to be presented by the remote node\n\n```go\nfunc (c *ConnectionStore) Disconnect(expectedServerCert []byte)\n```\nDisconnect closes the gRPC connection that is mapped to the given certificate\n\n```go\ntype Dialer interface {\n\tDial(endpointCriteria EndpointCriteria) (*grpc.ClientConn, error)\n}\n```\nDialer creates a gRPC connection to a remote address\n\n```go\ntype Dispatcher interface {\n\tDispatchSubmit(ctx context.Context, request *orderer.SubmitRequest) error\n\tDispatchConsensus(ctx context.Context, request *orderer.ConsensusRequest) error\n}\n```\nDispatcher dispatches requests\n\n```go\ntype EndpointCriteria struct {\n\tEndpoint   string   // Endpoint of the form host:port\n\tTLSRootCAs [][]byte // PEM encoded TLS root CA certificates\n}\n```\nEndpointCriteria defines criteria of how to connect to a remote orderer node.\n\n```go\nfunc EndpointconfigFromConfigBlock(block *common.Block) ([]EndpointCriteria, error)\n```\nEndpointconfigFromConfigBlock retrieves TLS CA certificates and endpoints from a config block.\n\n```go\ntype GenesisBlocks []ChannelGenesisBlock\n```\nGenesisBlocks aggregates several ChannelGenesisBlocks\n\n```go\nfunc (gbs GenesisBlocks) Names() []string\n```\nNames returns the channel names all ChannelGenesisBlocks\n\n```go\ntype Handler interface {\n\tOnConsensus(channel string, sender uint64, req *orderer.ConsensusRequest) error\n\tOnSubmit(channel string, sender uint64, req *orderer.SubmitRequest) error\n}\n```\nHandler handles Step() and Submit() requests and returns a corresponding response\n\n```go\ntype ImpatientStream struct {\n\torderer.AtomicBroadcast_DeliverClient\n\t// contains filtered or unexported fields\n}\n```\nImpatientStream aborts the stream if it waits for too long for a message.\n\n```go\nfunc (stream *ImpatientStream) Recv() (*orderer.DeliverResponse, error)\n```\nRecv blocks until a response is received from the stream or the timeout expires.\n\n```go\ntype ImpatientStreamCreator func() (*ImpatientStream, error)\n```\nImpatientStreamCreator creates an ImpatientStream\n\n```go\nfunc NewImpatientStream(conn *grpc.ClientConn, waitTimeout time.Duration) ImpatientStreamCreator\n```\nNewImpatientStream returns a ImpatientStreamCreator that creates impatientStreams.\n\n```go\ntype LedgerFactory interface {\n\t// GetOrCreate gets an existing ledger (if it exists)\n\t// or creates it if it does not\n\tGetOrCreate(chainID string) (LedgerWriter, error)\n}\n```\nLedgerFactory retrieves or creates new ledgers by chainID\n\n```go\ntype LedgerInterceptor struct {\n\tChannel              string\n\tInterceptBlockCommit BlockCommitFunc\n\tLedgerWriter\n}\n```\nLedgerInterceptor intercepts block commits.\n\n```go\nfunc (interceptor *LedgerInterceptor) Append(block *common.Block) error\n```\nAppend commits a block into the ledger, and also fires the configured callback.\n\n```go\ntype LedgerWriter interface {\n\t// Append a new block to the ledger\n\tAppend(block *common.Block) error\n\n\t// Height returns the number of blocks on the ledger\n\tHeight() uint64\n}\n```\nLedgerWriter allows the caller to write blocks and inspect the height\n\n```go\ntype MemberMapping map[uint64]*Stub\n```\nMemberMapping defines NetworkMembers by their ID\n\n```go\nfunc (mp MemberMapping) ByID(ID uint64) *Stub\n```\nByID retrieves the Stub with the given ID from the MemberMapping\n\n```go\nfunc (mp MemberMapping) LookupByClientCert(cert []byte) *Stub\n```\nLookupByClientCert retrieves a Stub with the given client certificate\n\n```go\nfunc (mp MemberMapping) Put(stub *Stub)\n```\nPut inserts the given stub to the MemberMapping\n\n```go\nfunc (mp MemberMapping) ServerCertificates() StringSet\n```\nServerCertificates returns a set of the server certificates represented as strings\n\n```go\ntype MembersByChannel map[string]MemberMapping\n```\nMembersByChannel is a mapping from channel name to MemberMapping\n\n```go\ntype Metrics struct {\n\tEgressQueueLength        metrics.Gauge\n\tEgressQueueCapacity      metrics.Gauge\n\tEgressWorkerCount        metrics.Gauge\n\tIngressStreamsCount      metrics.Gauge\n\tEgressStreamsCount       metrics.Gauge\n\tEgressTLSConnectionCount metrics.Gauge\n\tMessageSendTime          metrics.Histogram\n\tMessagesDroppedCount     metrics.Counter\n}\n```\nMetrics defines the metrics for the cluster.\n\n```go\nfunc NewMetrics(provider MetricsProvider) *Metrics\n```\nNewMetrics initializes new metrics for the cluster infrastructure.\n\n```go\ntype MetricsProvider interface {\n\t// NewCounter creates a new instance of a Counter.\n\tNewCounter(opts metrics.CounterOpts) metrics.Counter\n\t// NewGauge creates a new instance of a Gauge.\n\tNewGauge(opts metrics.GaugeOpts) metrics.Gauge\n\t// NewHistogram creates a new instance of a Histogram.\n\tNewHistogram(opts metrics.HistogramOpts) metrics.Histogram\n}\n```\nA MetricsProvider is an abstraction for a metrics provider. It is a factory for Counter, Gauge, and Histogram meters.\n\n```go\ntype NoopBlockVerifier struct{}\n```\nNoopBlockVerifier doesn't verify block signatures\n\n```go\nfunc (*NoopBlockVerifier) VerifyBlockSignature(sd []*common.SignedData, config *common.ConfigEnvelope) error\n```\nVerifyBlockSignature accepts all signatures over blocks.\n\n```go\ntype OperationType int\n```\nOperationType denotes a type of operation that the RPC can perform such as sending a transaction, or a consensus related message.\n\n```go\nconst (\n\tConsensusOperation OperationType = iota\n\tSubmitOperation\n)\n```\n\n```go\ntype PredicateDialer struct {\n\tcomm.ClientConfig\n\t// contains filtered or unexported fields\n}\n```\nPredicateDialer creates gRPC connections that are only established if the given predicate is fulfilled\n\n```go\nfunc (dialer *PredicateDialer) Dial(address string, verifyFunc RemoteVerifier) (*grpc.ClientConn, error)\n```\nDial creates a new gRPC connection that can only be established, if the remote node's certificate chain satisfy verifyFunc\n\n```go\nfunc (dialer *PredicateDialer) UpdateRootCAs(serverRootCAs [][]byte)\n```\n\n```go\ntype PullerConfig struct {\n\tTLSKey              []byte\n\tTLSCert             []byte\n\tTimeout             time.Duration\n\tSigner              crypto.LocalSigner\n\tChannel             string\n\tMaxTotalBufferBytes int\n}\n```\nPullerConfig configures a BlockPuller.\n\n```go\nfunc PullerConfigFromTopLevelConfig(systemChannel string, conf *localconfig.TopLevel, tlsKey, tlsCert []byte, signer crypto.LocalSigner) PullerConfig\n```\nPullerConfigFromTopLevelConfig creates a PullerConfig from a TopLevel config, and from a signer and TLS key cert pair. The PullerConfig's channel is initialized to be the system channel.\n\n```go\ntype RPC struct {\n\tLogger  *flogging.FabricLogger\n\tTimeout time.Duration\n\tChannel string\n\tComm    Communicator\n\n\tStreamsByType map[OperationType]map[uint64]*Stream\n\t// contains filtered or unexported fields\n}\n```\nRPC performs remote procedure calls to remote cluster nodes.\n\n```go\nfunc (s *RPC) SendConsensus(destination uint64, msg *orderer.ConsensusRequest) error\n```\nConsensus passes the given ConsensusRequest message to the raft.Node instance.\n\n```go\nfunc (s *RPC) SendSubmit(destination uint64, request *orderer.SubmitRequest) error\n```\nSendSubmit sends a SubmitRequest to the given destination node.\n\n```go\ntype RemoteContext struct {\n\tMetrics      *Metrics\n\tChannel      string\n\tSendBuffSize int\n\n\tLogger *flogging.FabricLogger\n\n\tClient    orderer.ClusterClient\n\tProbeConn func(conn *grpc.ClientConn) error\n\t// contains filtered or unexported fields\n}\n```\nRemoteContext interacts with remote cluster nodes. Every call can be aborted via call to Abort()\n\n```go\nfunc (rc *RemoteContext) Abort()\n```\nAbort aborts the contexts the RemoteContext uses, thus effectively causes all operations that use this RemoteContext to terminate.\n\n```go\nfunc (rc *RemoteContext) NewStream(timeout time.Duration) (*Stream, error)\n```\nNewStream creates a new stream. It is not thread safe, and Send() or Recv() block only until the timeout expires.\n\n```go\ntype RemoteNode struct {\n\t// ID is unique among all members, and cannot be 0.\n\tID uint64\n\t// Endpoint is the endpoint of the node, denoted in %s:%d format\n\tEndpoint string\n\t// ServerTLSCert is the DER encoded TLS server certificate of the node\n\tServerTLSCert []byte\n\t// ClientTLSCert is the DER encoded TLS client certificate of the node\n\tClientTLSCert []byte\n}\n```\nRemoteNode represents a cluster member\n\n```go\nfunc (rm RemoteNode) String() string\n```\nString returns a string representation of this RemoteNode\n\n```go\ntype RemoteVerifier func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error\n```\nRemoteVerifier verifies the connection to the remote host\n\n```go\ntype Replicator struct {\n\tDoNotPanicIfClusterNotReachable bool\n\tFilter                          ChannelPredicate\n\tSystemChannel                   string\n\tChannelLister                   ChannelLister\n\tLogger                          *flogging.FabricLogger\n\tPuller                          *BlockPuller\n\tBootBlock                       *common.Block\n\tAmIPartOfChannel                SelfMembershipPredicate\n\tLedgerFactory                   LedgerFactory\n}\n```\nReplicator replicates chains\n\n```go\nfunc (r *Replicator) IsReplicationNeeded() (bool, error)\n```\nIsReplicationNeeded returns whether replication is needed, or the cluster node can resume standard boot flow.\n\n```go\nfunc (r *Replicator) PullChannel(channel string) error\n```\nPullChannel pulls the given channel from some orderer, and commits it to the ledger.\n\n```go\nfunc (r *Replicator) ReplicateChains() []string\n```\nReplicateChains pulls chains and commits them. Returns the names of the chains replicated successfully.\n\n```go\ntype SecureDialer interface {\n\tDial(address string, verifyFunc RemoteVerifier) (*grpc.ClientConn, error)\n}\n```\nSecureDialer connects to a remote address\n\n```go\ntype SelfMembershipPredicate func(configBlock *common.Block) error\n```\nSelfMembershipPredicate determines whether the caller is found in the given config block\n\n```go\ntype Service struct {\n\tStreamCountReporter              *StreamCountReporter\n\tDispatcher                       Dispatcher\n\tLogger                           *flogging.FabricLogger\n\tStepLogger                       *flogging.FabricLogger\n\tMinimumExpirationWarningInterval time.Duration\n\tCertExpWarningThreshold          time.Duration\n}\n```\nService defines the raft Service\n\n```go\nfunc (s *Service) Step(stream orderer.Cluster_StepServer) error\n```\nStep passes an implementation-specific message to another cluster member.\n\n```go\ntype StandardDialer struct {\n\tcomm.ClientConfig\n}\n```\nStandardDialer wraps an AtomicClientConfig, and provides a means to connect according to given EndpointCriteria.\n\n```go\nfunc (dialer *StandardDialer) Dial(endpointCriteria EndpointCriteria) (*grpc.ClientConn, error)\n```\nDial dials an address according to the given EndpointCriteria\n\n```go\ntype StepClient interface {\n\tSend(*orderer.StepRequest) error\n\tRecv() (*orderer.StepResponse, error)\n\tgrpc.ClientStream\n}\n```\nStepClient defines a client that sends and receives Step requests and responses.\n\n```go\ntype StepStream interface {\n\tSend(response *orderer.StepResponse) error\n\tRecv() (*orderer.StepRequest, error)\n\tgrpc.ServerStream\n}\n```\nStepStream defines the gRPC stream for sending transactions, and receiving corresponding responses\n\n```go\ntype Stream struct {\n\tID       uint64\n\tChannel  string\n\tNodeName string\n\tEndpoint string\n\tLogger   *flogging.FabricLogger\n\tTimeout  time.Duration\n\torderer.Cluster_StepClient\n\tCancel func(error)\n\t// contains filtered or unexported fields\n}\n```\nStream is used to send/receive messages to/from the remote cluster member.\n\n```go\nfunc (stream *Stream) Canceled() bool\n```\nCanceled returns whether the stream was canceled.\n\n```go\nfunc (stream *Stream) Recv() (*orderer.StepResponse, error)\n```\nRecv receives a message from a remote cluster member.\n\n```go\nfunc (stream *Stream) Send(request *orderer.StepRequest) error\n```\nSend sends the given request to the remote cluster member.\n\n```go\ntype StreamCountReporter struct {\n\tMetrics *Metrics\n\t// contains filtered or unexported fields\n}\n```\nStreamCountReporter reports the number of streams currently connected to this node\n\n```go\nfunc (scr *StreamCountReporter) Decrement()\n```\n\n```go\nfunc (scr *StreamCountReporter) Increment()\n```\n\n```go\ntype StreamOperation func() (*orderer.StepResponse, error)\n```\nStreamOperation denotes an operation done by a stream, such a Send or Receive.\n\n```go\ntype StringSet map[string]struct{}\n```\nStringSet is a set of strings\n\n```go\ntype Stub struct {\n\tRemoteNode\n\t*RemoteContext\n\t// contains filtered or unexported fields\n}\n```\nStub holds all information about the remote node, including the RemoteContext for it, and serializes some operations on it.\n\n```go\nfunc (stub *Stub) Activate(createRemoteContext func() (*RemoteContext, error)) error\n```\nActivate creates a remote context with the given function callback in an atomic manner - if two parallel invocations are invoked on this Stub, only a single invocation of createRemoteStub takes place.\n\n```go\nfunc (stub *Stub) Active() bool\n```\nActive returns whether the Stub is active or not\n\n```go\nfunc (stub *Stub) Deactivate()\n```\nDeactivate deactivates the Stub and ceases all communication operations invoked on it.\n\n```go\ntype VerificationRegistry struct {\n\tLoadVerifier       func(chain string) BlockVerifier\n\tLogger             *flogging.FabricLogger\n\tVerifierFactory    VerifierFactory\n\tVerifiersByChannel map[string]BlockVerifier\n}\n```\nVerificationRegistry registers verifiers and retrieves them.\n\n```go\nfunc (vr *VerificationRegistry) BlockCommitted(block *common.Block, channel string)\n```\nBlockCommitted notifies the VerificationRegistry upon a block commit, which may trigger a registration of a verifier out of the block in case the block is a config block.\n\n```go\nfunc (vr *VerificationRegistry) RegisterVerifier(chain string)\n```\nRegisterVerifier adds a verifier into the registry if applicable.\n\n```go\nfunc (vr *VerificationRegistry) RetrieveVerifier(channel string) BlockVerifier\n```\nRetrieveVerifier returns a BlockVerifier for the given channel, or nil if not found.\n\n```go\ntype VerifierFactory interface {\n\t// VerifierFromConfig creates a BlockVerifier from the given configuration.\n\tVerifierFromConfig(configuration *common.ConfigEnvelope, channel string) (BlockVerifier, error)\n}\n```\nVerifierFactory creates BlockVerifiers.\n\n```go\ntype VerifierRetriever interface {\n\t// RetrieveVerifier retrieves a BlockVerifier for the given channel.\n\tRetrieveVerifier(channel string) BlockVerifier\n}\n```\nVerifierRetriever retrieves BlockVerifiers for channels.\n\n","path":"github.com/eric-erki/https-hyperledger.org/orderer/common/cluster","name":"cluster","synopsis":"","isRedistributable":true}
