dispatcher

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contract

type Contract interface {
	LatestProjects() []*contract.Project
	LatestProvers() []*contract.Prover
	Project(projectID, blockNumber uint64) *contract.Project
	LatestProject(projectID uint64) *contract.Project
}

type Dispatcher

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

func New

func New(persistence Persistence, newDatasource NewDatasource,
	projectManager ProjectManager, defaultDatasourceURI, bootNodeMultiaddr, operatorPrivateKey, operatorPrivateKeyED25519, contractWhitelist string,
	defaultDatasourcePubKey []byte, iotexChainID int, projectNotification <-chan uint64, chainHeadNotification <-chan uint64,
	contract Contract, projectOffsets *scheduler.ProjectEpochOffsets) (*Dispatcher, error)

func NewLocal

func NewLocal(persistence Persistence, newDatasource NewDatasource,
	projectManager ProjectManager, defaultDatasourceURI, operatorPrivateKey, operatorPrivateKeyED25519, bootNodeMultiaddr, contractWhitelist string,
	defaultDatasourcePubKey []byte, iotexChainID int) (*Dispatcher, error)

func (*Dispatcher) Run

func (d *Dispatcher) Run()

type NewDatasource

type NewDatasource func(datasourceURI string) (datasource.Datasource, error)

type Persistence

type Persistence interface {
	Create(tl *task.StateLog, t *task.Task) error
	ProcessedTaskID(projectID uint64) (uint64, error)
	UpsertProcessedTask(projectID, taskID uint64) error
}

type ProjectManager

type ProjectManager interface {
	ProjectIDs() ([]uint64, error)
	Project(projectID uint64) (*project.Project, error)
}

Jump to

Keyboard shortcuts

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