prysm-pulse/sharding/proposer/service.go
Raul Jordan 12d35d3e92 sharding: fixed runtime errors, addressed review comments
Former-commit-id: 941b7f13b58758d0290481b23fae292fee7d078d [formerly 020042b380b63527163c41a37a14022e61f844c8]
Former-commit-id: 183ed3603fc3fd0cbf964ae468acad4fa850f0fd
2018-06-05 22:03:58 -04:00

40 lines
1.2 KiB
Go

// Package proposer 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"
"github.com/ethereum/go-ethereum/sharding/mainchain"
)
// 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 mainchain.Client
shardp2p sharding.ShardP2P
txpool sharding.TXPool
}
// NewProposer creates a struct instance of a proposer service.
// It will have access to a mainchain client, a shardp2p network,
// and a shard transaction pool.
func NewProposer(client mainchain.Client, 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
}