2019-08-16 17:13:04 +00:00
|
|
|
package sync
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2019-08-16 20:03:11 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/db"
|
2019-08-18 15:33:58 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/operations"
|
2019-08-16 17:13:04 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/p2p"
|
|
|
|
"github.com/prysmaticlabs/prysm/shared"
|
|
|
|
)
|
|
|
|
|
|
|
|
var _ = shared.Service(&RegularSync{})
|
|
|
|
|
|
|
|
// RegularSync service is responsible for handling all run time p2p related operations as the
|
|
|
|
// main entry point for network messages.
|
|
|
|
type RegularSync struct {
|
2019-08-18 15:33:58 +00:00
|
|
|
ctx context.Context
|
|
|
|
p2p p2p.P2P
|
|
|
|
db db.Database
|
|
|
|
operations operations.Service
|
2019-08-16 17:13:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Start the regular sync service by initializing all of the p2p sync handlers.
|
|
|
|
func (r *RegularSync) Start() {
|
|
|
|
r.registerRPCHandlers()
|
|
|
|
r.registerSubscribers()
|
|
|
|
}
|
|
|
|
|
|
|
|
// Stop the regular sync service.
|
|
|
|
func (r *RegularSync) Stop() error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// Status of the currently running regular sync service.
|
|
|
|
func (r *RegularSync) Status() error {
|
|
|
|
return nil
|
|
|
|
}
|