api

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventService

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

func NewEventService

func NewEventService(params EventServiceParams) *EventService

func (*EventService) Subscribe

func (s *EventService) Subscribe(ctx context.Context, opts api.SubscribeOptions) (<-chan api.Event, error)

func (*EventService) Type

func (s *EventService) Type() api.ServiceType

type EventServiceParams

type EventServiceParams struct {
	Logger    log.Logger
	Database  database.Beginner
	Partition string
	EventBus  *events.Bus
}

type Faucet

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

Faucet implements api.Faucet.

Faucet aggregates faucet transactions and sends them once per block to ensure the correct ordering of signatures. Otherwise, the transactions could be reordered and fail due to timestamp/nonce errors. When a user submits a faucet request, the faucet appends the transaction and signature to the current batch, which is submitted to the network after receiving a block event.

func NewFaucet

func NewFaucet(ctx context.Context, params FaucetParams) (*Faucet, error)

NewFaucet creates a new Faucet with the given parameters.

Callers must call Faucet.Stop or cancel the context when the faucet is no longer needed. Otherwise, NewFaucet will leak goroutines.

func (*Faucet) Faucet

func (f *Faucet) Faucet(ctx context.Context, account *url.URL, opts api.FaucetOptions) (*api.Submission, error)

Faucet implements api.Faucet.Faucet.

func (*Faucet) Stop

func (f *Faucet) Stop()

Stop stops the faucet.

func (*Faucet) Type

func (f *Faucet) Type() api.ServiceType

Type returns api.ServiceTypeFaucet.

type FaucetParams

type FaucetParams struct {
	Logger    log.Logger
	Account   *url.URL
	Key       build.Signer
	Submitter api.Submitter
	Querier   api.Querier
	Events    api.EventService
	Amount    uint64
}

FaucetParams are the parameters for a Faucet.

type MetricsService

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

func NewMetricsService

func NewMetricsService(params MetricsServiceParams) *MetricsService

func (*MetricsService) Metrics

func (s *MetricsService) Metrics(ctx context.Context, opts api.MetricsOptions) (*api.Metrics, error)

func (*MetricsService) Type

func (s *MetricsService) Type() api.ServiceType

type MetricsServiceParams

type MetricsServiceParams struct {
	Logger  log.Logger
	Node    api.ConsensusService
	Querier api.Querier
}

type NetworkService

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

func NewNetworkService

func NewNetworkService(params NetworkServiceParams) *NetworkService

func (*NetworkService) NetworkStatus

func (s *NetworkService) NetworkStatus(ctx context.Context, _ api.NetworkStatusOptions) (*api.NetworkStatus, error)

func (*NetworkService) Type

func (s *NetworkService) Type() api.ServiceType

type NetworkServiceParams

type NetworkServiceParams struct {
	Logger    log.Logger
	EventBus  *events.Bus
	Partition string
	Database  database.Viewer
}

type Querier

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

func NewQuerier

func NewQuerier(params QuerierParams) *Querier

func (*Querier) Query

func (s *Querier) Query(ctx context.Context, scope *url.URL, query api.Query) (api.Record, error)

func (*Querier) Type

func (s *Querier) Type() api.ServiceType

type QuerierParams

type QuerierParams struct {
	Logger    log.Logger
	Database  database.Viewer
	Partition string
	Consensus api.ConsensusService
}

type Sequencer

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

func NewSequencer

func NewSequencer(params SequencerParams) *Sequencer

func (*Sequencer) Sequence

func (s *Sequencer) Sequence(ctx context.Context, src, dst *url.URL, num uint64, _ private.SequenceOptions) (*api.MessageRecord[messaging.Message], error)

func (*Sequencer) Type

func (s *Sequencer) Type() api.ServiceType

type SequencerParams

type SequencerParams struct {
	Logger       log.Logger
	Database     database.Viewer
	EventBus     *events.Bus
	Globals      *core.GlobalValues
	Partition    string
	ValidatorKey []byte
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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