Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewResolver ¶
func NewResolver(preferredPeers ...string) peerresolver.Provider
NewResolver returns a new "prefer peer" 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 provided list (as long as their block height is above a configured threshold). If none of the peers in the provided list are suitable then an attempt is made to select a peer from the current org will be selected. 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, preferredPeers []string, opts ...options.Opt) *PeerResolver
New returns a new "prefer peer" resolver.
func (*PeerResolver) Resolve ¶
Resolve uses the MinBlockHeight resolver to choose peers but will prefer the ones in the list of preferred peers.
func (PeerResolver) SetLoadBalancePolicy ¶
func (p PeerResolver) SetLoadBalancePolicy(value lbp.LoadBalancePolicy)
func (*PeerResolver) ShouldDisconnect ¶
ShouldDisconnect determines whether the connected peer should be disconnected and reconnected to the preferred peer.