Documentation ¶
Overview ¶
Package proposer defines all relevant functionality for a Proposer actor within the minimal sharding protocol.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddHeader ¶
func AddHeader(client mainchain.FullClient, transactor mainchain.ContractTransactor, collation *types.Collation) error
AddHeader adds the collation header to the main chain by sending an addHeader transaction to the sharding manager contract. There can only exist one header per period per shard, it is the proposer's responsibility to check if a header has been added.
Types ¶
type Proposer ¶
type Proposer struct {
// contains filtered or unexported fields
}
Proposer holds functionality required to run a collation proposer in a sharded system. Must satisfy the Service interface defined in sharding/service.go.
func NewProposer ¶
func NewProposer(config *params.Config, client mainchain.FullClient, p2p *p2p.Server, txpool *txpool.TXPool, dbService *database.ShardDB, shardID int, sync *syncer.Syncer) (*Proposer, error)
NewProposer creates a struct instance of a proposer service. It will have access to a mainchain client, a p2p network, and a shard transaction pool.