prysm-pulse/sharding/notary/notary_client.go
Raul Jordan b6ec6d8b23 sharding: update comments across packages for punctuation
Former-commit-id: ab617ef43f369476a4ca863e9ab6f732cec9ed7e [formerly 221795c5c6f43cf0550cdf9ba37345e09e91f47d]
Former-commit-id: 6462269b88180c6f09dc3c633e4104c3cf8efb4d
2018-05-02 20:16:07 -05:00

41 lines
747 B
Go

package notary
import (
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/sharding/client"
cli "gopkg.in/urfave/cli.v1"
)
// Notary runnable client.
type Notary interface {
// Start the main routine for a notary.
Start() error
}
type notary struct {
client client.Client
}
// NewNotary creates a new notary instance.
func NewNotary(ctx *cli.Context) Notary {
return &notary{
client: client.NewClient(ctx),
}
}
// Start the main routine for a notary.
func (c *notary) Start() error {
log.Info("Starting notary client")
err := c.client.Start()
if err != nil {
return err
}
defer c.client.Close()
if err := joinNotaryPool(c.client); err != nil {
return err
}
return subscribeBlockHeaders(c.client)
}