core

package
v1.3.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package core contains code for a scalable Merkle tree construction.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildJob

type BuildJob struct {
	RangeStart uint64   // The beginning of the range.
	Hashes     [][]byte // The leaf hashes.
}

BuildJob is a slice of leaf data hashes spanning a range of a Merkle tree.

type BuildWorker

type BuildWorker struct {
	// contains filtered or unexported fields
}

BuildWorker processes tree building jobs.

func NewBuildWorker

func NewBuildWorker(tw storage.TreeWriter, rf *compact.RangeFactory) *BuildWorker

NewBuildWorker returns a new BuildWorker for the specified tree.

func (*BuildWorker) Process

func (b *BuildWorker) Process(ctx context.Context, job BuildJob) (*compact.Range, error)

Process handles a single build job. It populates the tree storage with the leaf hashes from the slice in the job, and all internal nodes of the tree that can be inferred from them. Returns the compact range of the resulting tree segment.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL