diff --git a/integration/e2e/cft_test.go b/integration/e2e/cft_test.go index a78b163bf29..d502206e9c7 100644 --- a/integration/e2e/cft_test.go +++ b/integration/e2e/cft_test.go @@ -446,17 +446,12 @@ var _ = Describe("EndToEnd Crash Fault Tolerance", func() { for i, runner := range []*ginkgomon.Runner{o1Runner, o2Runner, o3Runner} { // Switch between the general port and the cluster listener port - port := network.OrdererPort(network.Orderers[i], nwo.ListenPort) - runner.Command.Env = append(runner.Command.Env, fmt.Sprintf("ORDERER_GENERAL_CLUSTER_LISTENPORT=%d", port)) - runner.Command.Env = append(runner.Command.Env, fmt.Sprintf("ORDERER_GENERAL_LISTENPORT=%d", network.ReservePort())) runner.Command.Env = append(runner.Command.Env, "ORDERER_GENERAL_CLUSTER_TLSHANDSHAKETIMESHIFT=90s") - runner.Command.Env = append(runner.Command.Env, "ORDERER_GENERAL_CLUSTER_LISTENADDRESS=127.0.0.1") tlsCertPath := filepath.Join(network.OrdererLocalTLSDir(network.Orderers[i]), "server.crt") tlsKeyPath := filepath.Join(network.OrdererLocalTLSDir(network.Orderers[i]), "server.key") runner.Command.Env = append(runner.Command.Env, fmt.Sprintf("ORDERER_GENERAL_CLUSTER_SERVERCERTIFICATE=%s", tlsCertPath)) runner.Command.Env = append(runner.Command.Env, fmt.Sprintf("ORDERER_GENERAL_CLUSTER_SERVERPRIVATEKEY=%s", tlsKeyPath)) runner.Command.Env = append(runner.Command.Env, fmt.Sprintf("ORDERER_GENERAL_CLUSTER_ROOTCAS=%s", ordererTLSCACertPath)) - runner.Command.Env = append(runner.Command.Env, "ORDERER_METRICS_PROVIDER=disabled") } o1Proc = ifrit.Invoke(o1Runner) diff --git a/integration/e2e/etcdraft_reconfig_test.go b/integration/e2e/etcdraft_reconfig_test.go index 9f33bed8d38..09887d9a48b 100644 --- a/integration/e2e/etcdraft_reconfig_test.go +++ b/integration/e2e/etcdraft_reconfig_test.go @@ -148,7 +148,7 @@ var _ = Describe("EndToEnd reconfiguration and onboarding", func() { ServerTlsCert: secondOrdererCertificate, ClientTlsCert: secondOrdererCertificate, Host: "127.0.0.1", - Port: uint32(network.OrdererPort(orderer2, nwo.ListenPort)), + Port: uint32(network.OrdererPort(orderer2, nwo.ClusterPort)), }) By("Obtaining the last config block from the orderer") @@ -242,7 +242,7 @@ var _ = Describe("EndToEnd reconfiguration and onboarding", func() { return ret }() submitterOrderer := network.Orderers[submitter] - port := network.OrdererPort(targetOrderer, nwo.ListenPort) + port := network.OrdererPort(targetOrderer, nwo.ClusterPort) fmt.Fprintf(GinkgoWriter, "Rotating certificate of orderer node %d\n", target+1) swap(submitterOrderer, rotation.oldCert, etcdraft.Consenter{ @@ -262,7 +262,7 @@ var _ = Describe("EndToEnd reconfiguration and onboarding", func() { ChannelID: network.SystemChannel.Name, Block: "newest", OutputFile: "/dev/null", - Orderer: network.OrdererAddress(targetOrderer, nwo.ListenPort), + Orderer: network.OrdererAddress(targetOrderer, nwo.ClusterPort), } Eventually(func() string { sess, err := network.OrdererAdminSession(targetOrderer, peer, c) @@ -394,7 +394,7 @@ var _ = Describe("EndToEnd reconfiguration and onboarding", func() { for i, rotation := range certificateRotations { o := network.Orderers[i] - port := network.OrdererPort(o, nwo.ListenPort) + port := network.OrdererPort(o, nwo.ClusterPort) By(fmt.Sprintf("Adding the future certificate of orderer node %d", i)) for _, channelName := range []string{"systemchannel", "testchannel"} { @@ -468,7 +468,7 @@ var _ = Describe("EndToEnd reconfiguration and onboarding", func() { ServerTlsCert: orderer4Certificate, ClientTlsCert: orderer4Certificate, Host: "127.0.0.1", - Port: uint32(network.OrdererPort(o4, nwo.ListenPort)), + Port: uint32(network.OrdererPort(o4, nwo.ClusterPort)), }) } @@ -535,7 +535,7 @@ var _ = Describe("EndToEnd reconfiguration and onboarding", func() { ServerTlsCert: orderer4Certificate, ClientTlsCert: orderer4Certificate, Host: "127.0.0.1", - Port: uint32(network.OrdererPort(o4, nwo.ListenPort)), + Port: uint32(network.OrdererPort(o4, nwo.ClusterPort)), }) By("Waiting for orderer4 and to replicate testchannel2") @@ -619,7 +619,7 @@ var _ = Describe("EndToEnd reconfiguration and onboarding", func() { ServerTlsCert: ordererCertificate, ClientTlsCert: ordererCertificate, Host: "127.0.0.1", - Port: uint32(network.OrdererPort(o2, nwo.ListenPort)), + Port: uint32(network.OrdererPort(o2, nwo.ClusterPort)), }) By("Waiting for orderer2 to join the channel") @@ -635,7 +635,7 @@ var _ = Describe("EndToEnd reconfiguration and onboarding", func() { ServerTlsCert: ordererCertificate, ClientTlsCert: ordererCertificate, Host: "127.0.0.1", - Port: uint32(network.OrdererPort(o3, nwo.ListenPort)), + Port: uint32(network.OrdererPort(o3, nwo.ClusterPort)), }) By("Waiting for orderer3 to join the channel") @@ -816,7 +816,7 @@ var _ = Describe("EndToEnd reconfiguration and onboarding", func() { ServerTlsCert: certificatesOfOrderers[0].oldCert, ClientTlsCert: certificatesOfOrderers[0].oldCert, Host: "127.0.0.1", - Port: uint32(network.OrdererPort(orderers[0], nwo.ListenPort)), + Port: uint32(network.OrdererPort(orderers[0], nwo.ClusterPort)), }) By("Ensuring the re-added orderer joins the Raft cluster") @@ -915,7 +915,7 @@ var _ = Describe("EndToEnd reconfiguration and onboarding", func() { ServerTlsCert: ordererCertificate, ClientTlsCert: ordererCertificate, Host: "127.0.0.1", - Port: uint32(network.OrdererPort(orderers[i], nwo.ListenPort)), + Port: uint32(network.OrdererPort(orderers[i], nwo.ClusterPort)), }) blockSeq++ diff --git a/integration/e2e/migration_test.go b/integration/e2e/migration_test.go index fe6af364eab..ab67b048b55 100644 --- a/integration/e2e/migration_test.go +++ b/integration/e2e/migration_test.go @@ -1043,7 +1043,7 @@ func prepareRaftMetadata(network *nwo.Network) []byte { fullTlsPath := network.OrdererLocalTLSDir(o) certBytes, err := ioutil.ReadFile(filepath.Join(fullTlsPath, "server.crt")) Expect(err).NotTo(HaveOccurred()) - port := network.OrdererPort(o, nwo.ListenPort) + port := network.OrdererPort(o, nwo.ClusterPort) consenter := &protosraft.Consenter{ ClientTlsCert: certBytes, diff --git a/integration/nwo/configtx_template.go b/integration/nwo/configtx_template.go index 906e4e54941..84adab0759a 100644 --- a/integration/nwo/configtx_template.go +++ b/integration/nwo/configtx_template.go @@ -89,7 +89,7 @@ Profiles:{{ range .Profiles }} SnapshotIntervalSize: 1 KB Consenters:{{ range .Orderers }}{{ with $w.Orderer . }} - Host: 127.0.0.1 - Port: {{ $w.OrdererPort . "Listen" }} + Port: {{ $w.OrdererPort . "Cluster" }} ClientTLSCert: {{ $w.OrdererLocalCryptoDir . "tls" }}/server.crt ServerTLSCert: {{ $w.OrdererLocalCryptoDir . "tls" }}/server.crt {{- end }}{{- end }} diff --git a/integration/nwo/core_template.go b/integration/nwo/core_template.go index d59e22b307b..f964b85991e 100644 --- a/integration/nwo/core_template.go +++ b/integration/nwo/core_template.go @@ -103,6 +103,7 @@ peer: enabled: false listenAddress: 127.0.0.1:{{ .PeerPort Peer "ProfilePort" }} adminService: + listenAddress: 127.0.0.1:{{ .PeerPort Peer "AdminServicePort" }} handlers: authFilters: - name: DefaultAuth diff --git a/integration/nwo/network.go b/integration/nwo/network.go index 628414e2675..392c9c645ae 100644 --- a/integration/nwo/network.go +++ b/integration/nwo/network.go @@ -1277,23 +1277,25 @@ type PortName string type Ports map[PortName]uint16 const ( - ChaincodePort PortName = "Chaincode" - EventsPort PortName = "Events" - HostPort PortName = "HostPort" - ListenPort PortName = "Listen" - ProfilePort PortName = "Profile" - OperationsPort PortName = "Operations" + ChaincodePort PortName = "Chaincode" + EventsPort PortName = "Events" + HostPort PortName = "HostPort" + ListenPort PortName = "Listen" + ProfilePort PortName = "Profile" + OperationsPort PortName = "Operations" + AdminServicePort PortName = "AdminService" + ClusterPort PortName = "Cluster" ) // PeerPortNames returns the list of ports that need to be reserved for a Peer. func PeerPortNames() []PortName { - return []PortName{ListenPort, ChaincodePort, EventsPort, ProfilePort, OperationsPort} + return []PortName{ListenPort, ChaincodePort, EventsPort, ProfilePort, OperationsPort, AdminServicePort} } // OrdererPortNames returns the list of ports that need to be reserved for an // Orderer. func OrdererPortNames() []PortName { - return []PortName{ListenPort, ProfilePort, OperationsPort} + return []PortName{ListenPort, ProfilePort, OperationsPort, ClusterPort} } // BrokerPortNames returns the list of ports that need to be reserved for a diff --git a/integration/nwo/orderer_template.go b/integration/nwo/orderer_template.go index d0ca2a41589..a54dd710733 100644 --- a/integration/nwo/orderer_template.go +++ b/integration/nwo/orderer_template.go @@ -23,11 +23,15 @@ General: Cluster: ClientCertificate: {{ $w.OrdererLocalTLSDir Orderer }}/server.crt ClientPrivateKey: {{ $w.OrdererLocalTLSDir Orderer }}/server.key + ServerCertificate: {{ $w.OrdererLocalTLSDir Orderer }}/server.crt + ServerPrivateKey: {{ $w.OrdererLocalTLSDir Orderer }}/server.key DialTimeout: 5s RPCTimeout: 7s ReplicationBufferSize: 20971520 ReplicationPullTimeout: 5s ReplicationRetryTimeout: 5s + ListenAddress: 127.0.0.1 + ListenPort: {{ .OrdererPort Orderer "Cluster" }} Keepalive: ServerMinInterval: 60s ServerInterval: 7200s