chainlink

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: MIT Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application interface {
	Start() error
	Stop() error
	GetLogger() *loggerPkg.Logger
	GetHealthChecker() health.Checker
	GetStore() *strpkg.Store
	GetEthClient() eth.Client
	GetConfig() config.GeneralConfig
	// TODO: Remove this after multichain
	// See: https://app.clubhouse.io/chainlinklabs/story/12739/generalise-necessary-models-tables-on-the-send-side-to-support-the-concept-of-multiple-chains
	GetEVMConfig() config.EVMConfig
	GetKeyStore() keystore.Master
	GetHeadBroadcaster() httypes.HeadBroadcasterRegistry
	WakeSessionReaper()
	NewBox() packr.Box

	GetExternalInitiatorManager() webhook.ExternalInitiatorManager

	// V2 Jobs (TOML specified)
	JobSpawner() job.Spawner
	JobORM() job.ORM
	EVMORM() evm.ORM
	PipelineORM() pipeline.ORM
	AddJobV2(ctx context.Context, job job.Job, name null.String) (job.Job, error)
	DeleteJob(ctx context.Context, jobID int32) error
	RunWebhookJobV2(ctx context.Context, jobUUID uuid.UUID, requestBody string, meta pipeline.JSONSerializable) (int64, error)
	ResumeJobV2(ctx context.Context, taskID uuid.UUID, result interface{}) error
	// Testing only
	RunJobV2(ctx context.Context, jobID int32, meta map[string]interface{}) (int64, error)
	SetServiceLogger(ctx context.Context, service string, level zapcore.Level) error

	// Feeds
	GetFeedsService() feeds.Service

	// ReplayFromBlock of blocks
	ReplayFromBlock(number uint64) error
}

Application implements the common functions used in the core node.

func NewApplication

func NewApplication(logger *loggerPkg.Logger, cfg config.EVMConfig, ethClient eth.Client, advisoryLocker postgres.AdvisoryLocker) (Application, error)

NewApplication initializes a new store if one is not already present at the configured root directory (default: ~/.chainlink), the logger at the same directory and returns the Application to be used by the node. TODO: Pass the DB object in here, see: https://app.clubhouse.io/chainlinklabs/story/12980/remove-store-object-entirely

type ChainlinkApplication

type ChainlinkApplication struct {
	Exiter           func(int)
	HeadTracker      httypes.Tracker
	HeadBroadcaster  httypes.HeadBroadcaster
	TxManager        bulletprooftxmanager.TxManager
	LogBroadcaster   log.Broadcaster
	EventBroadcaster postgres.EventBroadcaster

	FeedsService feeds.Service

	Store                    *strpkg.Store
	Config                   config.GeneralConfig
	EVMConfig                config.EVMConfig
	KeyStore                 keystore.Master
	ExternalInitiatorManager webhook.ExternalInitiatorManager
	SessionReaper            utils.SleeperTask

	HealthChecker health.Checker
	// contains filtered or unexported fields
}

ChainlinkApplication contains fields for the JobSubscriber, Scheduler, and Store. The JobSubscriber and Scheduler are also available in the services package, but the Store has its own package.

func (*ChainlinkApplication) AddJobV2 added in v0.9.3

func (app *ChainlinkApplication) AddJobV2(ctx context.Context, j job.Job, name null.String) (job.Job, error)

func (*ChainlinkApplication) DeleteJob added in v1.0.0

func (app *ChainlinkApplication) DeleteJob(ctx context.Context, jobID int32) error

func (*ChainlinkApplication) EVMORM added in v1.0.0

func (app *ChainlinkApplication) EVMORM() evm.ORM

func (*ChainlinkApplication) GetConfig added in v0.10.11

func (app *ChainlinkApplication) GetConfig() config.GeneralConfig

func (*ChainlinkApplication) GetEVMConfig added in v1.0.0

