mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-04 00:44:27 +00:00
2163001a05
Former-commit-id: df6bf42ddbd5880982c46a6f64231e1f7473e879 [formerly 1a1fb36d9bc05a67ddb652d3228614df612c00bb] Former-commit-id: 0fe3ffb9fb2947015bcac53a75a440866884b3b5
35 lines
932 B
Go
35 lines
932 B
Go
package proposer
|
|
|
|
import (
|
|
"github.com/ethereum/go-ethereum/log"
|
|
"github.com/ethereum/go-ethereum/sharding/node"
|
|
cli "gopkg.in/urfave/cli.v1"
|
|
)
|
|
|
|
// Proposer holds functionality required to run a collation proposer
|
|
// in a sharded system. Must satisfy the Service interface defined in
|
|
// sharding/service.go.
|
|
type Proposer struct {
|
|
node node.Node
|
|
}
|
|
|
|
// NewProposer creates a struct instance. It is initialized and
|
|
// registered as a service upon start of a sharding node.
|
|
// Has access to the public methods of this node.
|
|
func NewProposer(ctx *cli.Context, node node.Node) (*Proposer, error) {
|
|
return &Proposer{node}, nil
|
|
}
|
|
|
|
// Start the main loop for proposing collations.
|
|
func (p *Proposer) Start() error {
|
|
log.Info("Starting proposer service")
|
|
// TODO: Propose collations.
|
|
return nil
|
|
}
|
|
|
|
// Stop the main loop for proposing collations.
|
|
func (p *Proposer) Stop() error {
|
|
log.Info("Stopping proposer service")
|
|
return nil
|
|
}
|