 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- func CreateBAF(signer Signer, id types.PartyID, shard types.ShardID, digest []byte, ...) (types.BatchAttestationFragment, error)
- func CreateComplaint(signer Signer, id types.PartyID, shard types.ShardID, term uint64, ...) (*state.Complaint, error)
- func GetBatchersEndpointsAndCerts(batchers []config.BatcherInfo) map[types.PartyID]*EndpointAndCerts
- func GetBatchersIDs(batchers []config.BatcherInfo) []types.PartyID
- type Acker
- type BAFCreator
- type BAFSender
- type BatchAcker
- type BatchLedgeReader
- type BatchLedger
- type BatchLedgerWriter
- type BatchPuller
- type BatchedRequestsVerifier
- type Batcher
- func (b *Batcher) Ack(seq types.BatchSequence, to types.PartyID)
- func (b *Batcher) Broadcast(_ orderer.AtomicBroadcast_BroadcastServer) error
- func (b *Batcher) Complain(reason string)
- func (b *Batcher) CreateBAF(seq types.BatchSequence, primary types.PartyID, shard types.ShardID, ...) types.BatchAttestationFragment
- func (b *Batcher) Deliver(stream orderer.AtomicBroadcast_DeliverServer) error
- func (b *Batcher) FwdRequestStream(stream protos.BatcherControlService_FwdRequestStreamServer) error
- func (b *Batcher) GetLatestStateChan() <-chan *state.State
- func (b *Batcher) GetPrimaryID() types.PartyID
- func (b *Batcher) NotifyAck(stream protos.BatcherControlService_NotifyAckServer) error
- func (b *Batcher) OnFirstStrikeTimeout(req []byte)
- func (b *Batcher) OnSecondStrikeTimeout()
- func (b *Batcher) Run()
- func (b *Batcher) SendBAF(baf types.BatchAttestationFragment)
- func (b *Batcher) Stop()
- func (b *Batcher) Submit(ctx context.Context, req *protos.Request) (*protos.SubmitResponse, error)
- func (b *Batcher) SubmitStream(stream protos.RequestTransmit_SubmitStreamServer) error
 
- type BatcherDeliverService
- type BatcherRole
- type BatchesPuller
- type ClientRequestSigVerifier
- type Complainer
- type ConsensusStateReplicatorCreator
- type ConsensusStateReplicatorFactory
- type ConsenterControlEventSender
- type ConsenterControlEventSenderCreator
- type ConsenterControlEventSenderFactory
- type ConsenterControlEventStream
- type ControlEventBroadcaster
- type EndpointAndCerts
- type MemPool
- type Net
- type NoopClientRequestSigVerifier
- type PrimaryAckConnector
- type PrimaryReqConnector
- type RequestInspector
- type RequestVerifier
- type RequestsInspectorVerifier
- type SeqAcker
- type Signer
- type StateProvider
- type StateReplicator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateComplaint ¶
func GetBatchersEndpointsAndCerts ¶
func GetBatchersEndpointsAndCerts(batchers []config.BatcherInfo) map[types.PartyID]*EndpointAndCerts
func GetBatchersIDs ¶
func GetBatchersIDs(batchers []config.BatcherInfo) []types.PartyID
Types ¶
type Acker ¶ added in v0.0.19
type Acker struct {
	// contains filtered or unexported fields
}
    Acker handles the acks coming from secondaries
func NewAcker ¶ added in v0.0.19
func NewAcker(confirmedSeq types.BatchSequence, gap types.BatchSequence, numOfParties uint16, threshold uint16, logger types.Logger) *Acker
NewAcker returns a new acker
func (*Acker) HandleAck ¶ added in v0.0.19
func (a *Acker) HandleAck(seq types.BatchSequence, from types.PartyID)
HandleAck handles an ack with a given seq from a specific party
func (*Acker) WaitForSecondaries ¶ added in v0.0.19
func (a *Acker) WaitForSecondaries(seq types.BatchSequence) chan struct{}
WaitForSecondaries waits for the secondaries to keep up with the primary (to send enough acks)
type BAFCreator ¶ added in v0.0.19
type BAFCreator interface {
	CreateBAF(seq types.BatchSequence, primary types.PartyID, shard types.ShardID, digest []byte) types.BatchAttestationFragment
}
    BAFCreator creates a baf
