Documentation ¶
Overview ¶
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
- Variables
- type Authority
- type SignerFn
- type Tai
- func (t *Tai) APIs(chain consensus.ChainReader) []rpc.API
- func (t *Tai) Author(header *types.Header) (common.Address, error)
- func (t *Tai) Authorize(signer common.Address, signFn SignerFn)
- func (t *Tai) CalcDifficulty(chain consensus.ChainReader, time uint64, parent *types.Header) *big.Int
- func (t *Tai) Finalize(chain consensus.ChainReader, header *types.Header, state *state.StateDB, ...) (*types.Block, error)
- func (t *Tai) Prepare(chain consensus.ChainReader, header *types.Header) error
- func (t *Tai) Seal(chain consensus.ChainReader, block *types.Block, stop <-chan struct{}) (*types.Block, error)
- func (t *Tai) VerifyHeader(chain consensus.ChainReader, header *types.Header, seal bool) error
- func (t *Tai) VerifyHeaders(chain consensus.ChainReader, headers []*types.Header, seals []bool) (chan<- struct{}, <-chan error)
- func (t *Tai) VerifySeal(chain consensus.ChainReader, header *types.Header) error
- func (t *Tai) VerifyUncles(chain consensus.ChainReader, block *types.Block) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidTimestamp is returned if the timestamp of a block is lower than // the previous block's timestamp + the minimum block period. ErrInvalidTimestamp = errors.New("invalid timestamp") )
Functions ¶
This section is empty.
Types ¶
type Tai ¶
type Tai struct {
// contains filtered or unexported fields
}
func (*Tai) APIs ¶
func (t *Tai) APIs(chain consensus.ChainReader) []rpc.API
APIs implements consensus.Engine, returning the user facing RPC API to allow controlling the signer voting.
func (*Tai) Authorize ¶
Authorize injects a private key into the consensus engine to mint new blocks with.
func (*Tai) CalcDifficulty ¶
func (t *Tai) CalcDifficulty(chain consensus.ChainReader, time uint64, parent *types.Header) *big.Int
CalcDifficulty is the difficulty adjustment algorithm. It returns the difficulty that a new block should have based on the previous blocks in the chain and the current signer.
func (*Tai) Finalize ¶
func (t *Tai) Finalize(chain consensus.ChainReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header, receipts []*types.Receipt) (*types.Block, error)
Finalize implements consensus.Engine, ensuring no uncles are set, nor block rewards given, and returns the final block.
func (*Tai) Prepare ¶
Prepare implements consensus.Engine, preparing all the consensus fields of the header for running the transactions on top.
func (*Tai) Seal ¶
func (t *Tai) Seal(chain consensus.ChainReader, block *types.Block, stop <-chan struct{}) (*types.Block, error)
Seal implements consensus.Engine, attempting to create a sealed block using the local signing credentials.
func (*Tai) VerifyHeader ¶
func (*Tai) VerifyHeaders ¶
func (*Tai) VerifySeal ¶
VerifySeal implements consensus.Engine, checking whether the signature contained in the header satisfies the consensus protocol requirements.
func (*Tai) VerifyUncles ¶
VerifyUncles implements consensus.Engine, always returning an error for any uncles as this consensus mechanism doesn't permit uncles.