Uploaded image for project: 'Fabric'
  1. Fabric
  2. FAB-18116 Enhance/Add commands to accomodate channels created from snapshot
  3. FAB-18278

Update Service Discovery to get config from state instead of config block

    XMLWordPrintable

Details

    • Sub-task
    • Status: Closed
    • Medium
    • Resolution: Done
    • v2.3.0
    • v2.3.0
    • fabric-ledger
    • None

    Description

      Service Discovery config query (e.g. for retrieving orderer endpoints) doesn't work against peers bootstrapped from a snapshot when there are no config blocks after the snapshot:

      $ discover --configFile conf.yaml config --channel mychannel --server 127.0.0.1:7057
      failed fetching config for channel mychannel

       

      CSCC and Service Discovery both get the config block.

      For peers joined from snapshot, there may not be a latest config block. Therefore, consumers should get the latest config from state, instead of from the latest config block.

      The consumers are CSCC and Service Discovery, based on grep results:

      core/scc/cscc/configure.go:294: block, err := peer.ConfigBlockFromLedger(channel.Ledger())
      internal/peer/node/start.go:963: block, err := peer.ConfigBlockFromLedger(channel.Ledger())

       

      Since CSCC GetConfigBlock() is an external API, this one can't be changed and consumers will have to deal with the error "failed fetching config".

      That leaves Service Discovery. It should be updated to get latest config from state.

      Attachments

        Activity

          People

            manish-sethi Manish Sethi
            denyeart David Enyeart
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: