Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateProof(sig *signal.Signal, datadir string, labelHashFunc func(data []byte) []byte, ...) (*shared.MerkleProof, error)
- func GenerateProofRecovery(sig *signal.Signal, datadir string, labelHashFunc func(data []byte) []byte, ...) (*shared.MerkleProof, error)
- func GenerateProofWithoutPersistency(datadir string, labelHashFunc func(data []byte) []byte, ...) (*shared.MerkleProof, error)
- type ReadWriterMetaFactory
Constants ¶
const ( MerkleMinCacheLayer = 0 // Merkle nodes from this layer up will be cached, in addition to the base layer LowestMerkleMinMemoryLayer = 1 )
Variables ¶
var (
ErrShutdownRequested = errors.New("shutdown requested")
)
Functions ¶
func GenerateProof ¶
func GenerateProof( sig *signal.Signal, datadir string, labelHashFunc func(data []byte) []byte, merkleHashFunc func(lChild, rChild []byte) []byte, numLeaves uint64, securityParam uint8, minMemoryLayer uint, persist persistFunc, ) (*shared.MerkleProof, error)
GenerateProof computes the PoET DAG, uses Fiat-Shamir to derive a challenge from the Merkle root and generates a Merkle proof using the challenge and the DAG.
func GenerateProofRecovery ¶
Types ¶
type ReadWriterMetaFactory ¶
type ReadWriterMetaFactory struct {
// contains filtered or unexported fields
}
ReadWriterMetaFactory generates Merkle LayerFactory functions. The functions it creates generate file read-writers starting from the base layer and up to minMemoryLayer-1. From minMemoryLayer and up the functions generate slice read-writers. The MetaFactory tracks the files it creates and removes them when Cleanup() is called.
func NewReadWriterMetaFactory ¶
func NewReadWriterMetaFactory(minMemoryLayer uint, datadir string) *ReadWriterMetaFactory
NewReadWriterMetaFactory returns a new ReadWriterMetaFactory. minMemoryLayer determines the threshold in which lower layers caching is done on-disk, while from this layer up -- in-memory
func (*ReadWriterMetaFactory) Cleanup ¶
func (mf *ReadWriterMetaFactory) Cleanup()
Cleanup removes the files that were created by the LayerFactory functions generated by this MetaFactory.
func (*ReadWriterMetaFactory) GetFactory ¶
func (mf *ReadWriterMetaFactory) GetFactory() cache.LayerFactory
GetFactory creates a Merkle LayerFactory function.