consensus

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DPoS

type DPoS struct {
	iservices.IConsensus

	ForkDB *forkdb.DB

	Producers []string
	Name      string

	sync.RWMutex
	// contains filtered or unexported fields
}

func NewDPoS

func NewDPoS(ctx *node.ServiceContext) *DPoS

func (*DPoS) ActiveProducers

func (d *DPoS) ActiveProducers() []string

func (*DPoS) CurrentProducer

func (d *DPoS) CurrentProducer() string

func (*DPoS) FetchBlock

func (d *DPoS) FetchBlock(id common.BlockID) (common.ISignedBlock, error)

func (*DPoS) FetchBlocksSince

func (d *DPoS) FetchBlocksSince(id common.BlockID) ([]common.ISignedBlock, error)

func (*DPoS) GetHeadBlockId

func (d *DPoS) GetHeadBlockId() common.BlockID

func (*DPoS) GetIDs

func (d *DPoS) GetIDs(start, end common.BlockID) ([]common.BlockID, error)

func (*DPoS) HasBlock

func (d *DPoS) HasBlock(id common.BlockID) bool

func (*DPoS) PushBlock

func (d *DPoS) PushBlock(b common.ISignedBlock)

func (*DPoS) PushTransaction

func (d *DPoS) PushTransaction(trx common.ISignedTransaction, wait bool, broadcast bool) common.ITransactionInvoice

func (*DPoS) SetBootstrap

func (d *DPoS) SetBootstrap(b bool)

func (*DPoS) Start

func (d *DPoS) Start(node *node.Node) error

func (*DPoS) Stop

func (d *DPoS) Stop() error

type IProducer

type IProducer interface {
	Produce() (common.ISignedBlock, error)
}

Jump to

Keyboard shortcuts

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