prysm-pulse/sharding/notary/service.go
Raul Jordan 49dc0dc4a5 sharding: fixed main entry point, linter errors
Former-commit-id: 705e95b849818683ab610b80f101278e6241b4d6 [formerly 925da4e8a6ef6d8e9d82ba9073666c2a26cd6c77]
Former-commit-id: a43a26be717cb63a0a8c03165e865d875ca11ed4
2018-05-22 07:47:35 -05:00

41 lines
932 B
Go

package notary
import (
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/sharding/node"
cli "gopkg.in/urfave/cli.v1"
)
// Notary holds functionality required to run a collation notary
// in a sharded system. Must satisfy the Service interface defined in
// sharding/service.go.
type Notary struct {
node node.Node
}
// NewNotary creates a new notary instance.
func NewNotary(ctx *cli.Context, node node.Node) (*Notary, error) {
return &Notary{node}, nil
}
// Start the main routine for a notary.
func (n *Notary) Start() error {
log.Info("Starting notary service")
// if n.node.DepositFlagSet() {
// if err := joinNotaryPool(n.node); err != nil {
// return err
// }
// }
// return subscribeBlockHeaders(n.node)
return nil
}
// Stop the main loop for notarizing collations.
func (n *Notary) Stop() error {
log.Info("Stopping notary service")
// TODO: Propose collations.
return nil
}