prysm-pulse/sharding/proposer/service.go
Raul Jordan 3861c0cf06 sharding: ensure godoc for every package
Former-commit-id: 0ecc597de035e61ca219f4f30695cb8db59c129b [formerly da9312c1c9d69010083f94f387fe6a52aa817683]
Former-commit-id: 8c8c218e16ef248ae8954168cf7bf5aa6ed6839d
2018-06-05 17:28:57 -04:00

39 lines
1.2 KiB
Go

// Package notary defines all relevant functionality for a Proposer actor
// within the minimal sharding protocol.
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
}