prysm-pulse/sharding/proposer/service.go
Raul Jordan 581883bd9b sharding: fixed import cycle
Former-commit-id: 7aa2c458e37fe4fd5b340d2da0bbc7fa44778258 [formerly e71c11cd82b059dfb0d589e42fdba763cf9cadf1]
Former-commit-id: d02e7567fb5bd8c08fed0e9735f08dab95544b2b
2018-06-05 19:03:15 -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. 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 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
}