preferorg

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewResolver

func NewResolver() peerresolver.Provider

NewResolver returns a new "prefer org" resolver provider.

Types

type PeerResolver

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

PeerResolver is a peer resolver that determines which peers are suitable based on block height, although will prefer the peers in the current org (as long as their block height is above a configured threshold). If none of the peers from the current org are suitable then a peer from another org is chosen.

func New

func New(dispatcher service.Dispatcher, context context.Client, channelID string, opts ...options.Opt) *PeerResolver

New returns a new "prefer org" resolver.

func (*PeerResolver) Resolve

func (r *PeerResolver) Resolve(peers []fab.Peer) (fab.Peer, error)

Resolve uses the MinBlockHeight resolver to choose peers but will prefer peers in the given org.

func (PeerResolver) SetLoadBalancePolicy

func (p PeerResolver) SetLoadBalancePolicy(value lbp.LoadBalancePolicy)

func (*PeerResolver) ShouldDisconnect

func (r *PeerResolver) ShouldDisconnect(peers []fab.Peer, connectedPeer fab.Peer) bool

ShouldDisconnect determines whether connected peer not in our org should be disconnected and reconnected to a peer in our org.

Jump to

Keyboard shortcuts

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