Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ require (
go.opentelemetry.io/otel/trace v1.43.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/crypto v0.51.0 // indirect
golang.org/x/net v0.54.0 // indirect
golang.org/x/crypto v0.52.0 // indirect
golang.org/x/net v0.55.0 // indirect
golang.org/x/sync v0.20.0 // indirect
golang.org/x/sys v0.44.0 // indirect
golang.org/x/sys v0.45.0 // indirect
golang.org/x/text v0.37.0 // indirect
golang.org/x/tools v0.45.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260511170946-3700d4141b60 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260511170946-3700d4141b60 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
20 changes: 10 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1172,8 +1172,8 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
golang.org/x/crypto v0.51.0 h1:IBPXwPfKxY7cWQZ38ZCIRPI50YLeevDLlLnyC5wRGTI=
golang.org/x/crypto v0.51.0/go.mod h1:8AdwkbraGNABw2kOX6YFPs3WM22XqI4EXEd8g+x7Oc8=
golang.org/x/crypto v0.52.0 h1:RMs7fP2rXdep0CftQlK8Uf+kibLm7qkCcradZWYz988=
golang.org/x/crypto v0.52.0/go.mod h1:1QgfPxDqh0T2M/elOJtp9RvuR95kVjir0e6/BvEmGbc=
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
Expand Down Expand Up @@ -1299,8 +1299,8 @@ golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.54.0 h1:2zJIZAxAHV/OHCDTCOHAYehQzLfSXuf/5SoL/Dv6w/w=
golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ=
golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8=
golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down Expand Up @@ -1436,8 +1436,8 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.44.0 h1:ildZl3J4uzeKP07r2F++Op7E9B29JRUy+a27EibtBTQ=
golang.org/x/sys v0.44.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY=
golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
Expand Down Expand Up @@ -1758,10 +1758,10 @@ google.golang.org/genproto v0.0.0-20230323212658-478b75c54725/go.mod h1:UUQDJDOl
google.golang.org/genproto v0.0.0-20230330154414-c0448cd141ea/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak=
google.golang.org/genproto v0.0.0-20230331144136-dcfb400f0633/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak=
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU=
google.golang.org/genproto/googleapis/api v0.0.0-20260511170946-3700d4141b60 h1:3WsB1FAbiRIf2tOxscWKs3pQBD9he1NsrnbhMuWfekc=
google.golang.org/genproto/googleapis/api v0.0.0-20260511170946-3700d4141b60/go.mod h1:7yoXV7RIh5gblj/xVYoogxAWvA9wUeVbpsK/M694l00=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260511170946-3700d4141b60 h1:seT2EwLWM78plQ7wcDfuWBc/4FAEAXDDiaSol4ku4qo=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260511170946-3700d4141b60/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8=
google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa h1:Kjn0N0tCrDgiAFW+lGO4JZ3ck44CehvJQMAwj9QF0G8=
google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa/go.mod h1:q4lMZS6kskjT5HvCPrnnypcDPVJqT/f4nfxmkE7gryY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa h1:mZHHdPZl0dbGHCflZgAq/Q468DWVFcU2whhB2KAo8fk=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
Expand Down
241 changes: 121 additions & 120 deletions integration/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,138 +230,139 @@ var _ = Describe("EndToEnd", func() {
})
})

