From 6fb5625449a7a2ad180679f8d4ce6ce405664c2d Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Wed, 4 Sep 2019 20:30:25 -0700 Subject: [PATCH] [cleanup] remove discovery service on explorer node Signed-off-by: Leo Chen --- node/service_setup.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/node/service_setup.go b/node/service_setup.go index 560e03f55..5203e6755 100644 --- a/node/service_setup.go +++ b/node/service_setup.go @@ -56,7 +56,6 @@ func (node *Node) setupForNewNode() { if node.NodeConfig.GetMetricsFlag() { node.serviceManager.RegisterService(service.Metrics, metrics.New(&node.SelfPeer, node.NodeConfig.ConsensusPubKey.SerializeToHexStr(), node.NodeConfig.GetPushgatewayIP(), node.NodeConfig.GetPushgatewayPort())) } - // TODO: how to restart networkinfo and discovery service after receiving shard id info from beacon chain? } func (node *Node) setupForClientNode() { @@ -73,17 +72,10 @@ func (node *Node) setupForClientNode() { } func (node *Node) setupForExplorerNode() { - // TODO determine the role of new node, currently assume it is beacon node - nodeConfig, chanPeer := node.initNodeConfiguration() - - // Register peer discovery service. "0" is the beacon shard ID - node.serviceManager.RegisterService(service.PeerDiscovery, discovery.New(node.host, nodeConfig, chanPeer, nil)) // Register networkinfo service. "0" is the beacon shard ID - node.serviceManager.RegisterService(service.NetworkInfo, networkinfo.New(node.host, node.NodeConfig.GetShardGroupID(), chanPeer, nil)) + node.serviceManager.RegisterService(service.NetworkInfo, networkinfo.New(node.host, node.NodeConfig.GetShardGroupID(), nil, nil)) // Register explorer service. node.serviceManager.RegisterService(service.SupportExplorer, explorer.New(&node.SelfPeer, node.NodeConfig.GetShardID(), node.Consensus.GetNodeIDs, node.GetBalanceOfAddress)) - - // TODO: how to restart networkinfo and discovery service after receiving shard id info from beacon chain? } // ServiceManagerSetup setups service store.