mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-04 00:44:27 +00:00
9d584d334d
Former-commit-id: 3714c5c46fdeafeaf1c0d64f70989fdd0913fce6 [formerly 1f9ff85f10520e409e787c6be644682ea8b4bb93] Former-commit-id: 21214d113530fe5ef67961358a291f7a5ca974b8
37 lines
1.0 KiB
Go
37 lines
1.0 KiB
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 {
|
|
client sharding.SMCClient
|
|
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(client sharding.SMCClient, shardp2p sharding.ShardP2P, txpool sharding.TXPool) (*Proposer, error) {
|
|
// Initializes a directory persistent db.
|
|
return &Proposer{client, 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
|
|
}
|