Re: Search for an endorsement policy translator for Node.js SDK v1.4

Matthew White

Hello - I do have a pegjs grammar for policies that could be useful.
Regards, Matthew.
Matthew B White  IBM Blockchain Solutions Architect
Email me at WHITEMAT@...
Find me on StackOverflow, and generally at
Note: restricted availability for meetings 14:30 to 17:00 UK Tuesday 
IBM United Kingdom Limited, Hursley Park, Winchester, Hampshire, SO21 2JN

"The wrong answers are the ones you go looking for when the right answers stare you in the face"
----- Original message -----
From: "Mr.Phuwanai Thummavet" <mr.thummavet@...>
Sent by: fabric@...
To: fabric <fabric@...>
Subject: [EXTERNAL] [Hyperledger Fabric] Search for an endorsement policy translator for Node.js SDK v1.4
Date: Thu, Aug 27, 2020 11:36 AM
Hi Everyone,

I'm using Node.js Fabric SDK v1.4 for managing chaincode operations such as installing, instantiating, and upgrading. When to instantiate or upgrade a chaincode, I have to provide an endorsement policy in terms of a JSON object like the following.
  identities: [
    { role: { name: "member", mspId: "org1" }},
    { role: { name: "member", mspId: "org2" }}
  policy: {
    "1-of": [{ "signed-by": 0 }, { "signed-by": 1 }]
That works but makes a bit of pain to me. Does anyone have any solution to translate the endorsement policy like this "OR('org1.member', 'org2.member')", for example, to the above JSON object?

Thank you so much.
Best Regards,
Phuwanai Thummavet
Blockchain Architect and Full-Stack Developer
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

Join to automatically receive all group messages.