Last active
December 22, 2019 04:25
-
-
Save Deeptiman/061f306d52a2e2c0f03d155e4f92e1c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cfg := []*cb.CollectionConfig{ collCfg1, collCfg2} | |
policy = "OR ('Org1MSP.member','Org2MSP.member','Org3MSP.member','Org4MSP.member')" | |
// here this policy is a completely separate entity, it relates to the all organization's peers following an endorsing policy to validate all the blocks in the network consistently. | |
ccPolicy, _ := cauthdsl.FromString(policy) // cauthdsl will convert the policy string to Policy object | |
resp, err := s.Resmgmt.InstantiateCC( | |
s.ChannelID, | |
resmgmt.InstantiateCCRequest{ | |
Name: s.ChaincodeId, | |
Path: s.ChaincodePath, | |
Version: s.ChainCodeVersion, | |
Args: [][]byte{[]byte("init")}, | |
Policy: ccPolicy, | |
CollConfig: cfg, | |
},resmgmt.WithRetry(retry.DefaultResMgmtOpts), resmgmt.WithTargets(orgPeers[0], orgPeers[1])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment