ordering

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BFTBroadcaster added in v0.3.0

type BFTBroadcaster struct {
	ConfigService driver.ConfigService
	ClientFactory Services
	// contains filtered or unexported fields
}

func NewBFTBroadcaster added in v0.3.0

func NewBFTBroadcaster(configService driver.ConfigService, cf Services, metrics *metrics.Metrics) *BFTBroadcaster

func (*BFTBroadcaster) Broadcast added in v0.3.0

func (o *BFTBroadcaster) Broadcast(context context.Context, env *common2.Envelope) error

type Broadcast

type Broadcast interface {
	Send(m *common.Envelope) error
	Recv() (*ab.BroadcastResponse, error)
	CloseSend() error
}

Broadcast defines the interface that abstracts grpc calls to broadcast transactions to orderer

type BroadcastFnc added in v0.3.0

type BroadcastFnc = func(context context.Context, env *common2.Envelope) error

type CFTBroadcaster added in v0.3.0

type CFTBroadcaster struct {
	NetworkID     string
	ConfigService driver.ConfigService
	ClientFactory Services
	// contains filtered or unexported fields
}

func NewCFTBroadcaster added in v0.3.0

func NewCFTBroadcaster(configService driver.ConfigService, clientFactory Services, metrics *metrics.Metrics) *CFTBroadcaster

func (*CFTBroadcaster) Broadcast added in v0.3.0

func (o *CFTBroadcaster) Broadcast(context context.Context, env *common2.Envelope) error

type Client added in v0.3.0

type Client = services.OrdererClient

type Connection added in v0.3.0

type Connection struct {
	Stream Broadcast
	Client Client
	// contains filtered or unexported fields
}

func (*Connection) Recv added in v0.3.0

func (c *Connection) Recv() (*ab.BroadcastResponse, error)

func (*Connection) Send added in v0.3.0

func (c *Connection) Send(m *common.Envelope) error

type ConsensusType added in v0.4.0

type ConsensusType = string
const (
	BFT  ConsensusType = "BFT"
	Raft ConsensusType = "etcdraft"
	Solo ConsensusType = "solo"
)

type GetEndorserTransactionServiceFunc added in v0.4.0

type GetEndorserTransactionServiceFunc = func(channelID string) (driver.EndorserTransactionService, error)

type Service added in v0.3.0

type Service struct {
	GetEndorserTransactionService GetEndorserTransactionServiceFunc
	SigService                    driver.SignerService
	ConfigService                 driver.ConfigService
	Metrics                       *metrics.Metrics

	Broadcasters   map[ConsensusType]BroadcastFnc
	BroadcastMutex sync.RWMutex
	Broadcaster    BroadcastFnc
}

func NewService

func NewService(
	getEndorserTransactionService GetEndorserTransactionServiceFunc,
	sigService driver.SignerService,
	configService driver.ConfigService,
	metrics *metrics.Metrics,
	services Services,
) *Service

func (*Service) Broadcast added in v0.3.0

func (o *Service) Broadcast(ctx context2.Context, blob interface{}) error

func (*Service) Configure added in v0.4.0

func (f *Service) Configure(consensusType string, orderers []*grpc.ConnectionConfig) error

func (*Service) SetConsensusType added in v0.3.0

func (o *Service) SetConsensusType(consensusType ConsensusType) error

type Services added in v0.4.0

type Services interface {
	NewOrdererClient(cc grpc.ConnectionConfig) (Client, error)
}

type Transaction

type Transaction interface {
	Channel() string
	ID() string
	Creator() view.Identity
	Proposal() driver.Proposal
	ProposalResponses() ([]driver.ProposalResponse, error)
	Bytes() ([]byte, error)
	Envelope() (driver.Envelope, error)
}

type TransactionWithEnvelope added in v0.4.0

type TransactionWithEnvelope interface {
	Envelope() *common2.Envelope
}

Jump to

Keyboard shortcuts

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