store

package
v0.10.16-rc1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: MIT Imports: 19 Imported by: 12

Documentation

Overview

Package store is used to keep application events in sync between the database on the node and the blockchain.

Config

Config contains the local configuration options that the application will adhere to.

CallerSubscriberClient

This makes use of Go-Ethereum's functions to interact with the blockchain. The underlying functions can be viewed here:

go-ethereum/rpc/client.go

KeyStore

KeyStore also utilizes Go-Ethereum's functions to store encrypted keys on the local file system. The underlying functions can be viewed here:

go-ethereum/accounts/keystore/keystore.go

Store

The Store is the persistence layer for the application. It saves the the application state and most interaction with the node needs to occur through the store.

Tx Manager

The transaction manager is used to syncronize interactions on the Ethereum blockchain with the application and database.

Index

Constants

View Source
const (
	// AutoMigrate is a flag that automatically migrates the DB when passed to initializeORM
	AutoMigrate = "auto_migrate"
)

Variables

This section is empty.

Functions

func CheckSquashUpgrade added in v0.10.0

func CheckSquashUpgrade(db *gorm.DB) error

Types

type Store

type Store struct {
	*orm.ORM
	Config         *config.Config
	Clock          utils.AfterNower
	AdvisoryLocker postgres.AdvisoryLocker
	// contains filtered or unexported fields
}

Store contains fields for the database, Config for keeping the application state in sync with the database.

func NewInsecureStore added in v0.8.2

func NewInsecureStore(config *config.Config, ethClient eth.Client, advisoryLocker postgres.AdvisoryLocker, shutdownSignal gracefulpanic.Signal) (*Store, error)

NewInsecureStore creates a new store with the given config using an insecure keystore. NOTE: Should only be used for testing!

func NewStore

func NewStore(config *config.Config, ethClient eth.Client, advisoryLock postgres.AdvisoryLocker, shutdownSignal gracefulpanic.Signal) (*Store, error)

NewStore will create a new store func NewStore(config *config.Config, ethClient eth.Client, advisoryLock postgres.AdvisoryLocker, shutdownSignal gracefulpanic.Signal, keyStoreGenerator KeyStoreGenerator) (*Store, error) {

func (*Store) AuthorizedUserWithSession

func (s *Store) AuthorizedUserWithSession(sessionID string) (models.User, error)

AuthorizedUserWithSession will return the one API user if the Session ID exists and hasn't expired, and update session's LastUsed field.

func (*Store) Close

func (s *Store) Close() error

Close shuts down all of the working parts of the store.

func (*Store) Healthy added in v0.10.8

func (s *Store) Healthy() error

func (*Store) Ready added in v0.10.8

func (s *Store) Ready() error

func (*Store) Start

func (s *Store) Start() error

Start initiates all of Store's dependencies

func (*Store) Unscoped

func (s *Store) Unscoped() *Store

Unscoped returns a shallow copy of the store, with an unscoped ORM allowing one to work with soft deleted records.

Directories

Path Synopsis
Package models contain the key job components used by the Chainlink application.
Package models contain the key job components used by the Chainlink application.
Package presenters allow for the specification and result of a Job, its associated TaskSpecs, and every JobRun and TaskRun to be returned in a user friendly human readable format.
Package presenters allow for the specification and result of a Job, its associated TaskSpecs, and every JobRun and TaskRun to be returned in a user friendly human readable format.

Jump to

Keyboard shortcuts

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