mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-08 10:41:19 +00:00
dd384d3a22
Former-commit-id: b2defb3e277217d0d5bef86f1d4078668791d251 [formerly 6a6bd5c309442805ccac942325e0feef69dd17ab] Former-commit-id: 2a26568478ed072db7c8e299eb40644b1c7c10d2
33 lines
904 B
Go
33 lines
904 B
Go
// Package observer launches a service attached to the sharding node
|
|
// that simply observes activity across the sharded Ethereum network.
|
|
package observer
|
|
|
|
import (
|
|
"github.com/ethereum/go-ethereum/log"
|
|
"github.com/ethereum/go-ethereum/sharding"
|
|
)
|
|
|
|
// Observer holds functionality required to run an observer service
|
|
// in a sharded system. Must satisfy the Service interface defined in
|
|
// sharding/service.go.
|
|
type Observer struct {
|
|
node sharding.ShardingClient
|
|
}
|
|
|
|
// NewObserver creates a new observer instance.
|
|
func NewObserver(node sharding.ShardingClient) (*Observer, error) {
|
|
return &Observer{node}, nil
|
|
}
|
|
|
|
// Start the main routine for an observer.
|
|
func (o *Observer) Start() error {
|
|
log.Info("Starting shard observer service")
|
|
return nil
|
|
}
|
|
|
|
// Stop the main loop for observing the shard network.
|
|
func (o *Observer) Stop() error {
|
|
log.Info("Stopping shard observer service")
|
|
return nil
|
|
}
|