Re: How to create non endorsing peers ?


David Enyeart
 

You're right, a peer that maintains the channel blockchain but doesn't have chaincode installed can be considered a future endorser. At any point in the future you can install the chaincode on the peer and it will immediately start taking on endorsing load for that chaincode. Another use case is that you may want to load balance peers - some peers handle chaincode A, some peers handle chaincode B, while other peers are used as a block event source and don't handle any chaincodes.

I wouldn't go so far as to term peers as "endorsing peers" versus "committing peers". That is logically correct but in the past such terminology has confused people into thinking that there is some fundamental difference between them. It is better to think of it this way - All peers are committing peers for the channels they join; they can optionally serve an endorsing role if you install chaincode; they can be found by service discovery clients (e.g. SDK based applications) as prospective endorsers if you expose the peer via the externalEndpont configuration.

On 3/12/22, 8:32 AM, "Satyanarayana N" <nanduris@...> wrote:

On March 11, 2022 at 8:20 PM David Enyeart <enyeart@...> wrote:
> If you don't install chaincode on a peer, you won't be able to invoke or query
> the chaincode on the peer, although the peer will continue to maintain the
> blockchain state.

What is the purpose (or use case) of having a peer which doesn't respond to
query or invoke but maintains the blockchain state? Will it be useful to
substitute existing endorsing peer when it goes down.

Can we term a peer which doesn't have chaincode installed on it as committing
peer as it still maintains ledger state and they are there only for solving
above mentioned purpose.

> The other option is to install the chaincode so that the peer can be queried
> locally, but don't expose the peer to service discovery so that client
> applications don't know about it and won't invoke it.
>
> If you don't set a peer's exteneralEndpoint, it won't be exposed, for details
> see:
> https://hyperledger-fabric.readthedocs.io/en/latest/discovery-cli.html#configuring-external-endpoints

After applying this suggestion, now the discover command for getting endorsers
list is listing all peers except peer0 of org2 as expected.

>
> On 3/10/22, 11:29 PM, "fabric@... on behalf of Satya"
> <fabric@... on behalf of nanduris@...> wrote:
>
> Hi All,
>
> Thanks for your reply. However, I noticed the below error when trying to
> query
> the ledger.
>
> Error: endorsement failure during query. response: status:500
> message:"make sure
> the chaincode basic has been successfully defined on channel channelone
> and try
> again: chaincode definition for 'basic' exists, but chaincode is not
> installed"
>
>
> What I did was I installed chaincode on peer0 of org1, peer1 of org2
> (approved
> the chaincode) AND installed chaincode on peer0 of org2 (approved the
> chaincode). I did not install chaincode on peer1 of org2.
>
> Now when I tried to query all peers individually, I could get reply from
> peer0,
> peer1 of org1 and peer0 of org2 only.
>
> Hence, if I try to make a peer as non-committing peer by not installing
> chaincode then I won't get reply for query from that particular peer.
>
>
> Regards,
> Satya
>
> ------------------------------------------------------------------------------------------------------------
> [ C-DAC is on Social-Media too. Kindly follow us at:
> Facebook: https://www.facebook.com/CDACINDIA   & Twitter: @cdacindia ]
>
> This e-mail is for the sole use of the intended recipient(s) and may
> contain confidential and privileged information. If you are not the
> intended recipient, please contact the sender by reply e-mail and destroy
> all copies and the original message. Any unauthorized review, use,
> disclosure, dissemination, forwarding, printing or copying of this email
> is strictly prohibited and appropriate legal action will be taken.
>
> ------------------------------------------------------------------------------------------------------------
>
>
>
>
>
>
>
>
>
>
>
>
>
Regards,
Satya
--------------------------------------------------------------------------------------
एन.सत्यनारायण / N. Satyanarayana
प्रगत संगणन विकास केंद्र / Centre for Development of Advanced Computing
प्लाट संख्या ६ और ७, हार्डवेयर पार्क / Plot No. 6 & 7, Hardware Park
सर्वे संख्या १/१, श्रीसैलम हाईवे / Sy No. 1/1, Srisailam Highway
पहाड़ी शरीफ (केशवगिरी पोस्ट) / Pahadi Shareef Via Keshavagiri (Post)
हैदराबाद - ५०१५१० / Hyderabad - 501510
तेलंगाना (भारत) / Telangana (India)
------------------------------------------------------------------------------------------------------------
[ C-DAC is on Social-Media too. Kindly follow us at:
Facebook: https://www.facebook.com/CDACINDIA  & Twitter: @cdacindia ]

This e-mail is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. If you are not the
intended recipient, please contact the sender by reply e-mail and destroy
all copies and the original message. Any unauthorized review, use,
disclosure, dissemination, forwarding, printing or copying of this email
is strictly prohibited and appropriate legal action will be taken.
------------------------------------------------------------------------------------------------------------

Join {fabric@lists.hyperledger.org to automatically receive all group messages.