type BAFSender ¶ added in v0.0.19
type BAFSender interface {
	SendBAF(baf types.BatchAttestationFragment)
}
    BAFSender sends the baf to the consenters
type BatchAcker ¶ added in v0.0.19
type BatchAcker interface {
	Ack(seq types.BatchSequence, to types.PartyID)
}
    BatchAcker sends an ack over a specific batch
type BatchLedgeReader ¶ added in v0.0.19
type BatchLedger ¶ added in v0.0.19
type BatchLedger interface {
	BatchLedgerWriter
	BatchLedgeReader
}
    type BatchLedgerWriter ¶ added in v0.0.19
type BatchLedgerWriter interface {
	Append(partyID types.PartyID, batchSeq types.BatchSequence, batchedRequests types.BatchedRequests)
}
    type BatchPuller ¶
type BatchPuller struct {
	// contains filtered or unexported fields
}
    func NewBatchPuller ¶
func NewBatchPuller(config *config.BatcherNodeConfig, ledger BatchLedger, logger types.Logger) *BatchPuller
func (*BatchPuller) PullBatches ¶
func (bp *BatchPuller) PullBatches(from types.PartyID) <-chan types.Batch
func (*BatchPuller) Stop ¶
func (bp *BatchPuller) Stop()
type BatchedRequestsVerifier ¶ added in v0.0.19
type BatchedRequestsVerifier interface {
	VerifyBatchedRequests(types.BatchedRequests) error
}
    BatchedRequestsVerifier verifies batched requests
type Batcher ¶
type Batcher struct {
	Net    Net
	Ledger *node_ledger.BatchLedgerArray
	// contains filtered or unexported fields
}
    func CreateBatcher ¶
func CreateBatcher(conf *node_config.BatcherNodeConfig, logger types.Logger, net Net, csrc ConsensusStateReplicatorCreator, senderCreator ConsenterControlEventSenderCreator, signer Signer) *Batcher
func NewBatcher ¶
func NewBatcher(logger types.Logger, config *node_config.BatcherNodeConfig, ledger *node_ledger.BatchLedgerArray, bp BatchesPuller, ds *BatcherDeliverService, sr StateReplicator, senderCreator ConsenterControlEventSenderCreator, net Net, signer Signer) *Batcher
func (*Batcher) Broadcast ¶
func (b *Batcher) Broadcast(_ orderer.AtomicBroadcast_BroadcastServer) error
func (*Batcher) CreateBAF ¶
func (b *Batcher) CreateBAF(seq types.BatchSequence, primary types.PartyID, shard types.ShardID, digest []byte) types.BatchAttestationFragment
func (*Batcher) Deliver ¶
func (b *Batcher) Deliver(stream orderer.AtomicBroadcast_DeliverServer) error
func (*Batcher) FwdRequestStream ¶
func (b *Batcher) FwdRequestStream(stream protos.BatcherControlService_FwdRequestStreamServer) error
func (*Batcher) GetLatestStateChan ¶
func (*Batcher) GetPrimaryID ¶
func (*Batcher) NotifyAck ¶
func (b *Batcher) NotifyAck(stream protos.BatcherControlService_NotifyAckServer) error
func (*Batcher) OnFirstStrikeTimeout ¶
func (*Batcher) OnSecondStrikeTimeout ¶
func (b *Batcher) OnSecondStrikeTimeout()
func (*Batcher) SendBAF ¶
func (b *Batcher) SendBAF(baf types.BatchAttestationFragment)
func (*Batcher) SubmitStream ¶
func (b *Batcher) SubmitStream(stream protos.RequestTransmit_SubmitStreamServer) error
type BatcherDeliverService ¶
type BatcherDeliverService struct {
	LedgerArray *ledger.BatchLedgerArray
	Logger      types.Logger
}
    func (*BatcherDeliverService) Broadcast ¶
