Documentation ¶
Index ¶
- Variables
- type API
- type Geec
- func (g *Geec) APIs(chain consensus.ChainReader) []rpc.API
- func (g *Geec) AskForAck(block *types.Block, version uint64, stop <-chan struct{}) (supporters []common.Address, err error)
- func (g *Geec) Author(header *types.Header) (common.Address, error)
- func (g *Geec) Bootstrap(chain consensus.ChainReader)
- func (g *Geec) CalcConfidence(chain consensus.ChainReader, block *types.Block) uint64
- func (g *Geec) CalcDifficulty(chain consensus.ChainReader, time uint64, parent *types.Header) *big.Int
- func (g *Geec) Finalize(chain consensus.ChainReader, header *types.Header, state *state.StateDB, ...) (*types.Block, error)
- func (g *Geec) GetConsensusIPPort() (string, string)
- func (g *Geec) GetEthBase() common.Address
- func (g *Geec) GetMiner() geecCore.ThwMiner
- func (g *Geec) GetNodeCfg() (cfg *node.Config)
- func (g *Geec) PostEvent(ev interface{}) error
- func (g *Geec) Prepare(chain consensus.ChainReader, header *types.Header) error
- func (g *Geec) Seal(chain consensus.ChainReader, block *types.Block, stop <-chan struct{}) (*types.Block, error)
- func (g *Geec) TxnService(port int)
- func (g *Geec) VerifyHeader(chain consensus.ChainReader, header *types.Header, seal bool) error
- func (g *Geec) VerifyHeaders(chain consensus.ChainReader, headers []*types.Header, seals []bool) (chan<- struct{}, <-chan error)
- func (g *Geec) VerifySeal(chain consensus.ChainReader, header *types.Header) error
- func (g *Geec) VerifyUncles(chain consensus.ChainReader, block *types.Block) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoCommittee = errors.New("not a committee member") ErrNoLeader = errors.New("not leader, cannot generate a block") )
Functions ¶
This section is empty.
Types ¶
type Geec ¶
type Geec struct { InitialAccounts []common.Address Mux *event.TypeMux Coinbase common.Address PendingGeecTxnLock sync.Mutex PendingGeecTxns []*types.Transaction InitChan chan interface{} Registered chan interface{} ConsensusIP string ConsensusPort string Breakdown bool // contains filtered or unexported fields }
func (*Geec) Bootstrap ¶
func (g *Geec) Bootstrap(chain consensus.ChainReader)
Bootstarp the initial state. Cannot be called in the New method because the state is not created yet.
func (*Geec) CalcConfidence ¶
A toy function to calculate the confidence of current block
func (*Geec) CalcDifficulty ¶
func (*Geec) Finalize ¶
func (g *Geec) Finalize(chain consensus.ChainReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header, receipts []*types.Receipt) (*types.Block, error)
ensuring no uncles are set. No
func (*Geec) GetConsensusIPPort ¶
func (*Geec) GetEthBase ¶
func (*Geec) GetNodeCfg ¶
func (*Geec) Seal ¶
func (g *Geec) Seal(chain consensus.ChainReader, block *types.Block, stop <-chan struct{}) (*types.Block, error)
Major function to achieve consensus.
func (*Geec) TxnService ¶
func (*Geec) VerifyHeader ¶
used to verify header downloaded from other peers.
func (*Geec) VerifyHeaders ¶
func (g *Geec) VerifyHeaders(chain consensus.ChainReader, headers []*types.Header, seals []bool) (chan<- struct{}, <-chan error)
VerifyHeaders is similar to VerifyHeader, but verifies a batch of headers concurrently. The method returns a quit channel to abort the operations and a results channel to retrieve the async verifications.
XS: its an async function.
func (*Geec) VerifySeal ¶
double check the seal of an outgoing message.
func (*Geec) VerifyUncles ¶
Click to show internal directories.
Click to hide internal directories.