bsn

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

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

func (*Block) Close

func (b *Block) Close() (execute.BlockState, error)

func (*Block) Params

func (b *Block) Params() execute.BlockParams

func (*Block) Process

func (b *Block) Process(envelope *messaging.Envelope) ([]*protocol.TransactionStatus, error)

type BlockAnchor

type BlockAnchor struct{}

func (BlockAnchor) Process

func (x BlockAnchor) Process(batch *ChangeSet, ctx *MessageContext) (err error)

func (BlockAnchor) Validate

func (x BlockAnchor) Validate(batch *ChangeSet, ctx *MessageContext) error

type BlockState

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

func (*BlockState) ChangeSet added in v1.1.1

func (b *BlockState) ChangeSet() record.Record

func (*BlockState) Commit

func (b *BlockState) Commit() error

func (*BlockState) DidCompleteMajorBlock

func (b *BlockState) DidCompleteMajorBlock() (uint64, time.Time, bool)

func (*BlockState) Discard

func (b *BlockState) Discard()

func (*BlockState) Hash

func (b *BlockState) Hash() ([32]byte, error)

func (*BlockState) IsEmpty

func (b *BlockState) IsEmpty() bool

func (*BlockState) Params

func (b *BlockState) Params() execute.BlockParams

type BlockSummary

type BlockSummary struct{}

func (BlockSummary) Process

func (x BlockSummary) Process(batch *ChangeSet, ctx *MessageContext) (err error)

func (BlockSummary) Validate

func (x BlockSummary) Validate(batch *ChangeSet, ctx *MessageContext) error

type ChangeSet

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

func NewChangeSet

func NewChangeSet(store keyvalue.Beginner, logger log.Logger) *ChangeSet

New

func (*ChangeSet) Begin

func (c *ChangeSet) Begin() *ChangeSet

func (*ChangeSet) Commit

func (c *ChangeSet) Commit() error

func (*ChangeSet) Discard

func (c *ChangeSet) Discard()

func (*ChangeSet) IsDirty

func (c *ChangeSet) IsDirty() bool

func (*ChangeSet) Key added in v1.1.1

func (c *ChangeSet) Key() *record.Key

func (*ChangeSet) LastBlock

func (c *ChangeSet) LastBlock() values.Value[*LastBlock]

func (*ChangeSet) Partition

func (c *ChangeSet) Partition(id string) *database.Batch

func (*ChangeSet) Pending

func (c *ChangeSet) Pending(partition string) *Pending

func (*ChangeSet) Resolve

func (c *ChangeSet) Resolve(key *record.Key) (record.Record, *record.Key, error)

func (*ChangeSet) Summary

func (c *ChangeSet) Summary(hash [32]byte) *Summary

func (*ChangeSet) Walk added in v1.1.1

func (c *ChangeSet) Walk(opts record.WalkOptions, fn record.WalkFunc) error

type Collector

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

func StartCollector

func StartCollector(opts CollectorOptions) (*Collector, error)

type CollectorOptions

type CollectorOptions struct {
	Partition string
	Database  database.Beginner
	Events    *events.Bus
}

type DidCollectBlock

type DidCollectBlock struct {
	Summary *messaging.BlockSummary
}

func (DidCollectBlock) IsEvent

func (DidCollectBlock) IsEvent()

type Executor

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

func NewExecutor

func NewExecutor(opts ExecutorOptions) (*Executor, error)

func (*Executor) Begin

func (x *Executor) Begin(params execute.BlockParams) (execute.Block, error)

func (*Executor) EnableTimers

func (*Executor) EnableTimers()

func (*Executor) Init added in v1.2.0

func (x *Executor) Init(validators []*execute.ValidatorUpdate) (additional []*execute.ValidatorUpdate, err error)

func (*Executor) LastBlock

func (x *Executor) LastBlock() (*execute.BlockParams, [32]byte, error)

func (*Executor) LoadSnapshot added in v1.2.0

func (x *Executor) LoadSnapshot(file ioutil2.SectionReader) error

func (*Executor) StoreBlockTimers

func (*Executor) StoreBlockTimers(ds *logging.DataSet)

func (*Executor) Validate

func (x *Executor) Validate(envelope *messaging.Envelope, recheck bool) ([]*protocol.TransactionStatus, error)

type ExecutorFor

type ExecutorFor[T any, V interface{ Type() T }] interface {
	Process(*ChangeSet, V) error
	Validate(*ChangeSet, V) error
}

type ExecutorOptions

type ExecutorOptions struct {
	PartitionID string
	Logger      log.Logger
	Store       keyvalue.Beginner
	EventBus    *events.Bus
}

type LastBlock

type LastBlock struct {
	Index uint64    `json:"index,omitempty" form:"index" query:"index" validate:"required"`
	Time  time.Time `json:"time,omitempty" form:"time" query:"time" validate:"required"`
	// contains filtered or unexported fields
}

func (*LastBlock) Copy

func (v *LastBlock) Copy() *LastBlock

func (*LastBlock) CopyAsInterface

func (v *LastBlock) CopyAsInterface() interface{}

func (*LastBlock) Equal

func (v *LastBlock) Equal(u *LastBlock) bool

func (*LastBlock) IsValid

func (v *LastBlock) IsValid() error

func (*LastBlock) MarshalBinary

func (v *LastBlock) MarshalBinary() ([]byte, error)

func (*LastBlock) UnmarshalBinary

func (v *LastBlock) UnmarshalBinary(data []byte) error

func (*LastBlock) UnmarshalBinaryFrom

func (v *LastBlock) UnmarshalBinaryFrom(rd io.Reader) error

type MessageContext

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

func (*MessageContext) Type

type Pending

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

func (*Pending) Commit

func (c *Pending) Commit() error

func (*Pending) IsDirty

func (c *Pending) IsDirty() bool

func (*Pending) Key added in v1.1.1

func (c *Pending) Key() *record.Key

func (*Pending) OnBlock

func (c *Pending) OnBlock(index uint64) values.Value[[32]byte]

func (*Pending) Resolve

func (c *Pending) Resolve(key *record.Key) (record.Record, *record.Key, error)

func (*Pending) Walk added in v1.1.1

func (c *Pending) Walk(opts record.WalkOptions, fn record.WalkFunc) error

type Summary

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

func (*Summary) Commit

func (c *Summary) Commit() error

func (*Summary) IsDirty

func (c *Summary) IsDirty() bool

func (*Summary) Key added in v1.1.1

func (c *Summary) Key() *record.Key

func (*Summary) Main

func (*Summary) Resolve

func (c *Summary) Resolve(key *record.Key) (record.Record, *record.Key, error)

func (*Summary) Signatures

func (c *Summary) Signatures() values.Set[protocol.KeySignature]

func (*Summary) Walk added in v1.1.1

func (c *Summary) Walk(opts record.WalkOptions, fn record.WalkFunc) error

Jump to

Keyboard shortcuts

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