mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-04 00:44:27 +00:00
fc40d603c0
Former-commit-id: e95f66b509da5b24054415c15642fd952728a193 [formerly 1f8c4e6ad036cddb162a5588696d44d648f7d5eb] Former-commit-id: 2897e7c38f227a4f8cd0456cb6fc904ecddeb71f
36 lines
1009 B
Go
36 lines
1009 B
Go
package proposer
|
|
|
|
import (
|
|
"github.com/ethereum/go-ethereum/log"
|
|
"github.com/ethereum/go-ethereum/sharding"
|
|
)
|
|
|
|
// 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 {
|
|
shardp2p sharding.ShardP2P
|
|
txpool sharding.TXPool
|
|
}
|
|
|
|
// 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(shardp2p sharding.ShardP2P, txpool sharding.TXPool) (*Proposer, error) {
|
|
// Initializes a directory persistent db.
|
|
return &Proposer{shardp2p, txpool}, 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
|
|
}
|