Documentation
¶
Index ¶
- Constants
- Variables
- func AddCommands(app *cli.App, ikwid bool) *cli.App
- func Bug(cmd *CmdCtx, id string) bool
- func DecodedEventsFromData(data []byte) ([]logverification.DecodedEvent, error)
- func IsSupportedBug(id string) bool
- func NewApp(ikwid bool) *cli.App
- func NewAttribute(value any) (*attribute.Attribute, error)
- func NewDiagCmd() *cli.Command
- func NewEventDiagCmd() *cli.Command
- func NewEventsVerifyCmd() *cli.Command
- func NewLogTailCmd() *cli.Command
- func NewLogWatcherCmd() *cli.Command
- func NewMassifsCmd() *cli.Command
- func NewNodeCmd() *cli.Command
- func NewNodeScanCmd() *cli.Command
- func NewProveCmd() *cli.Command
- func NewTimestamp(id uint64, epoch uint8) (*timestamppb.Timestamp, error)
- func NewWatchConfig(cCtx *cli.Context, cmd *CmdCtx) (watcher.WatchConfig, error)
- func PeakStack(massifHeight uint8, mmrSize uint64) []uint64
- func SetTimestamp(id uint64, ts *timestamppb.Timestamp, epoch uint8) error
- func VerifiableEventsFromData(data []byte) ([]logverification.VerifiableEvent, error)
- type CmdCtx
- type DirLister
- type FileOpener
- type LocalMassifReader
- func (mr *LocalMassifReader) GetFirstMassif(ctx context.Context, tenantIdentity string, opts ...azblob.Option) (massifs.MassifContext, error)
- func (mr *LocalMassifReader) GetHeadMassif(ctx context.Context, tenantIdentity string, opts ...azblob.Option) (massifs.MassifContext, error)
- func (mr *LocalMassifReader) GetLazyContext(ctx context.Context, tenantIdentity string, which massifs.LogicalBlob, ...) (massifs.LogBlobContext, uint64, error)
- func (mr *LocalMassifReader) GetMassif(ctx context.Context, tenantIdentity string, massifIndex uint64, ...) (massifs.MassifContext, error)
- type LocalMassifReaderOptions
- type LogTailActivity
- type MassifReader
- type MassifTail
- type Opener
- type Option
- type OsDirLister
- type SealTail
- type StdinOpener
- type TailConfig
Constants ¶
const ( AzureBlobURLFmt = "https://%s.blob.core.windows.net" AzuriteStorageAccount = "devstoreaccount1" DefaultContainer = "merklelogs" )
const ( // LeafTypePlain is used for committing to plain values. LeafTypePlain = uint8(0) PublicAssetsPrefix = "publicassets/" ProtectedAssetsPrefix = "assets/" // To create smooth UX for basic or first-time users, we default to the verifiabledata proxy // on production. This gives us compact runes to verify inclusion of a List Events response. DefaultRemoteMassifURL = "https://app.datatrails.ai/verifiabledata" )
Variables ¶
var ( // recovers timestamp_committed from merklelog_entry.commit.idtimestamp prior to hashing Bug9308 = "9308" Bugs = []string{ Bug9308, } )
var ( ErrVerifyInclusionFailed = errors.New("the entry is not in the log") ErrUncommittedEvents = errors.New("one or more events did not have record of their inclusion in the log") )
var (
ErrInvalidV3Event = errors.New(`json is not in expected v3event format`)
)
Functions ¶
func DecodedEventsFromData ¶ added in v0.0.4
func DecodedEventsFromData(data []byte) ([]logverification.DecodedEvent, error)
func IsSupportedBug ¶
func NewDiagCmd ¶
NewDiagCmd prints diagnostic information about the massif blob containg a specific mmrIndex
func NewEventDiagCmd ¶
NewEventDiagCmd provides diagnostic support for event verification
func NewEventsVerifyCmd ¶ added in v0.0.3
NewEventsVerifyCmd verifies inclusion of a DataTrails event in the tenants Merkle Log
func NewLogTailCmd ¶
func NewLogWatcherCmd ¶
NewLogWatcherCmd watches for changes on any log
func NewMassifsCmd ¶
NewMassifsCmd prints out pre-calculated tables for navigating massif blobs with maximum convenience
func NewNodeScanCmd ¶
NewNodeScan implements a sub command which linearly scans for a node in a blob This is a debugging tool
func NewProveCmd ¶
NewProveCmd (will) generate a proof and node path for the argument node
func NewTimestamp ¶
func NewTimestamp(id uint64, epoch uint8) (*timestamppb.Timestamp, error)
func NewWatchConfig ¶
NewWatchConfig derives a configuration from the options set on the command line context
func PeakStack ¶
PeakStack returns the stack of mmrIndices corresponding to the stack of ancestor nodes required for mmrSize. Note that the trick here is to realise that passing a massifIndex+1 in place of mmrSize, treating each massif as a leaf node in a much smaller tree, gets the (much shorter) peak stack of nodes required from earlier massifs. And this is stack of nodes carried forward in each massif blob to make them self contained. (The mmrblobs package has a slightly different variant of this that returns a map)
func SetTimestamp ¶
func SetTimestamp(id uint64, ts *timestamppb.Timestamp, epoch uint8) error
func VerifiableEventsFromData ¶ added in v0.0.3
func VerifiableEventsFromData(data []byte) ([]logverification.VerifiableEvent, error)
Types ¶
type CmdCtx ¶
type CmdCtx struct {
// contains filtered or unexported fields
}
CmdCtx holds shared config and config derived state for all commands
type FileOpener ¶ added in v0.0.4
type FileOpener struct{}
func (*FileOpener) Open ¶ added in v0.0.4
func (*FileOpener) Open(name string) (io.ReadCloser, error)
type LocalMassifReader ¶ added in v0.0.4
type LocalMassifReader struct {
// contains filtered or unexported fields
}
func NewLocalMassifReader ¶ added in v0.0.4
func NewLocalMassifReader( log logger.Logger, opener Opener, logLocation string, opts ...Option, ) (*LocalMassifReader, error)
NewLocalMassifReader creates MassifReader that reads from local files on disc - it mostly ignores tenant identity as we assume all the logs on the disc are for the tenant one is interested in - but it's still valid to pass tenant ID here
func (*LocalMassifReader) GetFirstMassif ¶ added in v0.0.4
func (mr *LocalMassifReader) GetFirstMassif( ctx context.Context, tenantIdentity string, opts ...azblob.Option, ) (massifs.MassifContext, error)
func (*LocalMassifReader) GetHeadMassif ¶ added in v0.0.4
func (mr *LocalMassifReader) GetHeadMassif( ctx context.Context, tenantIdentity string, opts ...azblob.Option, ) (massifs.MassifContext, error)
func (*LocalMassifReader) GetLazyContext ¶ added in v0.0.4
func (mr *LocalMassifReader) GetLazyContext( ctx context.Context, tenantIdentity string, which massifs.LogicalBlob, opts ...azblob.Option, ) (massifs.LogBlobContext, uint64, error)
GetLazyContext is an optimization for remote massif readers and is therefor not implemented for local massif reader
type LocalMassifReaderOptions ¶ added in v0.0.4
type LocalMassifReaderOptions struct {
// contains filtered or unexported fields
}
type LogTailActivity ¶
type LogTailActivity struct {
watcher.LogTail
LogSize uint64
LastIDEpoch uint8
LastIDTimestamp uint64
LogActivity time.Time
TagActivity time.Time
}
LogTailActivity can represent either the seal or the massif that has most recently been updated for the log.
type MassifReader ¶ added in v0.0.4
type MassifReader interface {
GetFirstMassif(ctx context.Context, tenantIdentity string, opts ...azblob.Option) (massifs.MassifContext, error)
GetHeadMassif(ctx context.Context, tenantIdentity string, opts ...azblob.Option) (massifs.MassifContext, error)
GetLazyContext(ctx context.Context, tenantIdentity string, which massifs.LogicalBlob, opts ...azblob.Option) (massifs.LogBlobContext, uint64, error)
GetMassif(ctx context.Context, tenantIdentity string, massifIndex uint64, opts ...azblob.Option) (massifs.MassifContext, error)
}
type MassifTail ¶
type MassifTail struct {
LogTailActivity
FirstIndex uint64
}
MassifTail contains the massif specific tail information
func TailMassif ¶
func TailMassif( ctx context.Context, massifReader MassifReader, tenantIdentity string, ) (MassifTail, error)
TailMassif returns the active massif for the tenant
func (MassifTail) String ¶
func (lt MassifTail) String() string
String returns a printable. loggable pretty rendering of the tail
type Option ¶ added in v0.0.4
type Option func(*LocalMassifReaderOptions)
func WithDirectory ¶ added in v0.0.4
func WithDirectory() Option
type OsDirLister ¶ added in v0.0.4
type OsDirLister struct{}
Utilities to remove the os dependencies from the MassifReader
type SealTail ¶
type SealTail struct {
LogTailActivity
Count uint64
Signed cose.CoseSign1Message
State massifs.MMRState
}
SealTail contains the seal specific tail information
type StdinOpener ¶ added in v0.0.4
type StdinOpener struct {
// contains filtered or unexported fields
}
func (*StdinOpener) Open ¶ added in v0.0.4
func (o *StdinOpener) Open(string) (io.ReadCloser, error)
type TailConfig ¶
type TailConfig struct {
// Interval defines the wait period between repeated tail checks if many
// checks have been asked for.
Interval time.Duration
// TenantIdentity identifies the log of interest
TenantIdentity string
}
func NewTailConfig ¶
func NewTailConfig(cCtx *cli.Context, cmd *CmdCtx) (TailConfig, error)
NewTailConfig derives a configuration from the supplied comand line options context