fraud

package
v0.5.2-slava Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructModule

func ConstructModule(tp node.Type) fx.Option

func Lifecycle

func Lifecycle(
	startCtx, lifecycleCtx context.Context,
	p fraud.ProofType,
	fraudModule Module,
	start, stop func(context.Context) error,
) error

Lifecycle controls the lifecycle of service depending on fraud proofs. It starts the service only if no fraud-proof exists and stops the service automatically if a proof arrives after the service was started.

Types

type Module

type Module interface {
	fraud.Service
}

Module encompasses the behavior necessary to subscribe and broadcast fraud proofs within the network.

func ModuleWithSyncer

func ModuleWithSyncer(
	lc fx.Lifecycle,
	sub *pubsub.PubSub,
	host host.Host,
	hstore header.Store,
	ds datastore.Batching,
	network p2p.Network,
) (Module, error)

ModuleWithSyncer constructs fraud proof service with enabled syncer.

func NewModule

func NewModule(
	lc fx.Lifecycle,
	sub *pubsub.PubSub,
	host host.Host,
	hstore header.Store,
	ds datastore.Batching,
	network p2p.Network,
) (Module, error)

NewModule constructs a fraud proof service with the syncer disabled.

Jump to

Keyboard shortcuts

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