mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-06 01:32:18 +00:00
b6ec6d8b23
Former-commit-id: ab617ef43f369476a4ca863e9ab6f732cec9ed7e [formerly 221795c5c6f43cf0550cdf9ba37345e09e91f47d] Former-commit-id: 6462269b88180c6f09dc3c633e4104c3cf8efb4d
39 lines
738 B
Go
39 lines
738 B
Go
package proposer
|
|
|
|
import (
|
|
"github.com/ethereum/go-ethereum/log"
|
|
"github.com/ethereum/go-ethereum/sharding/client"
|
|
cli "gopkg.in/urfave/cli.v1"
|
|
)
|
|
|
|
// Proposer holds functionality required to run a collation proposer
|
|
// in a sharded system.
|
|
type Proposer interface {
|
|
Start() error
|
|
}
|
|
|
|
type proposer struct {
|
|
client client.Client
|
|
}
|
|
|
|
// NewProposer creates a struct instance.
|
|
func NewProposer(ctx *cli.Context) Proposer {
|
|
return &proposer{
|
|
client: client.NewClient(ctx),
|
|
}
|
|
}
|
|
|
|
// Start the main entry point for proposing collations.
|
|
func (p *proposer) Start() error {
|
|
log.Info("Starting proposer client")
|
|
err := p.client.Start()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
defer p.client.Close()
|
|
|
|
// TODO: Propose collations.
|
|
|
|
return nil
|
|
}
|