DescribeTableSubtree("basic etcdraft network with docker chaincode builds", func(ccenvVersion string) {
BeforeEach(func() {
network = nwo.New(nwo.BasicEtcdRaft(), testDir, client, StartPort(), components)
network.CCEnvVersion = ccenvVersion
network.MetricsProvider = "prometheus"
network.GenerateConfigTree()
network.Bootstrap()

// Start all the fabric processes
ordererRunner, ordererProcess, peerProcess = network.StartSingleOrdererNetwork("orderer")
})

It("builds and executes transactions with docker chaincode", func() {
chaincodePath, err := filepath.Abs("../chaincode/module")
Expect(err).NotTo(HaveOccurred())

// use these two variants of the same chaincode to ensure we test
// the golang docker build for both module and gopath chaincode
chaincode := nwo.Chaincode{
Name: "mycc",
Version: "0.0",
Path: chaincodePath,
Lang: "golang",
PackageFile: filepath.Join(testDir, "modulecc.tar.gz"),
Ctor: `{"Args":["init","a","100","b","200"]}`,
SignaturePolicy: `AND ('Org1MSP.member','Org2MSP.member')`,
Sequence: "1",
InitRequired: true,
Label: "my_module_chaincode",
}

gopathChaincode := nwo.Chaincode{
Name: "mycc",
Version: "0.0",
Path: "github.com/hyperledger/fabric/integration/chaincode/simple/cmd",
Lang: "golang",
PackageFile: filepath.Join(testDir, "simplecc.tar.gz"),
Ctor: `{"Args":["init","a","100","b","200"]}`,
SignaturePolicy: `AND ('Org1MSP.member','Org2MSP.member')`,
Sequence: "1",
InitRequired: true,
Label: "my_simple_chaincode",
}

orderer := network.Orderer("orderer")

By("setting up the channel")
nwo.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)

cl := nwo.List(network, orderer)
nwo.ChannelListMatcher(cl, []string{"testchannel"})

nwo.EnableCapabilities(network, "testchannel", "Application", "V2_5", orderer, network.Peer("Org1", "peer0"), network.Peer("Org2", "peer0"))

// package, install, and approve by org1 - module chaincode
packageInstallApproveChaincode(network, "testchannel", orderer, chaincode, network.Peer("Org1", "peer0"))

// package, install, and approve by org2 - gopath chaincode, same logic
packageInstallApproveChaincode(network, "testchannel", orderer, gopathChaincode, network.Peer("Org2", "peer0"))
DescribeTableSubtree(
"basic etcdraft network with docker chaincode builds", func(ccenvVersion string) {
BeforeEach(func() {
network = nwo.New(nwo.BasicEtcdRaft(), testDir, client, StartPort(), components)
network.CCEnvVersion = ccenvVersion
network.MetricsProvider = "prometheus"
network.GenerateConfigTree()
network.Bootstrap()

// Start all the fabric processes
ordererRunner, ordererProcess, peerProcess = network.StartSingleOrdererNetwork("orderer")
})

testPeers := network.PeersWithChannel("testchannel")
nwo.CheckCommitReadinessUntilReady(network, "testchannel", chaincode, network.PeerOrgs(), testPeers...)
nwo.CommitChaincode(network, "testchannel", orderer, chaincode, testPeers[0], testPeers...)
nwo.InitChaincode(network, "testchannel", orderer, chaincode, testPeers...)
It("builds and executes transactions with docker chaincode", func() {
chaincodePath, err := filepath.Abs("../chaincode/module")
Expect(err).NotTo(HaveOccurred())

By("listing the containers after committing the chaincode definition")
initialContainerFilter := make(dcli.Filters).Add(
"name",
chaincodeContainerNameFilter(network, chaincode),
chaincodeContainerNameFilter(network, gopathChaincode),
)
containers, err := client.ContainerList(context.Background(), dcli.ContainerListOptions{
Filters: initialContainerFilter,
})
Expect(err).NotTo(HaveOccurred())
Expect(containers.Items).To(HaveLen(2))
// use these two variants of the same chaincode to ensure we test
// the golang docker build for both module and gopath chaincode
chaincode := nwo.Chaincode{
Name: "mycc",
Version: "0.0",
Path: chaincodePath,
Lang: "golang",
PackageFile: filepath.Join(testDir, "modulecc.tar.gz"),
Ctor: `{"Args":["init","a","100","b","200"]}`,
SignaturePolicy: `AND ('Org1MSP.member','Org2MSP.member')`,
Sequence: "1",
InitRequired: true,
Label: "my_module_chaincode",
}

gopathChaincode := nwo.Chaincode{
Name: "mycc",
Version: "0.0",
Path: "github.com/hyperledger/fabric/integration/chaincode/simple/cmd",
Lang: "golang",
PackageFile: filepath.Join(testDir, "simplecc.tar.gz"),
Ctor: `{"Args":["init","a","100","b","200"]}`,
SignaturePolicy: `AND ('Org1MSP.member','Org2MSP.member')`,
Sequence: "1",
InitRequired: true,
Label: "my_simple_chaincode",
}

orderer := network.Orderer("orderer")

By("setting up the channel")
nwo.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)

cl := nwo.List(network, orderer)
nwo.ChannelListMatcher(cl, []string{"testchannel"})

nwo.EnableCapabilities(network, "testchannel", "Application", "V2_5", orderer, network.Peer("Org1", "peer0"), network.Peer("Org2", "peer0"))

// package, install, and approve by org1 - module chaincode
packageInstallApproveChaincode(network, "testchannel", orderer, chaincode, network.Peer("Org1", "peer0"))

// package, install, and approve by org2 - gopath chaincode, same logic
packageInstallApproveChaincode(network, "testchannel", orderer, gopathChaincode, network.Peer("Org2", "peer0"))

testPeers := network.PeersWithChannel("testchannel")
nwo.CheckCommitReadinessUntilReady(network, "testchannel", chaincode, network.PeerOrgs(), testPeers...)
nwo.CommitChaincode(network, "testchannel", orderer, chaincode, testPeers[0], testPeers...)
nwo.InitChaincode(network, "testchannel", orderer, chaincode, testPeers...)

By("listing the containers after committing the chaincode definition")
initialContainerFilter := make(dcli.Filters).Add(
"name",
chaincodeContainerNameFilter(network, chaincode),
chaincodeContainerNameFilter(network, gopathChaincode),
)
containers, err := client.ContainerList(context.Background(), dcli.ContainerListOptions{
Filters: initialContainerFilter,
})
Expect(err).NotTo(HaveOccurred())
Expect(containers.Items).To(HaveLen(2))

RunQueryInvokeQuery(network, orderer, network.Peer("Org1", "peer0"), "testchannel")
RunQueryInvokeQuery(network, orderer, network.Peer("Org1", "peer0"), "testchannel")

By("evaluating the operations endpoint and prometheus metrics")
CheckPeerOperationEndpoints(network, network.Peer("Org2", "peer0"))
CheckOrdererOperationEndpoints(network, orderer)
By("evaluating the operations endpoint and prometheus metrics")
CheckPeerOperationEndpoints(network, network.Peer("Org2", "peer0"))
CheckOrdererOperationEndpoints(network, orderer)

// upgrade chaincode to v2.0 with different label
chaincode.Version = "1.0"
chaincode.Sequence = "2"
chaincode.Label = "my_module_chaincode_updated"
gopathChaincode.Version = "1.0"
gopathChaincode.Sequence = "2"
gopathChaincode.Label = "my_simple_chaincode_updated"
// upgrade chaincode to v2.0 with different label
chaincode.Version = "1.0"
chaincode.Sequence = "2"
chaincode.Label = "my_module_chaincode_updated"
gopathChaincode.Version = "1.0"
gopathChaincode.Sequence = "2"
gopathChaincode.Label = "my_simple_chaincode_updated"

// package, install, and approve by org1 - module chaincode
packageInstallApproveChaincode(network, "testchannel", orderer, chaincode, network.Peer("Org1", "peer0"))
// package, install, and approve by org1 - module chaincode
packageInstallApproveChaincode(network, "testchannel", orderer, chaincode, network.Peer("Org1", "peer0"))

// package, install, and approve by org2 - gopath chaincode, same logic
packageInstallApproveChaincode(network, "testchannel", orderer, gopathChaincode, network.Peer("Org2", "peer0"))
// package, install, and approve by org2 - gopath chaincode, same logic
packageInstallApproveChaincode(network, "testchannel", orderer, gopathChaincode, network.Peer("Org2", "peer0"))

nwo.CheckCommitReadinessUntilReady(network, "testchannel", chaincode, network.PeerOrgs(), testPeers...)
nwo.CommitChaincode(network, "testchannel", orderer, chaincode, testPeers[0], testPeers...)
nwo.InitChaincode(network, "testchannel", orderer, chaincode, testPeers...)
nwo.CheckCommitReadinessUntilReady(network, "testchannel", chaincode, network.PeerOrgs(), testPeers...)
nwo.CommitChaincode(network, "testchannel", orderer, chaincode, testPeers[0], testPeers...)
nwo.InitChaincode(network, "testchannel", orderer, chaincode, testPeers...)

By("listing the containers after updating the chaincode definition")
// expect the containers for the previous package id to be stopped
containers, err = client.ContainerList(context.Background(), dcli.ContainerListOptions{
Filters: initialContainerFilter,
})
Expect(err).NotTo(HaveOccurred())
Expect(containers.Items).To(HaveLen(0))
updatedContainerFilter := make(dcli.Filters).Add(
"name",
chaincodeContainerNameFilter(network, chaincode),
chaincodeContainerNameFilter(network, gopathChaincode),
)
containers, err = client.ContainerList(context.Background(), dcli.ContainerListOptions{
Filters: updatedContainerFilter,
})
Expect(err).NotTo(HaveOccurred())
Expect(containers.Items).To(HaveLen(2))
By("listing the containers after updating the chaincode definition")
// expect the containers for the previous package id to be stopped
containers, err = client.ContainerList(context.Background(), dcli.ContainerListOptions{
Filters: initialContainerFilter,
})
Expect(err).NotTo(HaveOccurred())
Expect(containers.Items).To(HaveLen(0))
updatedContainerFilter := make(dcli.Filters).Add(
"name",
chaincodeContainerNameFilter(network, chaincode),
chaincodeContainerNameFilter(network, gopathChaincode),
)
containers, err = client.ContainerList(context.Background(), dcli.ContainerListOptions{
Filters: updatedContainerFilter,
})
Expect(err).NotTo(HaveOccurred())
Expect(containers.Items).To(HaveLen(2))

RunQueryInvokeQuery(network, orderer, network.Peer("Org1", "peer0"), "testchannel")
RunQueryInvokeQuery(network, orderer, network.Peer("Org1", "peer0"), "testchannel")

By("retrieving the local mspid of the peer via simple chaincode")
sess, err := network.PeerUserSession(network.Peer("Org2", "peer0"), "User1", commands.ChaincodeQuery{
ChannelID: "testchannel",
Name: "mycc",
Ctor: `{"Args":["mspid"]}`,
By("retrieving the local mspid of the peer via simple chaincode")
sess, err := network.PeerUserSession(network.Peer("Org2", "peer0"), "User1", commands.ChaincodeQuery{
ChannelID: "testchannel",
Name: "mycc",
Ctor: `{"Args":["mspid"]}`,
})
Expect(err).NotTo(HaveOccurred())
Eventually(sess, network.EventuallyTimeout).Should(gexec.Exit(0))
Expect(sess).To(gbytes.Say("Org2MSP"))
})
Expect(err).NotTo(HaveOccurred())
Eventually(sess, network.EventuallyTimeout).Should(gexec.Exit(0))
Expect(sess).To(gbytes.Say("Org2MSP"))
})
},
},
Entry("current ccenv", "$(PROJECT_VERSION)"),
Entry("old ccenv 3.1.3 with go 1.25.2", "3.1.3"),
)
Expand Down
11 changes: 0 additions & 11 deletions vendor/golang.org/x/crypto/blake2b/go125.go

This file was deleted.

Loading