Merge pull request #1514 from LeoHChen/cleanup_explorer_node_setup

[cleanup] remove discovery service on explorer node
pull/1519/head
Leo Chen 5 years ago committed by GitHub
commit 9b4074b425
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      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() {
@ -65,17 +64,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.

Loading…
Cancel
Save