consensus

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2018 License: LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsProducerAddressValid

func IsProducerAddressValid(producer string) bool

Types

type Dpos

type Dpos struct {
	// contains filtered or unexported fields
}

func NewDpos

func NewDpos() *Dpos

func (*Dpos) GetDynasty

func (dpos *Dpos) GetDynasty() *Dynasty

func (*Dpos) SetDynasty

func (dpos *Dpos) SetDynasty(dynasty *Dynasty)

func (*Dpos) SetTargetBit

func (dpos *Dpos) SetTargetBit(bit int)

func (*Dpos) Setup

func (dpos *Dpos) Setup(node core.NetService, cbAddr string)

func (*Dpos) Start

func (dpos *Dpos) Start()

func (*Dpos) StartNewBlockMinting

func (dpos *Dpos) StartNewBlockMinting()

func (*Dpos) Stop

func (dpos *Dpos) Stop()

func (*Dpos) Validate

func (dpos *Dpos) Validate(block *core.Block) bool

type Dynasty

type Dynasty struct {
	// contains filtered or unexported fields
}

func NewDynasty

func NewDynasty() *Dynasty

func NewDynastyWithProducers

func NewDynastyWithProducers(producers []string) *Dynasty

func (*Dynasty) AddMultipleProducers

func (dynasty *Dynasty) AddMultipleProducers(producers []string)

func (*Dynasty) AddProducer

func (dynasty *Dynasty) AddProducer(producer string)

func (*Dynasty) GetProducerIndex

func (dynasty *Dynasty) GetProducerIndex(producer string) int

find the index of the producer. If not found, return -1

func (*Dynasty) IsMyTurn

func (dynasty *Dynasty) IsMyTurn(producer string, now int64) bool

func (*Dynasty) ProducerAtATime

func (dynasty *Dynasty) ProducerAtATime(time int64) string

func (*Dynasty) SetMaxProducers

func (dynasty *Dynasty) SetMaxProducers(maxProducers int)

func (*Dynasty) SetTimeBetweenBlk

func (dynasty *Dynasty) SetTimeBetweenBlk(timeBetweenBlk int)

func (*Dynasty) ValidateProducer

func (dynasty *Dynasty) ValidateProducer(block *core.Block) bool

type MinedBlock

type MinedBlock struct {
	// contains filtered or unexported fields
}

type Miner

type Miner struct {
	// contains filtered or unexported fields
}

func NewMiner

func NewMiner() *Miner

func (*Miner) SetTargetBit

func (miner *Miner) SetTargetBit(bit int)

func (*Miner) Setup

func (miner *Miner) Setup(bc *core.Blockchain, cbAddr string, retChan chan (*MinedBlock))

func (*Miner) Start

func (miner *Miner) Start()

func (*Miner) Stop

func (miner *Miner) Stop()

func (*Miner) Validate

func (miner *Miner) Validate(blk *core.Block) bool

type ProofOfWork

type ProofOfWork struct {
	// contains filtered or unexported fields
}

func NewProofOfWork

func NewProofOfWork() *ProofOfWork

func (*ProofOfWork) SetTargetBit

func (pow *ProofOfWork) SetTargetBit(bit int)

func (*ProofOfWork) Setup

func (pow *ProofOfWork) Setup(node core.NetService, cbAddr string)

func (*ProofOfWork) Start

func (pow *ProofOfWork) Start()

func (*ProofOfWork) StartNewBlockMinting

func (pow *ProofOfWork) StartNewBlockMinting()

func (*ProofOfWork) Stop

func (pow *ProofOfWork) Stop()

func (*ProofOfWork) Validate

func (pow *ProofOfWork) Validate(blk *core.Block) bool

type State

type State int

Jump to

Keyboard shortcuts

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