Documentation
¶
Overview ¶
Package consensus implements the czz consensus engine.
Index ¶
- Constants
- func BigToCompact(n *big.Int) uint32
- func CZZhashFull(hash []byte, nonce uint64) []byte
- func CompactToBig(compact uint32) *big.Int
- func DisableLog()
- func DoubleHashB(b []byte) []byte
- func DoubleHashH(b []byte) chainhash.Hash
- func HashB(b []byte) []byte
- func HashCZZ(header []byte, nonce uint64) []byte
- func HashH(b []byte) chainhash.Hash
- func MineBlock(conf *MiningParam) (uint64, bool)
- func UseLogger(logger czzlog.Logger)
- func VerifyBlockSeal(Info *CzzConsensusParam, nonce uint64) error
- type CZZTBL
- type CzzConsensusParam
- type MiningParam
Constants ¶
View Source
const CZZDataSize = 8
View Source
const TBLSize = 33554432
Variables ¶
This section is empty.
Functions ¶
func BigToCompact ¶
func CZZhashFull ¶
CZZhashFull aggregates data from the full dataset (using the full in-memory dataset) in order to produce our final value for a particular header hash and nonce.
func CompactToBig ¶
func DisableLog ¶
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.
func DoubleHashB ¶
DoubleHashB calculates hash(hash(b)) and returns the resulting bytes.
func DoubleHashH ¶
func MineBlock ¶
func MineBlock(conf *MiningParam) (uint64, bool)
func VerifyBlockSeal ¶
func VerifyBlockSeal(Info *CzzConsensusParam, nonce uint64) error
Types ¶
type MiningParam ¶
type MiningParam struct {
Info *CzzConsensusParam
MinerID int
Begin uint64
Loops uint64
Done uint64
Abort chan struct{}
}
Click to show internal directories.
Click to hide internal directories.