func (d *BatcherDeliverService) Broadcast(_ orderer.AtomicBroadcast_BroadcastServer) error
func (*BatcherDeliverService) Deliver ¶
func (d *BatcherDeliverService) Deliver(stream orderer.AtomicBroadcast_DeliverServer) error
type BatcherRole ¶ added in v0.0.19
type BatcherRole struct {
	Batchers                []types.PartyID
	BatchTimeout            time.Duration
	RequestInspector        RequestInspector
	ID                      types.PartyID
	Shard                   types.ShardID
	Threshold               int
	N                       uint16
	Logger                  types.Logger
	Ledger                  BatchLedger
	BatchPuller             BatchesPuller
	StateProvider           StateProvider
	BAFCreator              BAFCreator
	BAFSender               BAFSender
	BatchAcker              BatchAcker
	Complainer              Complainer
	BatchedRequestsVerifier BatchedRequestsVerifier
	MemPool                 MemPool
	BatchSequenceGap        types.BatchSequence
	// contains filtered or unexported fields
}
    func (*BatcherRole) HandleAck ¶ added in v0.0.19
func (b *BatcherRole) HandleAck(seq types.BatchSequence, from types.PartyID)
func (*BatcherRole) Start ¶ added in v0.0.19
func (b *BatcherRole) Start()
func (*BatcherRole) Stop ¶ added in v0.0.19
func (b *BatcherRole) Stop()
func (*BatcherRole) Submit ¶ added in v0.0.19
func (b *BatcherRole) Submit(request []byte) error
type BatchesPuller ¶ added in v0.0.19
type ClientRequestSigVerifier ¶
ClientRequestSigVerifier verifies a single client's requests (signatures)
type Complainer ¶ added in v0.0.19
type Complainer interface {
	Complain(string)
}
    type ConsensusStateReplicatorCreator ¶
type ConsensusStateReplicatorCreator interface {
	CreateStateConsensusReplicator(conf *node_config.BatcherNodeConfig, logger types.Logger) StateReplicator
}
    type ConsensusStateReplicatorFactory ¶
type ConsensusStateReplicatorFactory struct{}
    func (*ConsensusStateReplicatorFactory) CreateStateConsensusReplicator ¶
func (c *ConsensusStateReplicatorFactory) CreateStateConsensusReplicator(config *node_config.BatcherNodeConfig, logger types.Logger) StateReplicator
type ConsenterControlEventSender ¶
type ConsenterControlEventSender interface {
	SendControlEvent(ce state.ControlEvent) error
}
    type ConsenterControlEventSenderCreator ¶
type ConsenterControlEventSenderCreator interface {
	CreateConsenterControlEventSender(TLSPrivateKeyFile config.RawBytes, TLSCertificateFile config.RawBytes, consenterInfo config.ConsenterInfo) ConsenterControlEventSender
}
    type ConsenterControlEventSenderFactory ¶
type ConsenterControlEventSenderFactory struct{}
    func (*ConsenterControlEventSenderFactory) CreateConsenterControlEventSender ¶
func (f *ConsenterControlEventSenderFactory) CreateConsenterControlEventSender(TLSPrivateKey config.RawBytes, TLSCertificate config.RawBytes, consenterInfo config.ConsenterInfo) ConsenterControlEventSender
type ConsenterControlEventStream ¶
type ConsenterControlEventStream struct {
	ConsenterInfo  config.ConsenterInfo
	TLSPrivateKey  config.RawBytes
	TLSCertificate config.RawBytes
	// contains filtered or unexported fields
}
    func CreateConsenterControlEventStream ¶
func CreateConsenterControlEventStream(TLSPrivateKey config.RawBytes, TLSCertificate config.RawBytes, consenterInfo config.ConsenterInfo) *ConsenterControlEventStream
func (*ConsenterControlEventStream) SendControlEvent ¶
func (s *ConsenterControlEventStream) SendControlEvent(ce state.ControlEvent) error
type ControlEventBroadcaster ¶
type ControlEventBroadcaster struct {
	// contains filtered or unexported fields
}
    func NewControlEventBroadcaster ¶
