mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-08 10:41:19 +00:00
fc40d603c0
Former-commit-id: e95f66b509da5b24054415c15642fd952728a193 [formerly 1f8c4e6ad036cddb162a5588696d44d648f7d5eb] Former-commit-id: 2897e7c38f227a4f8cd0456cb6fc904ecddeb71f
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 {
|
|
shardp2p sharding.ShardP2P
|
|
}
|
|
|
|
// NewObserver creates a new observer instance.
|
|
func NewObserver(shardp2p sharding.ShardP2P) (*Observer, error) {
|
|
return &Observer{shardp2p}, 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
|
|
}
|