Versions in this module Expand all Collapse all v1 v1.1.3 Feb 13, 2020 Changes in this version + const DATALENGTH + const DGSTSIZE + const HEADSIZE + const OFF_CYCLE_LEN + const OFF_SKIP_LEN + const OFF_STATR + const PMTSIZE + const SKIP_CYCLE_LEN + const STARTUPDATENUM + const TBLSIZE + const UPDATABLOCKLENGTH + var BaseBig = big.NewInt(1e18) + var Big1e6 = big.NewInt(1e6) + var ErrInvalidDumpMagic = errors.New("invalid dump magic") + var MiningConstant = 20 + var NetworkFragmentsNuber = 1 + var SnailBlockRewardsBase = 115555555555555 + var SnailBlockRewardsChangeInterval = 4500 + var SnailBlockRewardsChangePercentage = 2 + var SqrtArray = []float64 + var SqrtMax = 6400 + var SqrtMin = 25 + func CalcDifficulty(config *params.ChainConfig, time uint64, parents []*types.SnailHeader) *big.Int + func CalcFruitDifficulty(config *params.ChainConfig, time uint64, fastTime uint64, ...) *big.Int + func GetBlockReward(num *big.Int) (committee, minerBlock, minerFruit *big.Int, e error) + func GetParents(chain consensus.SnailChainReader, header *types.SnailHeader) []*types.SnailHeader + func LogPrint(info string, addr common.Address, amount *big.Int) + func MatMuliple(input []uint64, output []uint64, pmat []uint64) int + func NewDataset(epoch uint64) interface + func SeedHash(block uint64) []byte + func TruehashLight(dataset []uint64, hash []byte, nonce uint64) ([]byte, []byte) + type Config struct + CacheDir string + CachesInMem int + CachesOnDisk int + DatasetDir string + DatasetsInMem int + DatasetsOnDisk int + PowMode Mode + Tip9 uint64 + type ConstSqrt struct + Num int + Sqrt float64 + type Dataset struct + func (d *Dataset) Generate(epoch uint64, headershash *[STARTUPDATENUM][]byte) + func (d *Dataset) GetDataSet() []uint64 + func (d *Dataset) GetDataSetEpoch() uint64 + func (d *Dataset) GetDatasetSeedhash(dataset []uint64) string + func (d *Dataset) Hash() common.Hash + func (d *Dataset) UpdateTBL(offset [OFF_SKIP_LEN]int, skip [OFF_SKIP_LEN]int, plookupTbl []uint64) []uint64 + type Minerva struct + func New(config Config) *Minerva + func NewFakeDelayer(delay time.Duration) *Minerva + func NewFakeFailer(fail uint64) *Minerva + func NewFaker() *Minerva + func NewFullFaker() *Minerva + func NewShared() *Minerva + func NewTester() *Minerva + func (m *Minerva) APIs(chain consensus.ChainReader) []rpc.API + func (m *Minerva) Author(header *types.Header) (common.Address, error) + func (m *Minerva) AuthorSnail(header *types.SnailHeader) (common.Address, error) + func (m *Minerva) CalcFruitDifficulty(chain consensus.SnailChainReader, time uint64, fastTime uint64, ...) *big.Int + func (m *Minerva) CalcSnailDifficulty(chain consensus.SnailChainReader, time uint64, parents []*types.SnailHeader) *big.Int + func (m *Minerva) ConSeal(chain consensus.SnailChainReader, block *types.SnailBlock, ...) + func (m *Minerva) DataSetHash(epoch uint64) string + func (m *Minerva) Finalize(chain consensus.ChainReader, header *types.Header, state *state.StateDB, ...) (*types.Block, error) + func (m *Minerva) FinalizeCommittee(block *types.Block) error + func (m *Minerva) FinalizeSnail(chain consensus.SnailChainReader, header *types.SnailHeader, ...) (*types.SnailBlock, error) + func (m *Minerva) GetDifficulty(header *types.SnailHeader, isFruit bool) (*big.Int, *big.Int) + func (m *Minerva) GetElection() consensus.CommitteeElection + func (m *Minerva) GetRewardContentBySnailNumber(sBlock *types.SnailBlock) *types.SnailRewardContenet + func (m *Minerva) Hashrate() float64 + func (m *Minerva) NewTestData(block uint64) + func (m *Minerva) Prepare(chain consensus.ChainReader, header *types.Header) error + func (m *Minerva) PrepareSnail(fastchain consensus.ChainReader, chain consensus.SnailChainReader, ...) error + func (m *Minerva) PrepareSnailWithParent(fastchain consensus.ChainReader, chain consensus.SnailChainReader, ...) error + func (m *Minerva) Seal(chain consensus.SnailChainReader, block *types.SnailBlock, ...) (*types.SnailBlock, error) + func (m *Minerva) SetElection(e consensus.CommitteeElection) + func (m *Minerva) SetSnailChainReader(scr consensus.SnailChainReader) + func (m *Minerva) SetThreads(threads int) + func (m *Minerva) Threads() int + func (m *Minerva) VerifyFreshness(chain consensus.SnailChainReader, fruit *types.SnailHeader, ...) error + func (m *Minerva) VerifyHeader(chain consensus.ChainReader, header *types.Header) error + func (m *Minerva) VerifyHeaders(chain consensus.ChainReader, headers []*types.Header, seals []bool) (chan<- struct{}, <-chan error) + func (m *Minerva) VerifySigns(fastnumber *big.Int, fastHash common.Hash, signs []*types.PbftSign) error + func (m *Minerva) VerifySnailHeader(chain consensus.SnailChainReader, fastchain consensus.ChainReader, ...) error + func (m *Minerva) VerifySnailHeaders(chain consensus.SnailChainReader, headers []*types.SnailHeader, seals []bool) (chan<- struct{}, <-chan error) + func (m *Minerva) VerifySnailSeal(chain consensus.SnailChainReader, header *types.SnailHeader, isFruit bool) error + func (m *Minerva) VerifySnailSeal2(hight *big.Int, nonce string, headNoNoncehash string, ftarg *big.Int, ...) (bool, bool, []byte) + func (m *Minerva) VerifySwitchInfo(fastnumber *big.Int, info []*types.CommitteeMember) error + type Mode uint + const ModeFake + const ModeFullFake + const ModeNormal + const ModeShared + const ModeTest