This section is empty.


This section is empty.


func NewResolver

func NewResolver(preferredPeers ...string) peerresolver.Provider

    NewResolver returns a new "prefer peer" resolver provider.


    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

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

          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

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

            ShouldDisconnect determines whether the connected peer should be disconnected and reconnected to the preferred peer.