MCPcopy
hub / github.com/hyperledger/fabric / PurgeMarble

Function PurgeMarble

integration/pvtdata/marblechaincodeutil/testutil.go:61–77  ·  view source on GitHub ↗

PurgeMarble invokes marbles_private chaincode to purge a marble

(n *nwo.Network, orderer *nwo.Orderer, channelID, chaincodeName, marblePurge string, peer *nwo.Peer)

Source from the content-addressed store, hash-verified

59
60// PurgeMarble invokes marbles_private chaincode to purge a marble
61func PurgeMarble(n *nwo.Network, orderer *nwo.Orderer, channelID, chaincodeName, marblePurge string, peer *nwo.Peer) {
62 marblePurgeBase64 := base64.StdEncoding.EncodeToString([]byte(marblePurge))
63
64 command := commands.ChaincodeInvoke{
65 ChannelID: channelID,
66 Orderer: n.OrdererAddress(orderer, nwo.ListenPort),
67 Name: chaincodeName,
68 Ctor: `{"Args":["purge"]}`,
69 Transient: fmt.Sprintf(`{"marble_purge":"%s"}`, marblePurgeBase64),
70 PeerAddresses: []string{
71 n.PeerAddress(peer, nwo.ListenPort),
72 },
73 WaitForEvent: true,
74 }
75 invokeChaincode(n, peer, command)
76 nwo.WaitUntilEqualLedgerHeight(n, channelID, nwo.GetLedgerHeight(n, peer, channelID), n.Peers...)
77}
78
79// SetMarblePolicy invokes marbles_private chaincode to update a marble's state-based endorsement policy
80func SetMarblePolicy(n *nwo.Network, orderer *nwo.Orderer, channelID, chaincodeName, marblePolicy string, peer *nwo.Peer) {

Callers 1

data_purge_test.goFile · 0.92

Calls 5

GetLedgerHeightFunction · 0.92
OrdererAddressMethod · 0.80
PeerAddressMethod · 0.80
invokeChaincodeFunction · 0.70

Tested by

no test coverage detected