trillian

package
v0.0.0-...-7d7216e Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0, Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package trillian represents the log for the needs of this personality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*client.LogVerifier
	// contains filtered or unexported fields
}

Client represents the personality's view of the Trillian Log.

func NewClient

func NewClient(ctx context.Context, timeout time.Duration, logAddr string, treeStorage *trees.TreeStorage) (*Client, error)

NewClient returns a new client that will read/write to its tree using the Trillian gRPC API URL provided, with the given timeout for connections. The Client returned should have Close called by the owner when done.

func (*Client) AddSignedStatement

func (c *Client) AddSignedStatement(ctx context.Context, data []byte) error

AddSignedStatement adds the statement to the log if it isn't already present.

func (*Client) Close

func (c *Client) Close()

Close finishes the underlying connections and tidies up after the Client is finished.

func (*Client) ConsistencyProof

func (c *Client) ConsistencyProof(ctx context.Context, from, to uint64) ([][]byte, error)

ConsistencyProof gets the consistency proof between two given tree sizes.

func (*Client) FirmwareManifestAtIndex

func (c *Client) FirmwareManifestAtIndex(ctx context.Context, index, treeSize uint64) ([]byte, [][]byte, error)

FirmwareManifestAtIndex gets the value at the given index and an inclusion proof to the given tree size.

func (*Client) InclusionProofByHash

func (c *Client) InclusionProofByHash(ctx context.Context, hash []byte, treeSize uint64) (uint64, [][]byte, error)

InclusionProofByHash gets an inclusion proof in the specified tree size for the first leaf found with the specified hash.

func (*Client) Root

func (c *Client) Root() *tt.LogRootV1

Root returns the most recent root seen by this client. Use UpdateRoot() to update this client's view of the latest root.

func (*Client) UpdateRoot

func (c *Client) UpdateRoot(ctx context.Context) error

UpdateRoot retrieves the current SignedLogRoot, verifying it against roots this client has seen in the past, and updating the currently trusted root if the new root verifies, and is newer than the currently trusted root. After returning, the most recent verified root will be obtainable via c.Root().

Jump to

Keyboard shortcuts

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