proposer

package
v0.0.0-...-dde17ac Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2018 License: GPL-3.0 Imports: 17 Imported by: 0

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.

func (*Proposer) Start

func (p *Proposer) Start()

Start the main loop for proposing collations.

func (*Proposer) Stop

func (p *Proposer) Stop() error

Stop the main loop for proposing collations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL