mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-07 18:21:20 +00:00
701a33caec
Former-commit-id: 74b60e1bdacfa4889a4b7a36e22698e7bc8a6084 [formerly 6f5d01b919d58ebffa7d5c1d197d2236c2f906f7] Former-commit-id: 3ad090ec4170cc2bc901caae17f1eb4895af2c42
39 lines
734 B
Go
39 lines
734 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
|
|
}
|