change service interface for services

pull/366/head
Minh Doan 6 years ago committed by Minh Doan
parent 38f6a1c427
commit 40a9a94244
  1. 8
      api/services/explorer/service.go
  2. 8
      node/service/support_client.go
  3. 4
      node/service_test.go

@ -38,15 +38,15 @@ func New(selfPeer *p2p.Peer) *Service {
}
}
// Start starts explorer service.
func (s *Service) Start() {
// StartService starts explorer service.
func (s *Service) StartService() {
utils.GetLogInstance().Info("Starting explorer service.")
s.Init(true)
s.server = s.Run()
}
// Stop shutdowns explorer service.
func (s *Service) Stop() {
// StopService shutdowns explorer service.
func (s *Service) StopService() {
utils.GetLogInstance().Info("Shutting down explorer service.")
if err := s.server.Shutdown(context.Background()); err != nil {
utils.GetLogInstance().Error("Error when shutting down explorer server", "error", err)

@ -28,12 +28,12 @@ func NewSupportClient(stateReader func() (*state.DB, error), callFaucetContract
return &SupportClient{server: clientService.NewServer(stateReader, callFaucetContract), ip: ip, port: strconv.Itoa(port + ClientServicePortDiff)}
}
// Start ...
func (sc *SupportClient) Start() {
// StartService ...
func (sc *SupportClient) StartService() {
sc.grpcServer, _ = sc.server.Start(sc.ip, sc.port)
}
// Stop ...
func (sc *SupportClient) Stop() {
// StopService ...
func (sc *SupportClient) StopService() {
sc.grpcServer.Stop()
}

@ -8,11 +8,11 @@ import (
type SupportSyncingTest struct{}
func (s *SupportSyncingTest) Start() {
func (s *SupportSyncingTest) StartService() {
fmt.Println("SupportSyncingTest starting")
}
func (s *SupportSyncingTest) Stop() {
func (s *SupportSyncingTest) StopService() {
fmt.Println("SupportSyncingTest stopping")
}

Loading…
Cancel
Save