Documentation
¶
Index ¶
- func IsProducerAddressValid(producer string) bool
- type Dpos
- func (dpos *Dpos) GetDynasty() *Dynasty
- func (dpos *Dpos) SetDynasty(dynasty *Dynasty)
- func (dpos *Dpos) SetTargetBit(bit int)
- func (dpos *Dpos) Setup(node core.NetService, cbAddr string)
- func (dpos *Dpos) Start()
- func (dpos *Dpos) StartNewBlockMinting()
- func (dpos *Dpos) Stop()
- func (dpos *Dpos) Validate(block *core.Block) bool
- type Dynasty
- func (dynasty *Dynasty) AddMultipleProducers(producers []string)
- func (dynasty *Dynasty) AddProducer(producer string)
- func (dynasty *Dynasty) GetProducerIndex(producer string) int
- func (dynasty *Dynasty) IsMyTurn(producer string, now int64) bool
- func (dynasty *Dynasty) ProducerAtATime(time int64) string
- func (dynasty *Dynasty) SetMaxProducers(maxProducers int)
- func (dynasty *Dynasty) SetTimeBetweenBlk(timeBetweenBlk int)
- func (dynasty *Dynasty) ValidateProducer(block *core.Block) bool
- type MinedBlock
- type Miner
- type ProofOfWork
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsProducerAddressValid ¶
Types ¶
type Dpos ¶
type Dpos struct {
// contains filtered or unexported fields
}
func (*Dpos) GetDynasty ¶
func (*Dpos) SetDynasty ¶
func (*Dpos) SetTargetBit ¶
func (*Dpos) StartNewBlockMinting ¶
func (dpos *Dpos) StartNewBlockMinting()
type Dynasty ¶
type Dynasty struct {
// contains filtered or unexported fields
}
func NewDynasty ¶
func NewDynasty() *Dynasty
func NewDynastyWithProducers ¶
func (*Dynasty) AddMultipleProducers ¶
func (*Dynasty) AddProducer ¶
func (*Dynasty) GetProducerIndex ¶
find the index of the producer. If not found, return -1
func (*Dynasty) ProducerAtATime ¶
func (*Dynasty) SetMaxProducers ¶
func (*Dynasty) SetTimeBetweenBlk ¶
type MinedBlock ¶
type MinedBlock struct {
// contains filtered or unexported fields
}
type Miner ¶
type Miner struct {
// contains filtered or unexported fields
}
func (*Miner) SetTargetBit ¶
func (*Miner) Setup ¶
func (miner *Miner) Setup(bc *core.Blockchain, cbAddr string, retChan chan (*MinedBlock))
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()
Click to show internal directories.
Click to hide internal directories.