Closed 1gezhanghao closed 1 year ago
you can follow up with our CI https://github.com/hyperledger/fabric-admin-sdk/actions/runs/4211821804/jobs/7310418287 as https://github.com/hyperledger/fabric-admin-sdk/blob/main/test/e2e_test.go#L236 here for demo
https://github.com/hyperledger/fabric-admin-sdk/blob/main/test/e2e_test.go#L236 in this demo Collections is set to nil, nothing more.How to set a SignaturePolicy in Collections is my question
eg:the SignaturePolicy expression is "AND('Org2MSP.peer','Org1MSP.peer')" , how to set this?
ok, could you give me an example with peer cli then I am going to trace with the code.
you can find the example in https://hyperledger-fabric.readthedocs.io/en/latest/commands/peerlifecycle.html in chapter : peer lifecycle chaincode approveformyorg example
use the cmd like this
peer lifecycle chaincode approveformyorg -o orderer.example.com:7050 --tls --cafile $ORDERER_CA --channelID mychannel --name mycc --version 1.0 --init-required --package-id myccv1:a7ca45a7cc85f1d89c905b775920361ed089a364e12a9b6d55ba75c965ddd6a9 --sequence 1 --signature-policy "AND ('Org1MSP.peer','Org2MSP.peer')"
I made a sample as https://github.com/hyperledger/fabric-admin-sdk/pull/108
@1gezhanghao we just have a PR to fix this issue, would you like to have a try?
// Definition of a chaincode in https://github.com/hyperledger/fabric-admin-sdk/blob/main/pkg/chaincode/lifecycle.go
it sames SignaturePolicy is in Collections Field, can give a demo for this?