Fabric service discovery and anchor peers

Service discovery lets client applications find online endorsing peers, and anchor peers and gossip settings are what it depends on. This page explains how to configure them so endorsement keeps working during peer maintenance.

On this page

Why Fabric service discovery and anchor peers matter for day-two operations

Consider a consortium operator whose client applications stop getting endorsements the moment one peer is taken down for patching. The applications were hard-coded to that peer's address, so they keep asking an unavailable node and transactions fail even though other member organizations have healthy peers. Service discovery is the Fabric feature that prevents this. It runs on peers and uses gossip metadata to determine which peers are online, so the peer gateway can direct endorsement requests to good candidates instead of a fixed list.

Discovery depends on two things being configured correctly. The first is gossip: peers find each other through peer.gossip.bootstrap, advertise their own address through peer.gossip.endpoint, and, when they sit behind NAT, a proxy or a load balancer, publish a reachable address through peer.gossip.externalEndpoint. The second is anchor peers, which are defined per channel and per organization. They give peers from different organizations a known entry point into each other's gossip network. If anchor peers are missing or point at addresses that other organizations cannot reach, discovery sees an incomplete picture and endorsement can fail for reasons that look unrelated to the chaincode. Confirm these values in each peer's configuration and in the channel configuration, and check them again after any change to hostnames, ingress or certificates.

Teams need this most in three situations: multi-organization channels, where endorsement policies span several members; rolling maintenance, where peers are restarted one at a time; and client applications that should not carry peer addresses in their code. As long as at least one peer from each organization is available and clients use service discovery, the endorsement policy can be satisfied. That condition is the planning target for a maintenance window, so test it before the window opens by stopping one peer per organization in a non-production network and confirming that clients still endorse. Your own team or a partner should also confirm how the gateway behaves when every peer of one organization is down, because that case is outside the guarantee.

Gossip and anchor peer settings and when each fits

This table compares the three gossip settings and the per-channel anchor peer declarations that service discovery depends on. Read each row as one setting: what it does, when its value must differ from the internal address, and what breaks if it is wrong. The main takeaway is that bootstrap points a peer into the gossip network, while endpoint and externalEndpoint tell other peers how to reach it.

SettingRole in discoveryWhen it must differ from the internal addressWhat breaks if it is wrong
peer.gossip.bootstrapLists peers this peer contacts at startup to join the gossip network and learn about other online peersSet to addresses that are reachable from this peer's network, such as a load balancer or a Kubernetes service name, when direct pod addresses are not routableThe peer may start isolated, see few or no other peers, and service discovery returns too few candidates for endorsement
peer.gossip.endpointThe address this peer listens on and advertises for gossip within its own networkUsually matches the internal listening address, so it is the one the peer's own network can reachPeers in the same network may fail to connect to each other, and gossip membership stays incomplete
peer.gossip.externalEndpointThe address other organizations' peers use to reach this peer across network boundariesMust differ when a load balancer, NAT, ingress or cross-cluster gateway fronts the peer, so it carries the externally reachable addressPeers in other organizations see an unreachable address, so this peer is not used for discovery or private data pulls from them
Anchor peers (per channel)Declared in each organization's channel configuration so peers from different organizations can find each other across the channelMust point to a peer whose externalEndpoint is reachable from other organizations, not only from the local networkCross-organization gossip may never start for that channel, leaving discovery limited to peers that are already connected
Anchor peer count per organizationGives discovery more than one entry point into each organization on the channelSet so that the anchor peer of each organization stays reachable during maintenance of a single peerIf the only anchor peer is down during a restart, new cross-organization connections may fail until it returns
Endorsement availability requirementDiscovery can only pick endorsers it knows about, and the policy can be satisfied when at least one peer per organization is available with discovery in useConfirm this with each member organization so that every organization runs enough peers to cover its endorsement needsIf an organization has no reachable peer, endorsement policies needing that organization cannot be satisfied
Private data dependencyPrivate data distribution and retrieval also rely on gossip, so the same endpoint settings affect itCheck externalEndpoint and anchor peers before enabling collections that span organizationsTransactions may commit with missing private data on peers that cannot reach the others

Configuring gossip and anchor peers for discovery

