router

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CRC64RequestToShard added in v0.0.19

func CRC64RequestToShard(shardCount uint16) func([]byte) ([]byte, uint16)

Types

type MapperCRC64 added in v0.0.19

type MapperCRC64 struct {
	Logger     types.Logger
	ShardCount uint16
}

func (MapperCRC64) Map added in v0.0.19

func (m MapperCRC64) Map(request []byte) (shard uint16, reqID []byte)

type Net

type Net interface {
	Stop()
	Address() string
}

type Response

type Response struct {
	*protos.SubmitResponse
	// contains filtered or unexported fields
}

func (*Response) GetResponseError

func (resp *Response) GetResponseError() error

type Router

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

func NewRouter

func NewRouter(config *nodeconfig.RouterNodeConfig, logger types.Logger) *Router

func (*Router) Address

func (r *Router) Address() string

func (*Router) Broadcast

func (r *Router) Broadcast(stream orderer.AtomicBroadcast_BroadcastServer) error

func (*Router) Deliver

func (*Router) IsAllConnectionsDown added in v0.0.15

func (r *Router) IsAllConnectionsDown() bool

IsAllConnectionsDown checks that all streams across all shard-routers are disconnected from a batcher. Use for testing only.

func (*Router) IsAllStreamsOK added in v0.0.15

func (r *Router) IsAllStreamsOK() bool

IsAllStreamsOK checks that all the streams accross all shard-routers are non-faulty. Use for testing only.

func (*Router) StartRouterService

func (r *Router) StartRouterService() <-chan struct{}

func (*Router) Stop

func (r *Router) Stop()

func (*Router) Submit

func (r *Router) Submit(ctx context.Context, request *protos.Request) (*protos.SubmitResponse, error)

func (*Router) SubmitStream

func (r *Router) SubmitStream(stream protos.RequestTransmit_SubmitStreamServer) error

type ShardMapper added in v0.0.19

type ShardMapper interface {
	Map(request []byte) (shard uint16, reqID []byte)
}

type ShardRouter

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

func NewShardRouter

func NewShardRouter(l types.Logger,
	batcherEndpoint string,
	batcherRootCAs [][]byte,
	tlsCert []byte,
	tlsKey []byte,
	numOfConnectionsForBatcher int,
	numOfgRPCStreamsPerConnection int,
	verifier *requestfilter.RulesVerifier,
) *ShardRouter

func (*ShardRouter) IsAllStreamsOKinSR added in v0.0.15

func (sr *ShardRouter) IsAllStreamsOKinSR() bool

IsAllStreamsOKinSR checks that all the streams in the shard-router are not faulty. Use for testing only.

func (*ShardRouter) IsConnectionsToBatcherDown added in v0.0.15

func (sr *ShardRouter) IsConnectionsToBatcherDown() bool

IsConnectionsToBatcherDown checks that all the streams are faulty (disconnected from batcher). Use for testing only.

func (*ShardRouter) MaybeInit

func (sr *ShardRouter) MaybeInit()

func (*ShardRouter) NewForward added in v0.0.19

func (sr *ShardRouter) NewForward(trackedReq *TrackedRequest)

func (*ShardRouter) Stop added in v0.0.15

func (sr *ShardRouter) Stop()

type TrackedRequest added in v0.0.19

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

func CreateTrackedRequest added in v0.0.19

func CreateTrackedRequest(request *protos.Request, responses chan Response, reqID []byte, trace []byte) *TrackedRequest

Jump to

Keyboard shortcuts

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