mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-08 10:41:19 +00:00
3bd52dc116
Former-commit-id: 79d9091f883f99d819cb73a862e4925cea309931 [formerly 0307849b5b99bd4d08fbd4a9986b729640bf2319] Former-commit-id: f950a1554d82d54ce981ce22c4e5639093428c56
34 lines
1003 B
Go
34 lines
1003 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/ethdb"
|
|
"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
|
|
shardChainDb ethdb.Database
|
|
}
|
|
|
|
// NewObserver creates a new observer instance.
|
|
func NewObserver(shardp2p sharding.ShardP2P, shardChainDb ethdb.Database) (*Observer, error) {
|
|
return &Observer{shardp2p, shardChainDb}, nil
|
|
}
|
|
|
|
// Start the main routine for an observer.
|
|
func (o *Observer) Start() {
|
|
log.Info("Starting shard observer service")
|
|
}
|
|
|
|
// Stop the main loop for observing the shard network.
|
|
func (o *Observer) Stop() error {
|
|
log.Info("Stopping shard observer service")
|
|
return nil
|
|
}
|