This sequence sets up the gossip settings, endpoints and channel anchor peers that Fabric service discovery relies on, and ends with a check that client discovery queries return online peers for every organization. Each step closes with a check so problems surface before client applications depend on the network.

  1. Plan peer endpoints per organization

    The network operator and each member organization agree on a host, port and internal address for every peer, and record which peers will be anchor peers. Write the plan as a table with one row per peer, covering the peer's organization, its internal endpoint, its external endpoint and its bootstrap target. Confirm the layout against the gossip and anchor peer guidance in the Fabric production peer planning documentation before editing any configuration. This step is done when every organization has at least one peer on the plan and no two peers share an endpoint.

  2. Set gossip bootstrap and endpoint keys

    Each peer administrator sets peer.gossip.bootstrap to one or more reachable peers, and sets peer.gossip.endpoint to the address the peer listens on inside its own network. Make sure the bootstrap list includes peers from other organizations so the peer can join the gossip network. Restart the peer after the change and review the peer log for gossip connection messages. The step is complete when each peer logs connections to its bootstrap peers and no endpoint errors appear.

  3. Define external endpoints for cross-network reachability

    Where peers sit behind NAT, load balancers or separate cloud networks, set peer.gossip.externalEndpoint to the address other organizations can reach. This value is what other peers learn and advertise, so a wrong address causes discovery to return peers that clients cannot connect to. Test reachability from a host in each other organization's network on the advertised port, and confirm the gossip TLS settings match on both sides. Done when every peer's external endpoint answers from outside its own network.

  4. Set anchor peers through a channel configuration update

    Anchor peers are recorded in each organization's section of the channel configuration, so the channel administrators of each organization submit a configuration update that lists their anchor peers for that channel. Prepare the update from the current channel configuration, get the required organization signatures under the channel's policies, and submit it to the orderer. Confirm the update was committed by fetching the latest config block and checking the anchor peer entries for every organization. This step is done when each organization on the channel lists at least one anchor peer.

  5. Confirm gossip membership across organizations

    After the anchor peers are committed, peer operators check that peers from each organization appear in the gossip membership of the others. Review peer logs for membership messages referencing peers from every organization on the channel, and confirm that anchor peers have connected across organizations. If a peer from one organization is missing from the view of another, recheck the bootstrap list, external endpoint and TLS settings for that peer before moving on. The step is done when every organization's peers are visible to peers in the other organizations.

  6. Verify discovery returns online peers per organization

    A client identity queries the service discovery endpoint for the channel and chaincode it intends to use, and the response should list online peers for each organization that the endorsement policy requires. Run the query from a client in a network the peers do not share, and compare the returned endpoints with the peer plan from the first step. Fabric's planning guidance notes that any endorsement policy can be satisfied as long as at least one peer from each organization is available and discovery is used, so confirm that condition is met for each required organization. Record the query output as evidence of this check.

  7. Retest discovery during peer maintenance

    Before a planned maintenance window, take one peer per organization offline in a test environment and repeat the discovery query. The expected result is that discovery returns the remaining online peers, and that endorsement continues for each organization where at least one peer remains. Confirm this behavior against the service discovery and endorsement guidance in the Fabric planning documentation, and document any organization where no peer remains available. The step is complete when the retest results are recorded and the maintenance runbook names a peer for each organization that stays online.

How discovery keeps endorsement working during peer maintenance

When a peer goes offline for patching or a restart, discovery stops offering it as an endorsement target. The discovery service runs on peers and uses gossip metadata to determine which peers are online, so the peer gateway can direct proposals to candidates that are currently reachable. While one peer is down, its gossip advertisement disappears from the network, and client applications using service discovery select other peers from the same organization that satisfy the endorsement policy. The application does not need a code change or a manual failover step for this to happen, but the client must be using service discovery rather than a hard-coded list of endorsing peers.

The protection depends on a precondition the reader must verify: as long as at least one peer from each organization is available and service discovery is used, any endorsement policy can be satisfied. This means maintenance should be scheduled one peer at a time within each organization, never by taking down every peer of an organization at once. Confirm your endorsement policy and the organizations it names before you start a maintenance window, because a policy that needs endorsements from an organization whose only peer is offline will fail regardless of how well discovery works. Ask your partner or internal team to write this check into the runbook, including which peer is taken down first and how its return is confirmed in gossip before the next peer is restarted.

Discovery does not protect against every failure. An organization with a single peer has no alternative candidate, so patching that peer stops its endorsements entirely. Gossip settings also matter: peer.gossip.externalEndpoint is the address other peers and clients learn, and a wrong value can leave a healthy peer invisible to discovery even though it is running. Anchor peers on each channel are another dependency, since gossip needs them to connect organizations. Test the behavior in your own environment before relying on it: stop one peer per organization in a non-production network, submit transactions through a client that uses service discovery, and check that endorsements succeed and that the stopped peer disappears from discovery results and reappears after restart.

Security and operational risks in peer discovery

