heimdall

package
v0.0.0-...-11d2657 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrShutdownDetected is returned if a shutdown was detected
	ErrShutdownDetected      = errors.New("shutdown detected")
	ErrNoResponse            = errors.New("got a nil response")
	ErrNotSuccessfulResponse = errors.New("error while fetching data from Heimdall")
	ErrNotInRejectedList     = errors.New("milestoneID doesn't exist in rejected list")
	ErrNotInMilestoneList    = errors.New("milestoneID doesn't exist in Heimdall")
)

Functions

func Fetch

func Fetch[T any](ctx context.Context, request *Request) (*T, error)

Fetch returns data from heimdall

func FetchWithRetry

func FetchWithRetry[T any](ctx context.Context, client http.Client, url *url.URL, closeCh chan struct{}) (*T, error)

FetchWithRetry returns data from heimdall with retry

Types

type HeimdallClient

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

func NewHeimdallClient

func NewHeimdallClient(urlString string) *HeimdallClient

func (*HeimdallClient) Close

func (h *HeimdallClient) Close()

Close sends a signal to stop the running process

func (*HeimdallClient) FetchCheckpoint

func (h *HeimdallClient) FetchCheckpoint(ctx context.Context, number int64) (*checkpoint.Checkpoint, error)

FetchCheckpoint fetches the checkpoint from heimdall

func (*HeimdallClient) FetchCheckpointCount

func (h *HeimdallClient) FetchCheckpointCount(ctx context.Context) (int64, error)

FetchCheckpointCount fetches the checkpoint count from heimdall

func (*HeimdallClient) FetchLastNoAckMilestone

func (h *HeimdallClient) FetchLastNoAckMilestone(ctx context.Context) (string, error)

FetchLastNoAckMilestone fetches the last no-ack-milestone from heimdall

func (*HeimdallClient) FetchMilestone

func (h *HeimdallClient) FetchMilestone(ctx context.Context) (*milestone.Milestone, error)

FetchMilestone fetches the checkpoint from heimdall

func (*HeimdallClient) FetchMilestoneCount

func (h *HeimdallClient) FetchMilestoneCount(ctx context.Context) (int64, error)

FetchMilestoneCount fetches the milestone count from heimdall

func (*HeimdallClient) FetchMilestoneID

func (h *HeimdallClient) FetchMilestoneID(ctx context.Context, milestoneID string) error

FetchMilestoneID fetches the bool result from Heimdal whether the ID corresponding to the given milestone is in process in Heimdall

func (*HeimdallClient) FetchNoAckMilestone

func (h *HeimdallClient) FetchNoAckMilestone(ctx context.Context, milestoneID string) error

FetchNoAckMilestone fetches the last no-ack-milestone from heimdall

func (*HeimdallClient) Span

func (h *HeimdallClient) Span(ctx context.Context, spanID uint64) (*span.HeimdallSpan, error)

func (*HeimdallClient) StateSyncEvents

func (h *HeimdallClient) StateSyncEvents(ctx context.Context, fromID uint64, to int64) ([]*clerk.EventRecordWithTime, error)

type Request

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

type SpanResponse

type SpanResponse struct {
	Height string            `json:"height"`
	Result span.HeimdallSpan `json:"result"`
}

type StateSyncEventsResponse

type StateSyncEventsResponse struct {
	Height string                       `json:"height"`
	Result []*clerk.EventRecordWithTime `json:"result"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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