ordering

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BroadcastReceive

func BroadcastReceive(broadcast Broadcast, addr string, responses chan common.Status, errs chan error)

BroadcastReceive waits until it receives the response from broadcast stream

func BroadcastSend

func BroadcastSend(broadcast Broadcast, envelope *common.Envelope) error

BroadcastSend sends transaction envelope to orderer service

func BroadcastWaitForResponse

func BroadcastWaitForResponse(responses chan common.Status, errs chan error) (common.Status, error)

broadcastWaitForResponse reads from response and errs chans until responses chan is closed

func NewOrdererClient

func NewOrdererClient(config *grpc2.ConnectionConfig) (*ordererClient, error)

func NewService

func NewService(sp view2.ServiceProvider, network Network) *service

Types

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 Configuration

type Configuration interface {
}

type Network

type Network interface {
	PickOrderer() *grpc.ConnectionConfig
	LocalMembership() driver.LocalMembership
	// Broadcast sends the passed blob to the ordering service to be ordered
	Broadcast(blob interface{}) error
	Channel(name string) (driver.Channel, error)
	SignerService() driver.SignerService
	Config() *config.Config
}

type OrdererClient

type OrdererClient interface {
	// NewBroadcast returns a Broadcast
	NewBroadcast(ctx context.Context, opts ...grpc.CallOption) (Broadcast, error)

	// Certificate returns tls certificate for the orderer client
	Certificate() *tls.Certificate

	Close()
}

OrdererClient defines the interface to create a Broadcast

type Signer

type Signer interface {
	// Sign the message
	Sign(msg []byte) ([]byte, error)
}

type Transaction

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

type ViewManager

type ViewManager interface {
	InitiateView(view view.View) (interface{}, error)
}

Jump to

Keyboard shortcuts

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