crosschain

package
v1.3.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructLastAnchor

func ConstructLastAnchor(ctx context.Context, batch *database.Batch, partition *url.URL) (protocol.AnchorBody, uint64, error)

ConstructLastAnchor constructs an anchor for the previous block. This *must* be called with a batch created during BeginBlock, prior to updating any database records.

Types

type Conductor

type Conductor struct {
	Partition    *protocol.PartitionInfo
	Globals      atomic.Pointer[network.GlobalValues]
	ValidatorKey ed25519.PrivateKey
	Database     database.Beginner
	Querier      api.Querier2
	Dispatcher   execute.Dispatcher

	// Ready can be used to pause the conductor, for example to stop it from
	// sending anchors while the node is catching up.
	Ready func(execute.WillBeginBlock) bool

	// RunTask launches a background task. The caller may use this to wait for
	// completion of launched tasks.
	RunTask func(func())

	// **FOR TESTING PURPOSES ONLY**. Tells the conductor not to skip sending
	// the anchor the first time around.
	DropInitialAnchor bool

	// Enables healing of anchors after they are initially submitted.
	EnableAnchorHealing *bool

	// **FOR TESTING PURPOSES ONLY**. Intercepts dispatched envelopes.
	Intercept interceptor
}

func (*Conductor) Start

func (c *Conductor) Start(bus *events.Bus) error

func (*Conductor) Url

func (c *Conductor) Url(path ...string) *url.URL

type ValidatorContext

type ValidatorContext struct {
	Source       *protocol.PartitionInfo
	Globals      *network.GlobalValues
	ValidatorKey ed25519.PrivateKey
}

func (ValidatorContext) PrepareAnchorSubmission

func (x ValidatorContext) PrepareAnchorSubmission(ctx context.Context, anchor protocol.AnchorBody, sequenceNumber uint64, destination *url.URL) (*messaging.Envelope, *protocol.Transaction, error)

func (ValidatorContext) Url

func (x ValidatorContext) Url(path ...string) *url.URL

Jump to

Keyboard shortcuts

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