func (app *ChainlinkApplication) GetEVMConfig() config.EVMConfig

func (*ChainlinkApplication) GetEthClient added in v0.10.11

func (app *ChainlinkApplication) GetEthClient() eth.Client

func (*ChainlinkApplication) GetExternalInitiatorManager added in v0.9.10

func (app *ChainlinkApplication) GetExternalInitiatorManager() webhook.ExternalInitiatorManager

func (*ChainlinkApplication) GetFeedsService added in v0.10.8

func (app *ChainlinkApplication) GetFeedsService() feeds.Service

func (*ChainlinkApplication) GetHeadBroadcaster added in v0.10.8

func (app *ChainlinkApplication) GetHeadBroadcaster() httypes.HeadBroadcasterRegistry

func (*ChainlinkApplication) GetHealthChecker added in v0.10.8

func (app *ChainlinkApplication) GetHealthChecker() health.Checker

func (*ChainlinkApplication) GetKeyStore added in v0.10.8

func (app *ChainlinkApplication) GetKeyStore() keystore.Master

func (*ChainlinkApplication) GetLogger added in v0.10.6

func (app *ChainlinkApplication) GetLogger() *loggerPkg.Logger

func (*ChainlinkApplication) GetStore

func (app *ChainlinkApplication) GetStore() *strpkg.Store

GetStore returns the pointer to the store for the ChainlinkApplication.

func (*ChainlinkApplication) JobORM added in v0.9.9

func (app *ChainlinkApplication) JobORM() job.ORM

func (*ChainlinkApplication) JobSpawner added in v0.10.8

func (app *ChainlinkApplication) JobSpawner() job.Spawner

func (*ChainlinkApplication) NewBox

func (app *ChainlinkApplication) NewBox() packr.Box

NewBox returns the packr.Box instance that holds the static assets to be delivered by the router.

func (*ChainlinkApplication) PipelineORM added in v0.10.8

func (app *ChainlinkApplication) PipelineORM() pipeline.ORM

func (*ChainlinkApplication) ReplayFromBlock added in v0.10.11

func (app *ChainlinkApplication) ReplayFromBlock(number uint64) error

func (*ChainlinkApplication) ResumeJobV2 added in v0.10.10

func (app *ChainlinkApplication) ResumeJobV2(
	ctx context.Context,
	taskID uuid.UUID,
	result interface{},
) error

func (*ChainlinkApplication) RunJobV2 added in v0.9.6

func (app *ChainlinkApplication) RunJobV2(
	ctx context.Context,
	jobID int32,
	meta map[string]interface{},
) (int64, error)

Only used for local testing, not supported by the UI.

func (*ChainlinkApplication) RunWebhookJobV2 added in v0.10.8

func (app *ChainlinkApplication) RunWebhookJobV2(ctx context.Context, jobUUID uuid.UUID, requestBody string, meta pipeline.JSONSerializable) (int64, error)

func (*ChainlinkApplication) SetServiceLogger added in v0.10.6

func (app *ChainlinkApplication) SetServiceLogger(ctx context.Context, serviceName string, level zapcore.Level) error

SetServiceLogger sets the Logger for a given service and stores the setting in the db

func (*ChainlinkApplication) Start

func (app *ChainlinkApplication) Start() error

Start all necessary services. If successful, nil will be returned. Also listens for interrupt signals from the operating system so that the application can be properly closed before the application exits.

func (*ChainlinkApplication) Stop

func (app *ChainlinkApplication) Stop() error

Stop allows the application to exit by halting schedules, closing logs, and closing the DB connection.

func (*ChainlinkApplication) StopIfStarted added in v0.9.9

func (app *ChainlinkApplication) StopIfStarted() error

func (*ChainlinkApplication) WakeSessionReaper

func (app *ChainlinkApplication) WakeSessionReaper()

WakeSessionReaper wakes up the reaper to do its reaping.

Jump to

Keyboard shortcuts

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