Service discovery and anchor peers decide which endorsing peers clients can reach and which endpoints other organizations learn about. The risks below sit in the gossip layer, the channel configuration and the day-two operations that keep peers available, so each one needs an owner and a check before it reaches production.

Exposed peer and gossip endpoints

Gossip uses its own peer-to-peer ports, and the peer endpoint is also where clients and other organizations connect. Any port reachable beyond the intended network can expose peer metadata or invite connection attempts. Review which addresses are bound to the peer, which firewall rules and load balancer paths reach them, and whether gossip traffic stays inside the consortium network. Confirm this with your network team against the actual peer configuration rather than the defaults.

Peer planning docs

Mutual TLS for gossip and clients

Peers and clients authenticate with certificates issued under each organization's MSP, and gossip connections depend on the same trust material. An expired or revoked TLS certificate can silently remove a peer from discovery results or block a client's connection. Track certificate expiry for every peer and client TLS identity, confirm the TLS CA chain that each organization trusts, and rehearse certificate renewal before the first expiry date arrives.

Anchor peer changes need policy approval

Anchor peers are recorded in the channel configuration, so changing them is a configuration update that must satisfy the channel's modification policy. Each organization that must sign the update should be identified in advance, along with the peer endpoints it will advertise. Plan the change as a standard channel administration task, record who approved it, and confirm that gossip reconnects to the new anchors before retiring the old ones.

Peer planning docs

Unintended endpoints through externalEndpoint

The peer.gossip.externalEndpoint setting is the address other peers are told to use when they reach this peer, so a wrong value advertises an address that may be private, stale or owned by another party. Behind a NAT, load balancer or Kubernetes service, the internal and external addresses can differ. Review this value per peer, confirm it resolves from other organizations' networks, and check it again whenever a peer is moved or re-addressed.

Monitoring health through the operations service

The operations service exposes a /healthz health check, a /version endpoint and a Prometheus /metrics endpoint on each peer and orderer, secured with mutual TLS client certificates. A peer that is up but not gossiping can still look healthy to a basic probe, so alerts should cover endorsement-relevant signals as well. Decide which monitoring identity may query these endpoints, keep its certificate under the same expiry tracking as other TLS identities, and alert on version drift across peers.

Operations service docs

Change control during rolling upgrades

The upgrade guide moves orderer binaries first, then peer binaries, each in a rolling fashion, and only then updates channel capability levels. During this window peers run mixed versions, and each peer leaving the network reduces the endorsers that discovery can offer. Set a rule that only one peer per organization is taken down at a time, confirm endorsement succeeds after each step, and hold capability changes until every peer is upgraded.

Upgrade guide

Questions teams ask before configuring discovery

Can an in-house team configure Fabric service discovery and anchor peers on its own?

Yes, many teams that already run Fabric peers can, provided they have someone who understands channel configuration and gossip. The work is mostly configuration rather than new software, but it touches channel configuration, which every member organization must approve, and mistakes show up as failed endorsements rather than clear errors. Teams with one or two people who have done a channel update before usually handle the first pass in house. Teams that have never edited a channel config block, or that run several organizations, often find a short external review useful to check endpoints and the update sequence before anything goes to production.

What drives the effort of configuring discovery?

Effort rises mainly with the number of organizations on the channel, the number of peers each organization runs, and how many of those peers need an anchor peer entry. Each organization that updates its anchor peers needs its own approval step, so the calendar cost often comes from change approval rather than from the configuration itself. Kubernetes networking adds work when peers are reached through services, ingress or node ports, because the external endpoint each peer advertises must be reachable from other organizations. Multiple channels multiply the anchor peer updates. Ask any partner to break the quote down by channel, organization and peer count.

What does the team need to provide before the work starts?

The team should provide a current network diagram showing organizations, peers, orderers and channels, plus an endpoint inventory listing each peer's internal endpoint, external endpoint and bootstrap peers. Channel administrator access is needed for every organization whose anchor peers change, along with the change approval process the channel uses. Test clients, such as an application or a CLI environment that can submit transactions on each channel, are needed to confirm that discovery returns the expected peers before and after the change. Written owners for each organization's approvals and a maintenance window calendar also speed up the work.

How long does configuring service discovery and anchor peers take?

The scope determines the duration. A single channel with two organizations and a small number of peers is a very different job from a multi-channel network with many organizations, change approvals and Kubernetes ingress to design. No timeline has been fixed here for either case. Before agreeing a date, ask for the written scope, the list of channels and organizations in it, the approval steps each organization requires, and the test plan. Most of the elapsed time usually sits in approvals and in the maintenance windows used for the channel updates.

What recurs after discovery is configured?

