Documentation ¶
Overview ¶
Package prover implements the core proving functionality of PoET implementation.
Index ¶
- Constants
- func GenerateProof(ctx context.Context, leavesCounter prometheus.Counter, treeCfg TreeConfig, ...) (uint64, *shared.MerkleProof, error)
- func GenerateProofRecovery(ctx context.Context, leavesCounter prometheus.Counter, treeCfg TreeConfig, ...) (uint64, *shared.MerkleProof, error)
- func GenerateProofWithoutPersistency(ctx context.Context, treeCfg TreeConfig, ...) (uint64, *shared.MerkleProof, error)
- func GetLayerFactory(minMemoryLayer uint, datadir string, fileWriterBufSize uint) cache.LayerFactory
- type TreeConfig
Constants ¶
View Source
const ( // MerkleMinCacheLayer set the min layer in which all layers above will be cached, in addition to the base layer. MerkleMinCacheLayer = 0 // LowestMerkleMinMemoryLayer set the lowest-allowed layer in which all layers above will be cached in-memory. LowestMerkleMinMemoryLayer = 1 )
Variables ¶
This section is empty.
Functions ¶
func GenerateProof ¶
func GenerateProof( ctx context.Context, leavesCounter prometheus.Counter, treeCfg TreeConfig, labelHashFunc func(data []byte) []byte, merkleHashFunc merkle.HashFunc, deadline time.Time, securityParam uint8, persist persistFunc, ) (uint64, *shared.MerkleProof, error)
GenerateProof generates the Proof of Sequential Work. It stops when the given deadline is reached.
func GenerateProofRecovery ¶
func GenerateProofRecovery( ctx context.Context, leavesCounter prometheus.Counter, treeCfg TreeConfig, labelHashFunc func(data []byte) []byte, merkleHashFunc merkle.HashFunc, deadline time.Time, securityParam uint8, nextLeafID uint64, persist persistFunc, ) (uint64, *shared.MerkleProof, error)
GenerateProofRecovery recovers proof generation, from a given 'nextLeafID'.
func GenerateProofWithoutPersistency ¶
func GenerateProofWithoutPersistency( ctx context.Context, treeCfg TreeConfig, labelHashFunc func(data []byte) []byte, merkleHashFunc merkle.HashFunc, deadline time.Time, securityParam uint8, ) (uint64, *shared.MerkleProof, error)
GenerateProofWithoutPersistency calls GenerateProof with disabled persistency functionality. Tree recovery will not be possible. Meant to be used for testing purposes only. It doesn't expose metrics too.
func GetLayerFactory ¶ added in v0.9.4
func GetLayerFactory(minMemoryLayer uint, datadir string, fileWriterBufSize uint) cache.LayerFactory
GetLayerFactory creates a merkle LayerFactory. The minMemoryLayer determines the threshold below which layers are saved on-disk, while layers equal and above - in-memory.
Types ¶
type TreeConfig ¶ added in v0.6.1
Click to show internal directories.
Click to hide internal directories.