From 70b0a6258d33df19042a6edbeb2129321a0b1cb7 Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Tue, 5 Nov 2019 10:52:42 -0800 Subject: [PATCH 1/3] [node.sh] updated version Signed-off-by: Leo Chen --- scripts/node.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/node.sh b/scripts/node.sh index b162d24ed..cb6b4e668 100755 --- a/scripts/node.sh +++ b/scripts/node.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -version="v1 20190924.0" +version="v1 20191105.1" unset -v progname progname="${0##*/}" From feceec6e38a6c2ad4993194db3c12f43bb439ec5 Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Wed, 6 Nov 2019 01:01:25 +0000 Subject: [PATCH 2/3] [net] only listen to tcp4 address Signed-off-by: Leo Chen --- api/client/service/server.go | 2 +- api/proto/message/server.go | 2 +- api/service/syncing/downloader/server.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/client/service/server.go b/api/client/service/server.go index 1e554eb31..c6cea57b2 100644 --- a/api/client/service/server.go +++ b/api/client/service/server.go @@ -43,7 +43,7 @@ func (s *Server) GetFreeToken(ctx context.Context, request *proto.GetFreeTokenRe func (s *Server) Start(ip, port string) (*grpc.Server, error) { // TODO(minhdoan): Currently not using ip. Fix it later. addr := net.JoinHostPort("", port) - lis, err := net.Listen("tcp", addr) + lis, err := net.Listen("tcp4", addr) if err != nil { log.Fatalf("failed to listen: %v", err) } diff --git a/api/proto/message/server.go b/api/proto/message/server.go index 20b90d5db..da0f51174 100644 --- a/api/proto/message/server.go +++ b/api/proto/message/server.go @@ -81,7 +81,7 @@ func (s *Server) Process(ctx context.Context, message *Message) (*Response, erro // Start starts the Server on given ip and port. func (s *Server) Start() (*grpc.Server, error) { addr := net.JoinHostPort(IP, Port) - lis, err := net.Listen("tcp", addr) + lis, err := net.Listen("tcp4", addr) if err != nil { log.Fatalf("failed to listen: %v", err) } diff --git a/api/service/syncing/downloader/server.go b/api/service/syncing/downloader/server.go index d1953aa8f..ea82c19b9 100644 --- a/api/service/syncing/downloader/server.go +++ b/api/service/syncing/downloader/server.go @@ -43,7 +43,7 @@ func (s *Server) Query(ctx context.Context, request *pb.DownloaderRequest) (*pb. // Start starts the Server on given ip and port. func (s *Server) Start(ip, port string) (*grpc.Server, error) { addr := net.JoinHostPort("", port) - lis, err := net.Listen("tcp", addr) + lis, err := net.Listen("tcp4", addr) if err != nil { log.Fatalf("[SYNC] failed to listen: %v", err) } From 64ed37a1d6263630b2db1eb4798693cb795032ea Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Wed, 6 Nov 2019 01:37:52 +0000 Subject: [PATCH 3/3] [node] disable client support service on mainnet Signed-off-by: Leo Chen --- node/service_setup.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/node/service_setup.go b/node/service_setup.go index 8d4212d93..1818481df 100644 --- a/node/service_setup.go +++ b/node/service_setup.go @@ -27,8 +27,11 @@ func (node *Node) setupForValidator() { node.serviceManager.RegisterService(service.Consensus, consensus.New(node.BlockChannel, node.Consensus, node.startConsensus)) // Register new block service. node.serviceManager.RegisterService(service.BlockProposal, blockproposal.New(node.Consensus.ReadySignal, node.WaitForConsensusReadyV2)) - // Register client support service. - node.serviceManager.RegisterService(service.ClientSupport, clientsupport.New(node.Blockchain().State, node.CallFaucetContract, node.SelfPeer.IP, node.SelfPeer.Port)) + + if node.NodeConfig.GetNetworkType() != nodeconfig.Mainnet { + // Register client support service. + node.serviceManager.RegisterService(service.ClientSupport, clientsupport.New(node.Blockchain().State, node.CallFaucetContract, node.SelfPeer.IP, node.SelfPeer.Port)) + } // Register new metrics service if node.NodeConfig.GetMetricsFlag() { node.serviceManager.RegisterService(service.Metrics, metrics.New(&node.SelfPeer, node.NodeConfig.ConsensusPubKey.SerializeToHexStr(), node.NodeConfig.GetPushgatewayIP(), node.NodeConfig.GetPushgatewayPort()))