Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Unmarshaler ¶ added in v0.17.1
func Unmarshaler() fraud.ProofUnmarshaler[*header.ExtendedHeader]
Types ¶
type API ¶ added in v0.5.0
type API struct {
Internal struct {
Subscribe func(context.Context, fraud.ProofType) (<-chan *Proof, error) `perm:"read"`
Get func(context.Context, fraud.ProofType) ([]Proof, error) `perm:"read"`
}
}
API is a wrapper around Module for the RPC.
type Module ¶
type Module interface {
// Subscribe allows to subscribe on a Proof pub sub topic by its type.
Subscribe(context.Context, fraud.ProofType) (<-chan *Proof, error)
// Get fetches fraud proofs from the disk by its type.
Get(context.Context, fraud.ProofType) ([]Proof, error)
}
Module encompasses the behavior necessary to subscribe and broadcast fraud proofs within the network. Any method signature changed here needs to also be changed in the API struct.
type Proof ¶ added in v0.5.0
type Proof struct {
fraud.Proof[*header.ExtendedHeader]
}
Proof embeds the fraud.Proof interface type to provide a concrete type for JSON serialization.
func (*Proof) MarshalJSON ¶ added in v0.5.0
func (*Proof) UnmarshalJSON ¶ added in v0.5.0
type ServiceBreaker ¶ added in v0.9.2
type ServiceBreaker[S service, H libhead.Header[H]] struct { Service S FraudType fraud.ProofType FraudServ fraud.Service[H] // contains filtered or unexported fields }
ServiceBreaker wraps any service with fraud proof subscription of a specific type. If proof happens the service is Stopped automatically. TODO(@Wondertan): Support multiple fraud types.
Click to show internal directories.
Click to hide internal directories.