prysm-pulse/sharding/observer/service.go
Raul Jordan 404a1ddad0 sharding: address review comments, add observer package
Former-commit-id: 05b8804e0ba81e1fe22f7d930dc16f9e84e1c44c [formerly 52dd670a71f1abdfeb5dfd42c25b9f3ba9e64224]
Former-commit-id: 78bd95882d71a1cd28f442dac17fe8c1bbc34ccb
2018-05-22 12:42:49 -04:00

34 lines
929 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/node"
cli "gopkg.in/urfave/cli.v1"
)
// 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 node.Node
}
// NewObserver creates a new observer instance.
func NewObserver(ctx *cli.Context, node node.Node) (*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
}