mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-07 18:21:20 +00:00
72bd785a2e
Former-commit-id: 970a229ed8d1cce8c5383a40e313092828c1be69 [formerly 0f30c11d3352946caccc1d325a0551f43dc8439c] Former-commit-id: 6ca7badf14c01fabf6a63db26214b6a0179aa8f2
37 lines
652 B
Go
37 lines
652 B
Go
// Package proposer holds all of the functionality to run as a collation proposer in a sharded
|
|
// system.
|
|
package proposer
|
|
|
|
import (
|
|
"github.com/ethereum/go-ethereum/log"
|
|
"github.com/ethereum/go-ethereum/sharding/client"
|
|
cli "gopkg.in/urfave/cli.v1"
|
|
)
|
|
|
|
type Proposer interface {
|
|
Start() error
|
|
}
|
|
|
|
type proposer struct {
|
|
client client.Client
|
|
}
|
|
|
|
func NewProposer(ctx *cli.Context) Proposer {
|
|
return &proposer{
|
|
client: client.NewClient(ctx),
|
|
}
|
|
}
|
|
|
|
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
|
|
}
|