chainlink

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: MIT Imports: 50 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() logger.Logger
	GetHealthChecker() services.Checker
	GetSqlxDB() *sqlx.DB
	GetConfig() config.GeneralConfig
	SetLogLevel(lvl zapcore.Level) error
	GetKeyStore() keystore.Master
	GetEventBroadcaster() pg.EventBroadcaster
	WakeSessionReaper()
	GetWebAuthnConfiguration() sessions.WebAuthnConfiguration

	GetExternalInitiatorManager() webhook.ExternalInitiatorManager
	GetChains() Chains

	// V2 Jobs (TOML specified)
	JobSpawner() job.Spawner
	JobORM() job.ORM
	EVMORM() evmtypes.ORM
	TerraORM() terratypes.ORM
	PipelineORM() pipeline.ORM
	BridgeORM() bridges.ORM
	SessionORM() sessions.ORM
	BPTXMORM() bulletprooftxmanager.ORM
	AddJobV2(ctx context.Context, job *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 pipeline.Result) error
	// Testing only
	RunJobV2(ctx context.Context, jobID int32, meta map[string]interface{}) (int64, error)
	SetServiceLogLevel(ctx context.Context, service string, level zapcore.Level) error

	// Feeds
	GetFeedsService() feeds.Service

	// ReplayFromBlock of blocks
	ReplayFromBlock(chainID *big.Int, number uint64) error

	// ID is unique to this particular application instance
	ID() uuid.UUID
}

Application implements the common functions used in the core node.

func NewApplication

func NewApplication(opts ApplicationOpts) (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: Inject more dependencies here to save booting up useless stuff in tests

type ApplicationOpts added in v1.1.0

type ApplicationOpts struct {
	Config                   config.GeneralConfig
	EventBroadcaster         pg.EventBroadcaster
	SqlxDB                   *sqlx.DB
	KeyStore                 keystore.Master
	Chains                   Chains
	Logger                   logger.Logger
	ExternalInitiatorManager webhook.ExternalInitiatorManager
	Version                  string
}

type ChainlinkApplication

type ChainlinkApplication struct {
	Chains           Chains
	EventBroadcaster pg.EventBroadcaster

	FeedsService feeds.Service

	Config                   config.GeneralConfig
	KeyStore                 keystore.Master
	ExternalInitiatorManager webhook.ExternalInitiatorManager
	SessionReaper            utils.SleeperTask

	HealthChecker services.Checker
	Nurse         *services.Nurse
	// 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) error

func (*ChainlinkApplication) BPTXMORM added in v1.1.0

func (*ChainlinkApplication) BridgeORM added in v1.1.0

func (app *ChainlinkApplication) BridgeORM() bridges.ORM

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() evmtypes.ORM

func (*ChainlinkApplication) GetChains added in v1.2.0

func (app *ChainlinkApplication) GetChains() Chains

GetChains returns Chains.

func (*ChainlinkApplication) GetConfig added in v0.10.11

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

func (*ChainlinkApplication) GetEventBroadcaster added in v1.1.0

func (app *ChainlinkApplication) GetEventBroadcaster() pg.EventBroadcaster

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) GetHealthChecker added in v0.10.8

func (app *ChainlinkApplication) GetHealthChecker() services.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() logger.Logger

func (*ChainlinkApplication) GetSqlxDB added in v1.1.0

func (app *ChainlinkApplication) GetSqlxDB() *sqlx.DB

func (*ChainlinkApplication) GetWebAuthnConfiguration added in v1.1.0

func (app *ChainlinkApplication) GetWebAuthnConfiguration() sessions.WebAuthnConfiguration

Returns the configuration to use for creating and authenticating new WebAuthn credentials

func (*ChainlinkApplication) ID added in v1.1.0

func (app *ChainlinkApplication) ID() uuid.UUID

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) PipelineORM added in v0.10.8

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

func (*ChainlinkApplication) ReplayFromBlock added in v0.10.11

func (app *ChainlinkApplication) ReplayFromBlock(chainID *big.Int, number uint64) error

func (*ChainlinkApplication) ResumeJobV2 added in v0.10.10

func (app *ChainlinkApplication) ResumeJobV2(
	ctx context.Context,
	taskID uuid.UUID,
	result pipeline.Result,
) 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) SessionORM added in v1.1.0

func (app *ChainlinkApplication) SessionORM() sessions.ORM

func (*ChainlinkApplication) SetLogLevel added in v1.1.0

func (app *ChainlinkApplication) SetLogLevel(lvl zapcore.Level) error

func (*ChainlinkApplication) SetServiceLogLevel added in v1.1.0

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

SetServiceLogLevel sets the Logger level 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) TerraORM added in v1.2.0

func (app *ChainlinkApplication) TerraORM() terratypes.ORM

TerraORM returns the Terra ORM.

func (*ChainlinkApplication) WakeSessionReaper

func (app *ChainlinkApplication) WakeSessionReaper()

WakeSessionReaper wakes up the reaper to do its reaping.

type Chains added in v1.2.0

type Chains struct {
	EVM   evm.ChainSet
	Terra terra.ChainSet
}

Chains holds a ChainSet for each type of chain.

Jump to

Keyboard shortcuts

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