healing

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRetry = fmt.Errorf("retry")

Functions

func HealAnchor

func HealAnchor(ctx context.Context, args HealAnchorArgs, si SequencedInfo) error

func ResolveSequenced

func ResolveSequenced[T messaging.Message](ctx context.Context, client message.AddressedClient, net *NetworkInfo, srcId, dstId string, seqNum uint64, anchor bool) (*api.MessageRecord[T], error)

ResolveSequenced resolves an anchor or synthetic message (a sequenced message). If the client's address is non-nil, the query will be sent to that address. Otherwise, all of the source partition's nodes will be queried in order until one responds.

Types

type HealAnchorArgs

type HealAnchorArgs struct {
	Client  message.AddressedClient
	Querier api.Querier
	Submit  func(...messaging.Message) error
	NetInfo *NetworkInfo
	Known   map[[32]byte]*protocol.Transaction
	Pretend bool
	Wait    bool
}

type HealSyntheticArgs

type HealSyntheticArgs struct {
	Client      message.AddressedClient
	Querier     api.Querier
	Submitter   api.Submitter
	NetInfo     *NetworkInfo
	Light       *light.Client
	Pretend     bool
	Wait        bool
	SkipAnchors int
}

type Healer

type Healer struct {
}

func (*Healer) HealSynthetic

func (h *Healer) HealSynthetic(ctx context.Context, args HealSyntheticArgs, si SequencedInfo) error

func (*Healer) Reset

func (h *Healer) Reset()

type NetworkInfo

type NetworkInfo struct {
	Status *api.NetworkStatus  `json:"status"`
	ID     string              `json:"id"`
	Peers  map[string]PeerList `json:"peers"`
}

func ScanNetwork

func ScanNetwork(ctx context.Context, endpoint ScanServices) (*NetworkInfo, error)

func (*NetworkInfo) PeerByID

func (i *NetworkInfo) PeerByID(id peer.ID) *PeerInfo

type PeerInfo

type PeerInfo struct {
	ID        p2p.PeerID
	Operator  *url.URL             `json:"operator,omitempty" form:"operator" query:"operator" validate:"required"`
	Key       [32]byte             `json:"key,omitempty" form:"key" query:"key" validate:"required"`
	Status    *api.ConsensusStatus `json:"status,omitempty" form:"status" query:"status" validate:"required"`
	Addresses []p2p.Multiaddr      `json:"addresses,omitempty" form:"addresses" query:"addresses" validate:"required"`
}

func ScanNode

func ScanNode(ctx context.Context, endpoint ScanServices) (*PeerInfo, error)

func (*PeerInfo) Copy

func (v *PeerInfo) Copy() *PeerInfo

func (*PeerInfo) CopyAsInterface

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

func (*PeerInfo) Equal

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

func (*PeerInfo) MarshalJSON

func (v *PeerInfo) MarshalJSON() ([]byte, error)

func (*PeerInfo) String

func (p *PeerInfo) String() string

func (*PeerInfo) UnmarshalJSON

func (v *PeerInfo) UnmarshalJSON(data []byte) error

type PeerList

type PeerList map[peer.ID]*PeerInfo

func (PeerList) MarshalJSON

func (l PeerList) MarshalJSON() ([]byte, error)

func (*PeerList) UnmarshalJSON

func (l *PeerList) UnmarshalJSON(data []byte) error

type ScanServices

type ScanServices = interface {
	api.NodeService
	api.ConsensusService
	api.NetworkService
}

type SequencedInfo

type SequencedInfo struct {
	Source      string
	Destination string
	Number      uint64
	ID          *url.TxID
}

Jump to

Keyboard shortcuts

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