wire up new block service

pull/375/head
Minh Doan 6 years ago committed by Minh Doan
parent 3f25de399a
commit b3a9c744be
  1. 4
      cmd/harmony.go
  2. 3
      node/node.go

@ -211,10 +211,6 @@ func main() {
if consensus.IsLeader {
currentNode.State = node.NodeLeader
// Node waiting for consensus readiness to create new block
go func() {
currentNode.WaitForConsensusReady(consensus.ReadySignal)
}()
} else {
go currentNode.JoinShard(leader)
}

@ -27,6 +27,7 @@ import (
service_manager "github.com/harmony-one/harmony/api/service"
consensus_service "github.com/harmony-one/harmony/api/service/consensus"
"github.com/harmony-one/harmony/api/service/explorer"
newblock "github.com/harmony-one/harmony/api/service/newblock"
"github.com/harmony-one/harmony/api/service/syncing"
"github.com/harmony-one/harmony/api/service/syncing/downloader"
downloader_pb "github.com/harmony-one/harmony/api/service/syncing/downloader/proto"
@ -639,6 +640,8 @@ func (node *Node) setupForShardLeader() {
node.serviceManager.RegisterService(service_manager.SupportExplorer, explorer.New(&node.SelfPeer))
// Register consensus service.
node.serviceManager.RegisterService(service_manager.Consensus, consensus_service.NewService(node.BlockChannel, node.Consensus))
// Register new block service.
node.serviceManager.RegisterService(service_manager.NewBlock, newblock.NewService(node.Consensus.ReadySignal, node.WaitForConsensusReady))
}
func (node *Node) setupForShardValidator() {

Loading…
Cancel
Save