Skip to content

Commit

Permalink
system channel cleanup - cleanup integration (hyperledger#4209)
Browse files Browse the repository at this point in the history
Signed-off-by: Emil Elizarov <[email protected]>
Co-authored-by: Emil Elizarov <[email protected]>
  • Loading branch information
semil and Emil Elizarov authored May 16, 2023
1 parent 9f7695d commit 2cf53fb
Show file tree
Hide file tree
Showing 44 changed files with 97 additions and 331 deletions.
12 changes: 3 additions & 9 deletions integration/channelparticipation/channel_participation.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func doBody(client *http.Client, req *http.Request) []byte {
}

type ChannelList struct {
// Deprecated: system channel no longer supported
SystemChannel *ChannelInfoShort `json:"systemChannel"`
Channels []ChannelInfoShort `json:"channels"`
}
Expand Down Expand Up @@ -155,10 +156,10 @@ func Remove(n *nwo.Network, o *nwo.Orderer, channel string) {
Expect(resp.StatusCode).To(Equal(http.StatusNoContent))
}

func ChannelListMatcher(list ChannelList, expectedChannels []string, systemChannel ...string) {
func ChannelListMatcher(list ChannelList, expectedChannels []string) {
Expect(list).To(gstruct.MatchFields(gstruct.IgnoreExtras, gstruct.Fields{
"Channels": channelsMatcher(expectedChannels),
"SystemChannel": systemChannelMatcher(systemChannel...),
"SystemChannel": BeNil(),
}))
}

Expand All @@ -173,13 +174,6 @@ func channelsMatcher(channels []string) types.GomegaMatcher {
return ConsistOf(matchers)
}

func systemChannelMatcher(systemChannel ...string) types.GomegaMatcher {
if len(systemChannel) == 0 {
return BeNil()
}
return gstruct.PointTo(channelInfoShortMatcher(systemChannel[0]))
}

func channelInfoShortMatcher(channel string) types.GomegaMatcher {
return gstruct.MatchFields(gstruct.IgnoreExtras, gstruct.Fields{
"Name": Equal(channel),
Expand Down
2 changes: 1 addition & 1 deletion integration/configtx/configtx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var _ = Describe("ConfigTx", func() {
client, err = docker.NewClientFromEnv()
Expect(err).NotTo(HaveOccurred())

config := nwo.BasicEtcdRaftNoSysChan()
config := nwo.BasicEtcdRaft()
// disable all anchor peers
for _, p := range config.Peers {
for _, pc := range p.Channels {
Expand Down
2 changes: 1 addition & 1 deletion integration/configtx/consenter_mapping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var _ = Describe("ConfigTx ConsenterMapping", func() {
Expect(err).NotTo(HaveOccurred())
defer os.RemoveAll(testDir)

network := nwo.New(nwo.MultiNodeBFTNoSysChan(), testDir, nil, StartPort(), components)
network := nwo.New(nwo.MultiNodeBFT(), testDir, nil, StartPort(), components)

// Generate config
network.GenerateConfigTree()
Expand Down
4 changes: 1 addition & 3 deletions integration/devmode/devmode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,7 @@ var devModeEtcdraft = &nwo.Config{
CA: &nwo.CA{Hostname: "ca"},
}},
Consensus: &nwo.Consensus{
Type: "etcdraft",
BootstrapMethod: "none",
ChannelParticipationEnabled: true,
Type: "etcdraft",
},
Orderers: []*nwo.Orderer{
{Name: "orderer", Organization: "OrdererOrg"},
Expand Down
2 changes: 1 addition & 1 deletion integration/discovery/discovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ var _ = Describe("DiscoveryService", func() {
client, err = docker.NewClientFromEnv()
Expect(err).NotTo(HaveOccurred())

config = nwo.BasicEtcdRaftNoSysChan()
config = nwo.BasicEtcdRaft()
Expect(config.Peers).To(HaveLen(2))
})

Expand Down
2 changes: 1 addition & 1 deletion integration/e2e/acl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ var _ = Describe("EndToEndACL", func() {

// Speed up test by reducing the number of peers we
// bring up and install chaincode to.
etcdRaftConfig := nwo.BasicEtcdRaftNoSysChan()
etcdRaftConfig := nwo.BasicEtcdRaft()
etcdRaftConfig.RemovePeer("Org1", "peer1")
etcdRaftConfig.RemovePeer("Org2", "peer1")
Expect(etcdRaftConfig.Peers).To(HaveLen(2))
Expand Down
2 changes: 1 addition & 1 deletion integration/e2e/chaincode_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var _ = Describe("ChaincodeAsExternalServer", func() {
testDir, err = ioutil.TempDir("", "external-chaincode-server")
Expect(err).NotTo(HaveOccurred())

network = nwo.New(nwo.BasicEtcdRaftNoSysChan(), testDir, nil, StartPort(), components)
network = nwo.New(nwo.BasicEtcdRaft(), testDir, nil, StartPort(), components)
network.GenerateConfigTree()
network.Bootstrap()

Expand Down
2 changes: 1 addition & 1 deletion integration/e2e/e2e_signal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var _ = Describe("SignalHandling", func() {
client, err = docker.NewClientFromEnv()
Expect(err).NotTo(HaveOccurred())

network = nwo.New(nwo.BasicEtcdRaftNoSysChan(), testDir, client, StartPort(), components)
network = nwo.New(nwo.BasicEtcdRaft(), testDir, client, StartPort(), components)
network.GenerateConfigTree()
network.Bootstrap()

Expand Down
12 changes: 6 additions & 6 deletions integration/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ var _ = Describe("EndToEnd", func() {
metricsReader = NewMetricsReader()
go metricsReader.Start()

network = nwo.New(nwo.BasicEtcdRaftNoSysChan(), testDir, nil, StartPort(), components)
network = nwo.New(nwo.BasicEtcdRaft(), testDir, nil, StartPort(), components)
network.MetricsProvider = "statsd"
network.StatsdEndpoint = metricsReader.Address()
network.Channels = append(network.Channels, &nwo.Channel{
Expand Down Expand Up @@ -276,7 +276,7 @@ var _ = Describe("EndToEnd", func() {

Describe("basic etcdraft network with docker chaincode builds", func() {
BeforeEach(func() {
network = nwo.New(nwo.BasicEtcdRaftNoSysChan(), testDir, client, StartPort(), components)
network = nwo.New(nwo.BasicEtcdRaft(), testDir, client, StartPort(), components)
network.MetricsProvider = "prometheus"
network.GenerateConfigTree()
network.Bootstrap()
Expand Down Expand Up @@ -410,7 +410,7 @@ var _ = Describe("EndToEnd", func() {
)

BeforeEach(func() {
network = nwo.New(nwo.MultiChannelEtcdRaftNoSysChan(), testDir, client, StartPort(), components)
network = nwo.New(nwo.MultiChannelEtcdRaft(), testDir, client, StartPort(), components)
network.GenerateConfigTree()
for _, peer := range network.Peers {
core := network.ReadPeerConfig(peer)
Expand Down Expand Up @@ -505,7 +505,7 @@ var _ = Describe("EndToEnd", func() {

Describe("single node etcdraft network with remapped orderer endpoints", func() {
BeforeEach(func() {
network = nwo.New(nwo.MinimalRaftNoSysChan(), testDir, client, StartPort(), components)
network = nwo.New(nwo.MinimalRaft(), testDir, client, StartPort(), components)
network.GenerateConfigTree()

configtxConfig := network.ReadConfigTxConfig()
Expand Down Expand Up @@ -543,7 +543,7 @@ var _ = Describe("EndToEnd", func() {

Describe("basic etcdraft network with containers being interrupted", func() {
BeforeEach(func() {
network = nwo.New(nwo.FullEtcdRaftNoSysChan(), testDir, client, StartPort(), components)
network = nwo.New(nwo.FullEtcdRaft(), testDir, client, StartPort(), components)

network.GenerateConfigTree()
network.Bootstrap()
Expand Down Expand Up @@ -633,7 +633,7 @@ var _ = Describe("EndToEnd", func() {

Describe("basic lifecycle operations for chaincode install and update", func() {
BeforeEach(func() {
network = nwo.New(nwo.BasicEtcdRaftNoSysChan(), testDir, client, StartPort(), components)
network = nwo.New(nwo.BasicEtcdRaft(), testDir, client, StartPort(), components)

network.GenerateConfigTree()
network.Bootstrap()
Expand Down
2 changes: 1 addition & 1 deletion integration/e2e/health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var _ = Describe("Health", func() {
client, err = docker.NewClientFromEnv()
Expect(err).NotTo(HaveOccurred())

config := nwo.BasicEtcdRaftNoSysChan()
config := nwo.BasicEtcdRaft()
network = nwo.New(config, testDir, client, StartPort(), components)
network.GenerateConfigTree()
network.Bootstrap()
Expand Down
2 changes: 1 addition & 1 deletion integration/e2e/instantiation_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ var _ = Describe("InstantiationPolicy", func() {

Describe("single node etcdraft network with single peer", func() {
BeforeEach(func() {
config := nwo.MinimalRaftNoSysChan()
config := nwo.MinimalRaft()
config.Profiles[0].Organizations = []string{"Org1", "Org2"}
network = nwo.New(config, testDir, client, StartPort(), components)
network.GenerateConfigTree()
Expand Down
2 changes: 1 addition & 1 deletion integration/gateway/endorsing_orgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ var _ = Describe("GatewayService with endorsing orgs", func() {
client, err := docker.NewClientFromEnv()
Expect(err).NotTo(HaveOccurred())

config := nwo.ThreeOrgEtcdRaftNoSysChan()
config := nwo.ThreeOrgEtcdRaft()
network = nwo.New(config, testDir, client, StartPort(), components)

network.GenerateConfigTree()
Expand Down
4 changes: 0 additions & 4 deletions integration/gateway/gateway_bft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,7 @@ var _ = Describe("GatewayService with BFT ordering service", func() {
Expect(err).NotTo(HaveOccurred())

networkConfig := nwo.MultiNodeSmartBFT()
networkConfig.SystemChannel = nil
network = nwo.New(networkConfig, testDir, client, StartPort(), components)
network.Consortiums = nil
network.Consensus.ChannelParticipationEnabled = true
network.Consensus.BootstrapMethod = "none"

network.GenerateConfigTree()
network.Bootstrap()
Expand Down
2 changes: 1 addition & 1 deletion integration/gateway/gateway_discovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ var _ = Describe("GatewayService with endorser discovery", func() {
client, err := docker.NewClientFromEnv()
Expect(err).NotTo(HaveOccurred())

config := nwo.ThreeOrgEtcdRaftNoSysChan()
config := nwo.ThreeOrgEtcdRaft()
network = nwo.New(config, testDir, client, StartPort(), components)

network.GenerateConfigTree()
Expand Down
2 changes: 1 addition & 1 deletion integration/gateway/gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ var _ = Describe("GatewayService basic", func() {
client, err := docker.NewClientFromEnv()
Expect(err).NotTo(HaveOccurred())

config := nwo.BasicEtcdRaftNoSysChan()
config := nwo.BasicEtcdRaft()
network = nwo.New(config, testDir, client, StartPort(), components)

network.GenerateConfigTree()
Expand Down
2 changes: 1 addition & 1 deletion integration/gossip/gossip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var _ = Describe("Gossip State Transfer and Membership", func() {
Expect(err).NotTo(HaveOccurred())

channelName = "testchannel"
network = nwo.New(nwo.FullEtcdRaftNoSysChan(), testDir, dockerClient, StartPort(), components)
network = nwo.New(nwo.FullEtcdRaft(), testDir, dockerClient, StartPort(), components)
network.GenerateConfigTree()

nwprocs = &networkProcesses{
Expand Down
2 changes: 1 addition & 1 deletion integration/idemix/idemix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ var _ = Describe("EndToEnd", func() {

Describe("basic etcdraft network with 2 orgs", func() {
BeforeEach(func() {
network = nwo.New(nwo.BasicEtcdRaftWithIdemixNoSysChan(), testDir, client, StartPort(), components)
network = nwo.New(nwo.BasicEtcdRaftWithIdemix(), testDir, client, StartPort(), components)
network.GenerateConfigTree()
network.Bootstrap()

Expand Down
2 changes: 1 addition & 1 deletion integration/ledger/couchdb_indexes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ var _ = Describe("CouchDB indexes", func() {
client, err = docker.NewClientFromEnv()
Expect(err).NotTo(HaveOccurred())

network = nwo.New(nwo.FullEtcdRaftNoSysChan(), testDir, client, StartPort(), components)
network = nwo.New(nwo.FullEtcdRaft(), testDir, client, StartPort(), components)

cwd, err := os.Getwd()
Expect(err).NotTo(HaveOccurred())
Expand Down
2 changes: 1 addition & 1 deletion integration/ledger/reset_rollback_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ func initThreeOrgsSetup() *setup {
client, err := docker.NewClientFromEnv()
Expect(err).NotTo(HaveOccurred())

config := nwo.ThreeOrgEtcdRaftNoSysChan()
config := nwo.ThreeOrgEtcdRaft()
// disable all anchor peers
for _, p := range config.Peers {
for _, pc := range p.Channels {
Expand Down
2 changes: 1 addition & 1 deletion integration/ledger/snapshot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ func initAndStartFourOrgsNetwork() *setup {
client, err := docker.NewClientFromEnv()
Expect(err).NotTo(HaveOccurred())

config := nwo.BasicEtcdRaftNoSysChan()
config := nwo.BasicEtcdRaft()

for _, peer := range config.Peers {
peer.Channels = []*nwo.PeerChannel{
Expand Down
2 changes: 1 addition & 1 deletion integration/lifecycle/ccenv14_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var _ = Describe("etcdraft network using ccenv-1.4", func() {
client, err = docker.NewClientFromEnv()
Expect(err).NotTo(HaveOccurred())

network = nwo.New(nwo.BasicEtcdRaftNoSysChan(), testDir, client, StartPort(), components)
network = nwo.New(nwo.BasicEtcdRaft(), testDir, client, StartPort(), components)
network.GenerateConfigTree()
for _, peer := range network.PeersWithChannel("testchannel") {
core := network.ReadPeerConfig(peer)
Expand Down
2 changes: 1 addition & 1 deletion integration/lifecycle/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ var _ = Describe("chaincode install", func() {
cwd, err := os.Getwd()
Expect(err).NotTo(HaveOccurred())

network = nwo.New(nwo.BasicEtcdRaftNoSysChan(), testDir, client, StartPort(), components)
network = nwo.New(nwo.BasicEtcdRaft(), testDir, client, StartPort(), components)
network.ExternalBuilders = append(network.ExternalBuilders, fabricconfig.ExternalBuilder{
Path: filepath.Join(cwd, "..", "externalbuilders", "golang"),
Name: "external-golang",
Expand Down
2 changes: 1 addition & 1 deletion integration/lifecycle/interop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var _ = Describe("Release interoperability", func() {
client, err = docker.NewClientFromEnv()
Expect(err).NotTo(HaveOccurred())

network = nwo.New(nwo.MultiChannelEtcdRaftNoSysChan(), testDir, client, StartPort(), components)
network = nwo.New(nwo.MultiChannelEtcdRaft(), testDir, client, StartPort(), components)
network.GenerateConfigTree()
network.Bootstrap()

Expand Down
2 changes: 1 addition & 1 deletion integration/lifecycle/lifecycle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var _ = Describe("Lifecycle", func() {
client, err = docker.NewClientFromEnv()
Expect(err).NotTo(HaveOccurred())

network = nwo.New(nwo.BasicEtcdRaftNoSysChan(), testDir, client, StartPort(), components)
network = nwo.New(nwo.BasicEtcdRaft(), testDir, client, StartPort(), components)

// Generate config
network.GenerateConfigTree()
Expand Down
2 changes: 1 addition & 1 deletion integration/msp/msp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var _ = Describe("MSP identity test on a network with mutual TLS required", func
client, err = docker.NewClientFromEnv()
Expect(err).NotTo(HaveOccurred())

network = nwo.New(nwo.BasicEtcdRaftNoSysChan(), tempDir, client, StartPort(), components)
network = nwo.New(nwo.BasicEtcdRaft(), tempDir, client, StartPort(), components)
})

AfterEach(func() {
Expand Down
2 changes: 1 addition & 1 deletion integration/msp/rsaca_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var _ = Describe("MSPs with RSA Certificate Authorities", func() {
client, err = docker.NewClientFromEnv()
Expect(err).NotTo(HaveOccurred())

network = nwo.New(nwo.BasicEtcdRaftNoSysChan(), testDir, client, StartPort(), components)
network = nwo.New(nwo.BasicEtcdRaft(), testDir, client, StartPort(), components)
network.GenerateConfigTree()

By("manually bootstrapping MSPs with RSA CAs")
Expand Down
2 changes: 0 additions & 2 deletions integration/nwo/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ package nwo
// fabric configuration files.
type Config struct {
Organizations []*Organization `yaml:"organizations,omitempty"`
Consortiums []*Consortium `yaml:"consortiums,omitempty"`
SystemChannel *SystemChannel `yaml:"system_channel,omitempty"`
Channels []*Channel `yaml:"channels,omitempty"`
Consensus *Consensus `yaml:"consensus,omitempty"`
Orderers []*Orderer `yaml:"orderers,omitempty"`
Expand Down
15 changes: 4 additions & 11 deletions integration/nwo/fabricconfig/configtx.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,10 @@ type EtcdRaftOptions struct {
}

type Channel struct {
Orderer *ConfigTxOrderer `yaml:"Orderer,omitempty"`
Application *Application `yaml:"Application,omitempty"`
Policies map[string]*Policy `yaml:"Policies,omitempty"`
Capabilities map[string]bool `yaml:"Capabilities,omitempty"`
Consortiums map[string]*Consortium `yaml:"Consortiums,omitempty"`

ExtraProperties map[string]interface{} `yaml:",inline,omitempty"`
}

type Consortium struct {
Organizations []*Organization `yaml:"Organizations,omitempty"`
Orderer *ConfigTxOrderer `yaml:"Orderer,omitempty"`
Application *Application `yaml:"Application,omitempty"`
Policies map[string]*Policy `yaml:"Policies,omitempty"`
Capabilities map[string]bool `yaml:"Capabilities,omitempty"`

ExtraProperties map[string]interface{} `yaml:",inline,omitempty"`
}
3 changes: 0 additions & 3 deletions integration/nwo/fabricconfig/orderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ type General struct {
TLS *OrdererTLS `yaml:"TLS,omitempty"`
Keepalive *OrdererKeepalive `yaml:"Keepalive,omitempty"`
BootstrapMethod string `yaml:"BootstrapMethod,omitempty"`
GenesisProfile string `yaml:"GenesisProfile,omitempty"`
GenesisFile string `yaml:"GenesisFile,omitempty"` // will be replaced by the BootstrapFile
BootstrapFile string `yaml:"BootstrapFile,omitempty"`
LocalMSPDir string `yaml:"LocalMSPDir,omitempty"`
LocalMSPID string `yaml:"LocalMSPID,omitempty"`
Profile *OrdererProfile `yaml:"Profile,omitempty"`
Expand Down
Loading

0 comments on commit 2cf53fb

Please sign in to comment.