witness

package
v1.3.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Success = iota
	SuccessObtainLock
	GetCheckpoint
	UnmarshalCheckpoint
	SignCheckpoint
	RedisFailure
	RedisLatestFailure
)

Constant values used with metrics

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckpointPublisher

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

CheckpointPublisher is a long-running job to periodically publish signed checkpoints to etc.d

func NewCheckpointPublisher

func NewCheckpointPublisher(ctx context.Context,
	logClient trillian.TrillianLogClient,
	treeID int64,
	hostname string,
	signer signature.Signer,
	redisClient *redis.Client,
	checkpointFreq uint,
	reqCounter *prometheus.CounterVec) CheckpointPublisher

NewCheckpointPublisher creates a CheckpointPublisher to write stable checkpoints to Redis

func (*CheckpointPublisher) StartPublisher

func (c *CheckpointPublisher) StartPublisher(ctx context.Context)

StartPublisher creates a long-running task that publishes the latest checkpoint every X minutes Writing to Redis is best effort. Failure will be detected either through metrics or by witnesses or Verifiers monitoring for fresh checkpoints. Failure can occur after a lock is obtained but before publishing the latest checkpoint. If this occurs due to a sporadic failure, this simply means that a witness will not see a fresh checkpoint for an additional period.

Directories

Path Synopsis
Package mockclient provides a mockable version of the Trillian log client API.
Package mockclient provides a mockable version of the Trillian log client API.

Jump to

Keyboard shortcuts

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