Anchor peer updates recur whenever a peer's address changes, is moved to new infrastructure, or is retired, because the anchor peer entries on the channel must point to peers that still exist. Each change needs a channel configuration update and the same approvals as the first setup. Teams should also retest discovery during each maintenance window, confirming that clients still receive a usable set of endorsing peers after a peer is stopped, upgraded or restarted. Ask a partner whether the retainer includes this recurring testing and how many channel updates it covers.

How does discovery keep endorsement working during peer maintenance?

Discovery uses gossip metadata to see which peers are online, so clients are directed to peers that are currently up. Endorsement keeps working during maintenance when, for every organization, at least one of its peers remains available and the client uses service discovery. Teams should check that each organization runs more than one peer, that bootstrap and external endpoints point to peers outside the one being maintained, and that the endorsement policy can still be satisfied with the peers that remain. A short test before each maintenance window, stopping one peer and submitting a transaction, shows whether this holds in practice.

When is external help worth it for service discovery?

External help is worth considering when the network has many organizations, when channel configuration changes need formal review, when peers sit behind Kubernetes ingress or load balancers that make external endpoints hard to get right, or when no one in house has edited a channel configuration recently. It is also useful when the team wants an independent test that endorsement survives a peer outage before a regulated go-live. DeployOpen plans and implements Fabric networks in the client's own infrastructure and can scope discovery work as a fixed-scope engagement with agreed deliverables, with ongoing support available as a retainer.

How a client finds endorsing peers through gossip and anchor peers

The client application starts by asking its peer gateway for endorsers under the chaincode's endorsement policy. The gateway consults discovery results built from gossip metadata, which spread between organization A and organization B peers through the anchor peers defined on the channel. A peer that is offline for maintenance drops out of those results, so the gateway routes endorsement requests to the remaining online peers. Check that each organization has an anchor peer and at least one online peer before taking a peer down.

Discovery results route endorsement requests to online peers across both organizations.

What to ask your team to provide before scoping

Start by asking for a peer inventory that lists every endorsing peer with its organization, its peer endpoint, its peer.gossip.endpoint and peer.gossip.externalEndpoint values, and its peer.gossip.bootstrap seeds. Discovery depends on gossip metadata, so the peers that announce themselves correctly and the endpoints other organizations can reach determine how much of the gossip layer needs review. A short inventory with stale addresses or peers behind undocumented NAT is one of the most common reasons a discovery review grows, and it is cheap for your team to produce now.

Next, collect the channel membership and endorsement policy for each channel, along with which organizations hold anchor peers on each one. Anchor peers are defined per channel, so a channel with three organizations and anchor peers in only two of them changes the work completely. The endorsement policies tell us how many organizations must be reachable for a transaction to succeed. Ask for the Fabric version in use on each peer as well, because the behavior and configuration keys you need to check can differ across the 2.5 LTS and 3.x lines. Confirm the exact versions from your own binaries and the Fabric release notes rather than from memory.

Finally, ask for the network paths between organizations and your maintenance schedule. Gossip and endorsement traffic cross organizational firewalls, load balancers and sometimes separate cloud accounts, so a list of allowed ports and routes between each pair of peers is needed before anyone can test discovery. The maintenance calendar matters just as much, because the question is not only whether discovery works on a normal day but whether endorsement keeps working while one peer is drained for patching. Ask which windows are fixed, who approves changes in each organization, and how long each member can take a peer offline.

How DeployOpen works on this

DeployOpen scopes Fabric service discovery and anchor peers as a written, fixed-scope piece of work inside your infrastructure. The work covers gossip configuration, anchor peer layout per channel and the maintenance procedures that keep endorsement working while peers are down.

How we scope

  • Inventory each channel's member organizations and confirm at least one peer per organization is planned for discovery.
  • Map gossip bootstrap, endpoint and external endpoint values for every peer in your network layout.
  • Agree in writing which anchor peers per channel, per organization, are in and out of scope.

How we build

  • Configure peer gossip settings and anchor peer updates on each channel, then confirm discovery returns the expected peers.
  • Test endorsement with one or more peers stopped to confirm the gateway routes around unavailable peers.
  • Record the peer maintenance runbook so operators can drain and restart peers without breaking endorsement.

How we hand over

  • Deliver the written configuration, channel anchor peer records and test results for your change records.
  • Walk your platform and channel administrators through the maintenance sequence and the checks that confirm discovery health.
  • Document open questions, such as endorsement policy assumptions, for your own owners to confirm before go-live.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers when your network changes.
  • Revisit discovery settings when you add organizations, peers or channels or change endorsement policies.
  • Re-test discovery and endorsement after each Fabric patch or minor upgrade in your environment.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.