mock

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const MockTxSize = 1000

this is the channel size for mock server, peer and orderer when use or send tx to mock server/peer/orderer try not over this size to avoid hang up or over size

Variables

This section is empty.

Functions

func NewBlock added in v0.2.4

func NewBlock(seqNum uint64, previousHash []byte) *common.Block

NewBlock constructs a block with no data and no metadata.

Types

type Orderer

type Orderer struct {
	Listener   net.Listener
	GrpcServer *grpc.Server

	TxCs  []chan struct{}
	SelfC chan struct{}
	// contains filtered or unexported fields
}

func NewOrderer

func NewOrderer(txCs []chan struct{}, credentials credentials.TransportCredentials) (*Orderer, error)

func (*Orderer) Addrs

func (o *Orderer) Addrs() string

func (*Orderer) Broadcast

func (*Orderer) Deliver

func (*Orderer) Start

func (o *Orderer) Start()

func (*Orderer) Stop

func (o *Orderer) Stop()

type Peer

type Peer struct {
	Listener   net.Listener
	GrpcServer *grpc.Server
	BlkSize    uint64
	TxC        chan struct{}
	// contains filtered or unexported fields
}

func NewPeer

func NewPeer(TxC chan struct{}, credentials credentials.TransportCredentials) (*Peer, error)

func (*Peer) Addrs

func (p *Peer) Addrs() string

func (*Peer) Deliver

func (p *Peer) Deliver(peer.Deliver_DeliverServer) error

func (*Peer) DeliverFiltered

func (p *Peer) DeliverFiltered(srv peer.Deliver_DeliverFilteredServer) error

func (*Peer) DeliverWithPrivateData

func (p *Peer) DeliverWithPrivateData(peer.Deliver_DeliverWithPrivateDataServer) error

func (*Peer) Pause

func (p *Peer) Pause()

func (*Peer) ProcessProposal

func (p *Peer) ProcessProposal(context.Context, *peer.SignedProposal) (*peer.ProposalResponse, error)

func (*Peer) Start

func (p *Peer) Start()

func (*Peer) Stop

func (p *Peer) Stop()

func (*Peer) Unpause

func (p *Peer) Unpause()

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(peerN int, credentials credentials.TransportCredentials) (*Server, error)

func (*Server) Addresses

func (s *Server) Addresses() ([]string, string)

func (*Server) OrderAddr

func (s *Server) OrderAddr() string

func (*Server) PeersAddresses

func (s *Server) PeersAddresses() (peersAddrs []string)

func (*Server) Start

func (s *Server) Start()

func (*Server) Stop

func (s *Server) Stop()

Jump to

Keyboard shortcuts

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