func NewControlEventBroadcaster(senders []ConsenterControlEventSender, n int, f int, minRetryInterval time.Duration, maxRetryDelay time.Duration, logger types.Logger, ctx context.Context, cancelFunc context.CancelFunc) *ControlEventBroadcaster
func (*ControlEventBroadcaster) BroadcastControlEvent ¶
func (b *ControlEventBroadcaster) BroadcastControlEvent(ce state.ControlEvent) error
func (*ControlEventBroadcaster) Stop ¶
func (b *ControlEventBroadcaster) Stop()
type EndpointAndCerts ¶
type NoopClientRequestSigVerifier ¶
type NoopClientRequestSigVerifier struct{}
    func (*NoopClientRequestSigVerifier) VerifyClientRequestSig ¶
func (v *NoopClientRequestSigVerifier) VerifyClientRequestSig(req []byte) error
type PrimaryAckConnector ¶
type PrimaryAckConnector struct {
	// contains filtered or unexported fields
}
    func CreatePrimaryAckConnector ¶
func CreatePrimaryAckConnector(primaryID types.PartyID, shardID types.ShardID, logger types.Logger, config *node_config.BatcherNodeConfig, batchers map[types.PartyID]*EndpointAndCerts, ctx context.Context, timeout, minRetryInterval, maxRetryDelay time.Duration) *PrimaryAckConnector
func (*PrimaryAckConnector) ConnectToNewPrimary ¶
func (p *PrimaryAckConnector) ConnectToNewPrimary(primaryID types.PartyID)
func (*PrimaryAckConnector) ConnectToPrimary ¶
func (p *PrimaryAckConnector) ConnectToPrimary()
func (*PrimaryAckConnector) ResetConnection ¶
func (p *PrimaryAckConnector) ResetConnection()
func (*PrimaryAckConnector) SendAck ¶
func (p *PrimaryAckConnector) SendAck(seq types.BatchSequence)
func (*PrimaryAckConnector) Stop ¶
func (p *PrimaryAckConnector) Stop()
type PrimaryReqConnector ¶
type PrimaryReqConnector struct {
	// contains filtered or unexported fields
}
    func CreatePrimaryReqConnector ¶
func CreatePrimaryReqConnector(primaryID types.PartyID, logger types.Logger, config *node_config.BatcherNodeConfig, batchers map[types.PartyID]*EndpointAndCerts, ctx context.Context, timeout, minRetryInterval, maxRetryDelay time.Duration) *PrimaryReqConnector
func (*PrimaryReqConnector) ConnectToNewPrimary ¶
func (p *PrimaryReqConnector) ConnectToNewPrimary(primaryID types.PartyID)
func (*PrimaryReqConnector) ConnectToPrimary ¶
func (p *PrimaryReqConnector) ConnectToPrimary()
func (*PrimaryReqConnector) ResetConnection ¶
func (p *PrimaryReqConnector) ResetConnection()
func (*PrimaryReqConnector) SendReq ¶
func (p *PrimaryReqConnector) SendReq(req []byte)
func (*PrimaryReqConnector) Stop ¶
func (p *PrimaryReqConnector) Stop()
type RequestInspector ¶ added in v0.0.19
type RequestVerifier ¶
RequestVerifier verifies a single request (format and signatures)
type RequestsInspectorVerifier ¶
type RequestsInspectorVerifier struct {
	// contains filtered or unexported fields
}
    func NewRequestsInspectorVerifier ¶
func NewRequestsInspectorVerifier(logger types.Logger, config *config.BatcherNodeConfig, clientRequestVerifier ClientRequestSigVerifier, requestVerifier RequestVerifier) *RequestsInspectorVerifier
func (*RequestsInspectorVerifier) RequestID ¶
func (r *RequestsInspectorVerifier) RequestID(req []byte) string
func (*RequestsInspectorVerifier) VerifyBatchedRequests ¶
func (r *RequestsInspectorVerifier) VerifyBatchedRequests(reqs types.BatchedRequests) error
func (*RequestsInspectorVerifier) VerifyRequest ¶
func (r *RequestsInspectorVerifier) VerifyRequest(req []byte) error
type SeqAcker ¶ added in v0.0.19
type SeqAcker interface {
	Stop()
	HandleAck(seq types.BatchSequence, from types.PartyID)
	WaitForSecondaries(seq types.BatchSequence) chan struct{}
}
    type StateProvider ¶ added in v0.0.19
type StateReplicator ¶
       Source Files
      ¶
      Source Files
      ¶
    
   Click to show internal directories. 
   Click to hide internal directories.