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.
EthClient ¶
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
- Variables
- func ExtractERC20BalanceTargetAddress(args interface{}) (common.Address, bool)
- type AttemptState
- type CallerSubscriber
- type Config
- func (c Config) AllowOrigins() string
- func (c Config) BridgeResponseURL() *url.URL
- func (c Config) CertFile() string
- func (c Config) ChainID() uint64
- func (c Config) ClientNodeURL() string
- func (c Config) CreateProductionLogger() *zap.Logger
- func (c Config) DatabaseTimeout() time.Duration
- func (c Config) DatabaseURL() string
- func (c Config) DefaultHTTPLimit() int64
- func (c Config) Dev() bool
- func (c Config) EthGasBumpThreshold() uint64
- func (c Config) EthGasBumpWei() *big.Int
- func (c Config) EthGasPriceDefault() *big.Int
- func (c Config) EthereumURL() string
- func (c Config) ExplorerAccessKey() string
- func (c Config) ExplorerSecret() string
- func (c Config) ExplorerURL() *url.URL
- func (c Config) JSONConsole() bool
- func (c Config) KeyFile() string
- func (c Config) KeysDir() string
- func (c Config) LinkContractAddress() string
- func (c Config) LogLevel() LogLevel
- func (c Config) LogSQLStatements() bool
- func (c Config) LogToDisk() bool
- func (c Config) MaximumServiceDuration() time.Duration
- func (c Config) MinIncomingConfirmations() uint32
- func (c Config) MinOutgoingConfirmations() uint64
- func (c Config) MinimumContractPayment() *assets.Link
- func (c Config) MinimumRequestExpiration() uint64
- func (c Config) MinimumServiceDuration() time.Duration
- func (c Config) NormalizedDatabaseURL() string
- func (c Config) OracleContractAddress() *common.Address
- func (c Config) Port() uint16
- func (c Config) ReaperExpiration() time.Duration
- func (c Config) RootDir() string
- func (c Config) SecureCookies() bool
- func (c Config) SessionOptions() sessions.Options
- func (c Config) SessionSecret() ([]byte, error)
- func (c Config) SessionTimeout() time.Duration
- func (c Config) Set(name string, value interface{})
- func (c Config) TLSCertPath() string
- func (c Config) TLSHost() string
- func (c Config) TLSKeyPath() string
- func (c Config) TLSPort() uint16
- type ConfigSchema
- type Contract
- type Dialer
- type EthClient
- func (eth *EthClient) GetBlockByNumber(hex string) (models.BlockHeader, error)
- func (eth *EthClient) GetBlockNumber() (uint64, error)
- func (eth *EthClient) GetChainID() (uint64, error)
- func (eth *EthClient) GetERC20Balance(address common.Address, contractAddress common.Address) (*big.Int, error)
- func (eth *EthClient) GetEthBalance(address common.Address) (*assets.Eth, error)
- func (eth *EthClient) GetLogs(q ethereum.FilterQuery) ([]models.Log, error)
- func (eth *EthClient) GetNonce(address common.Address) (uint64, error)
- func (eth *EthClient) GetTxReceipt(hash common.Hash) (*models.TxReceipt, error)
- func (eth *EthClient) GetWeiBalance(address common.Address) (*big.Int, error)
- func (eth *EthClient) SendRawTx(hex string) (common.Hash, error)
- func (eth *EthClient) SubscribeToLogs(channel chan<- models.Log, q ethereum.FilterQuery) (models.EthSubscription, error)
- func (eth *EthClient) SubscribeToNewHeads(channel chan<- models.BlockHeader) (models.EthSubscription, error)
- type EthDialer
- type EthTxManager
- func (txm *EthTxManager) BumpGasUntilSafe(hash common.Hash) (*models.TxReceipt, AttemptState, error)
- func (txm *EthTxManager) CheckAttempt(txAttempt *models.TxAttempt, blockHeight uint64) (*models.TxReceipt, AttemptState, error)
- func (txm *EthTxManager) Connect(bn *models.Head) error
- func (txm *EthTxManager) Connected() bool
- func (txm *EthTxManager) ContractLINKBalance(wr models.WithdrawalRequest) (assets.Link, error)
- func (txm *EthTxManager) CreateTx(to common.Address, data []byte) (*models.Tx, error)
- func (txm *EthTxManager) CreateTxWithEth(from, to common.Address, value *assets.Eth) (*models.Tx, error)
- func (txm *EthTxManager) CreateTxWithGas(surrogateID null.String, to common.Address, data []byte, gasPriceWei *big.Int, ...) (*models.Tx, error)
- func (txm *EthTxManager) Disconnect()
- func (txm *EthTxManager) GetETHAndLINKBalances(address common.Address) (*big.Int, *assets.Link, error)
- func (txm *EthTxManager) GetLINKBalance(address common.Address) (*assets.Link, error)
- func (txm *EthTxManager) NextActiveAccount() *ManagedAccount
- func (txm *EthTxManager) OnNewHead(*models.Head)
- func (txm *EthTxManager) Register(accts []accounts.Account)
- func (txm *EthTxManager) WithdrawLINK(wr models.WithdrawalRequest) (common.Hash, error)
- type HeadTrackable
- type KeyStore
- func (ks *KeyStore) GetAccounts() []accounts.Account
- func (ks *KeyStore) GetFirstAccount() (accounts.Account, error)
- func (ks *KeyStore) HasAccounts() bool
- func (ks *KeyStore) NewAccount(passphrase string) (accounts.Account, error)
- func (ks *KeyStore) Sign(input []byte) (models.Signature, error)
- func (ks *KeyStore) SignTx(account accounts.Account, tx *types.Transaction, chainID uint64) (*types.Transaction, error)
- func (ks *KeyStore) Unlock(phrase string) error
- type LogLevel
- type ManagedAccount
- type QueuedRunChannel
- type RunChannel
- type RunRequest
- type SecretGenerator
- type Store
- type TxManager
Constants ¶
const DefaultGasLimit uint64 = 500000
DefaultGasLimit sets the default gas limit for outgoing transactions. if updating DefaultGasLimit, be sure it matches with the DefaultGasLimit specified in evm/test/Oracle_test.js
Variables ¶
var ErrPendingConnection = errors.New("Cannot talk to chain, pending connection")
ErrPendingConnection is the error returned if TxManager is not connected.
var Sha = "unset"
Sha string "unset"
var Version = "unset"
Version the version of application
Functions ¶
func ExtractERC20BalanceTargetAddress ¶
ExtractERC20BalanceTargetAddress returns the address whose balance is being queried by the message in the given call to an ERC20 contract, which is interpreted as a callArgs.
Types ¶
type AttemptState ¶
type AttemptState int
AttemptState enumerates the possible states of a transaction attempt as it gets accepted and confirmed by the blockchain
const ( // Unknown is returned when the state of a transaction could not be // determined because of an error Unknown AttemptState = iota // Unconfirmed means that a transaction has had no confirmations at all Unconfirmed // Confirmed means that a transaftion has had at least one transaction, but // not enough to satisfy the minimum number of confirmations configuration // option Confirmed // Safe has the required number of confirmations or more Safe )
func (AttemptState) String ¶
func (a AttemptState) String() string
String conforms to the Stringer interface for AttemptState
type CallerSubscriber ¶
type CallerSubscriber interface { Call(result interface{}, method string, args ...interface{}) error EthSubscribe(context.Context, interface{}, ...interface{}) (models.EthSubscription, error) }
CallerSubscriber implements the Call and EthSubscribe functions. Call performs a JSON-RPC call with the given arguments and EthSubscribe registers a subscription.
type Config ¶
type Config struct { SecretGenerator SecretGenerator // contains filtered or unexported fields }
Config holds parameters used by the application which can be overridden by setting environment variables.
If you add an entry here which does not contain sensitive information, you should also update presenters.ConfigWhitelist and cmd_test.TestClient_RunNodeShowsEnv.
func NewConfig ¶
func NewConfig() Config
NewConfig returns the config with the environment variables set to their respective fields, or their defaults if environment variables are not set.
func (Config) AllowOrigins ¶
AllowOrigins returns the CORS hosts used by the frontend.
func (Config) BridgeResponseURL ¶
BridgeResponseURL represents the URL for bridges to send a response to.
func (Config) ClientNodeURL ¶
ClientNodeURL is the URL of the Ethereum node this Chainlink node should connect to.
func (Config) CreateProductionLogger ¶
CreateProductionLogger returns a custom logger for the config's root directory and LogLevel, with pretty printing for stdout. If LOG_TO_DISK is false, the logger will only log to stdout.
func (Config) DatabaseTimeout ¶
DatabaseTimeout represents how long to tolerate non response from the DB.
func (Config) DatabaseURL ¶
DatabaseURL configures the URL for chainlink to connect to. This must be a properly formatted URL, with a valid scheme (postgres://, file://), or an empty string, so the application defaults to .chainlink/db.sqlite.
func (Config) DefaultHTTPLimit ¶
DefaultHTTPLimit defines the limit for HTTP requests.
func (Config) EthGasBumpThreshold ¶
EthGasBumpThreshold represents the maximum amount a transaction's ETH amount should be increased in order to facilitate a transaction.
func (Config) EthGasBumpWei ¶
EthGasBumpWei represents the intervals in which ETH should be increased when doing gas bumping.
func (Config) EthGasPriceDefault ¶
EthGasPriceDefault represents the default gas price for transactions.
func (Config) EthereumURL ¶
EthereumURL represents the URL of the Ethereum node to connect Chainlink to.
func (Config) ExplorerAccessKey ¶
ExplorerAccessKey returns the access key for authenticating with explorer
func (Config) ExplorerSecret ¶
ExplorerSecret returns the secret for authenticating with explorer
func (Config) ExplorerURL ¶
ExplorerURL returns the websocket URL for this node to push stats to, or nil.
func (Config) JSONConsole ¶
JSONConsole enables the JSON console.
func (Config) LinkContractAddress ¶
LinkContractAddress represents the address
func (Config) LogSQLStatements ¶
LogSQLStatements tells chainlink to log all SQL statements made using the default logger
func (Config) MaximumServiceDuration ¶
MaximumServiceDuration is the maximum time that a service agreement can run from after the time it is created. Default 1 year = 365 * 24h = 8760h
func (Config) MinIncomingConfirmations ¶
MinIncomingConfirmations represents the minimum number of block confirmations that need to be recorded since a job run started before a task can proceed.
func (Config) MinOutgoingConfirmations ¶
MinOutgoingConfirmations represents the minimum number of block confirmations that need to be recorded on an outgoing transaction before a task is completed.
func (Config) MinimumContractPayment ¶
MinimumContractPayment represents the minimum amount of ETH that must be supplied for a contract to be considered.
func (Config) MinimumRequestExpiration ¶
MinimumRequestExpiration is the minimum allowed request expiration for a Service Agreement.
func (Config) MinimumServiceDuration ¶
MinimumServiceDuration is the shortest duration from now that a service is allowed to run.
func (Config) NormalizedDatabaseURL ¶
NormalizedDatabaseURL returns the DatabaseURL with the empty default coerced to a sqlite3 URL.
func (Config) OracleContractAddress ¶
OracleContractAddress represents the deployed Oracle contract's address.
func (Config) ReaperExpiration ¶
ReaperExpiration represents
func (Config) RootDir ¶
RootDir represents the location on the file system where Chainlink should keep its files.
func (Config) SecureCookies ¶
SecureCookies allows toggling of the secure cookies HTTP flag
func (Config) SessionOptions ¶
SessionOptions returns the sesssions.Options struct used to configure the session store.
func (Config) SessionSecret ¶
SessionSecret returns a sequence of bytes to be used as a private key for session signing or encryption.
func (Config) SessionTimeout ¶
SessionTimeout is the maximum duration that a user session can persist without any activity.
func (Config) TLSCertPath ¶
TLSCertPath represents the file system location of the TLS certificate Chainlink should use for HTTPS.
func (Config) TLSHost ¶
TLSHost represents the hostname to use for TLS clients. This should match the TLS certificate.
func (Config) TLSKeyPath ¶
TLSKeyPath represents the file system location of the TLS key Chainlink should use for HTTPS.
type ConfigSchema ¶
type ConfigSchema struct { AllowOrigins string `env:"ALLOW_ORIGINS" default:"http://localhost:3000,http://localhost:6688"` BridgeResponseURL url.URL `env:"BRIDGE_RESPONSE_URL"` ChainID uint64 `env:"ETH_CHAIN_ID" default:"0"` ClientNodeURL string `env:"CLIENT_NODE_URL" default:"http://localhost:6688"` DatabaseTimeout time.Duration `env:"DATABASE_TIMEOUT" default:"500ms"` DatabaseURL string `env:"DATABASE_URL"` DefaultHTTPLimit int64 `env:"DEFAULT_HTTP_LIMIT" default:"32768"` Dev bool `env:"CHAINLINK_DEV" default:"false"` MaximumServiceDuration time.Duration `env:"MAXIMUM_SERVICE_DURATION" default:"8760h" ` MinimumServiceDuration time.Duration `env:"MINIMUM_SERVICE_DURATION" default:"0s" ` EthGasBumpThreshold uint64 `env:"ETH_GAS_BUMP_THRESHOLD" default:"12" ` EthGasBumpWei big.Int `env:"ETH_GAS_BUMP_WEI" default:"5000000000"` EthGasPriceDefault big.Int `env:"ETH_GAS_PRICE_DEFAULT" default:"20000000000"` EthereumURL string `env:"ETH_URL" default:"ws://localhost:8546"` JSONConsole bool `env:"JSON_CONSOLE" default:"false"` LinkContractAddress string `env:"LINK_CONTRACT_ADDRESS" default:"0x514910771AF9Ca656af840dff83E8264EcF986CA"` ExplorerURL *url.URL `env:"EXPLORER_URL"` ExplorerAccessKey string `env:"EXPLORER_ACCESS_KEY"` ExplorerSecret string `env:"EXPLORER_SECRET"` LogLevel LogLevel `env:"LOG_LEVEL" default:"info"` LogToDisk bool `env:"LOG_TO_DISK" default:"true"` LogSQLStatements bool `env:"LOG_SQL" default:"false"` MinIncomingConfirmations uint32 `env:"MIN_INCOMING_CONFIRMATIONS" default:"3"` MinOutgoingConfirmations uint64 `env:"MIN_OUTGOING_CONFIRMATIONS" default:"12"` MinimumContractPayment assets.Link `env:"MINIMUM_CONTRACT_PAYMENT" default:"1000000000000000000"` MinimumRequestExpiration uint64 `env:"MINIMUM_REQUEST_EXPIRATION" default:"300" ` OracleContractAddress common.Address `env:"ORACLE_CONTRACT_ADDRESS"` Port uint16 `env:"CHAINLINK_PORT" default:"6688"` ReaperExpiration time.Duration `env:"REAPER_EXPIRATION" default:"240h"` RootDir string `env:"ROOT" default:"~/.chainlink"` SecureCookies bool `env:"SECURE_COOKIES" default:"true"` SessionTimeout time.Duration `env:"SESSION_TIMEOUT" default:"15m"` TLSCertPath string `env:"TLS_CERT_PATH" ` TLSHost string `env:"CHAINLINK_TLS_HOST" ` TLSKeyPath string `env:"TLS_KEY_PATH" ` TLSPort uint16 `env:"CHAINLINK_TLS_PORT" default:"6689"` }
ConfigSchema records the schema of configuration at the type level
type Contract ¶
Contract holds the solidity contract's parsed ABI
func GetContract ¶
GetContract loads the contract JSON file from ../evm/build/contracts and parses the ABI JSON contents into an abi.ABI object
type Dialer ¶
type Dialer interface {
Dial(string) (CallerSubscriber, error)
}
Dialer implements Dial which is a function that creates a client for that url
type EthClient ¶
type EthClient struct {
CallerSubscriber
}
EthClient holds the CallerSubscriber interface for the Ethereum blockchain.
func (*EthClient) GetBlockByNumber ¶
func (eth *EthClient) GetBlockByNumber(hex string) (models.BlockHeader, error)
GetBlockByNumber returns the block for the passed hex, or "latest", "earliest", "pending".
func (*EthClient) GetBlockNumber ¶
GetBlockNumber returns the block number of the chain head.
func (*EthClient) GetChainID ¶
GetChainID returns the ethereum ChainID.
func (*EthClient) GetERC20Balance ¶
func (eth *EthClient) GetERC20Balance(address common.Address, contractAddress common.Address) (*big.Int, error)
GetERC20Balance returns the balance of the given address for the token contract address.
func (*EthClient) GetEthBalance ¶
GetEthBalance returns the balance of the given addresses in Ether.
func (*EthClient) GetTxReceipt ¶
GetTxReceipt returns the transaction receipt for the given transaction hash.
func (*EthClient) GetWeiBalance ¶
GetWeiBalance returns the balance of the given address in Wei.
func (*EthClient) SubscribeToLogs ¶
func (eth *EthClient) SubscribeToLogs( channel chan<- models.Log, q ethereum.FilterQuery, ) (models.EthSubscription, error)
SubscribeToLogs registers a subscription for push notifications of logs from a given address.
func (*EthClient) SubscribeToNewHeads ¶
func (eth *EthClient) SubscribeToNewHeads( channel chan<- models.BlockHeader, ) (models.EthSubscription, error)
SubscribeToNewHeads registers a subscription for push notifications of new blocks.
type EthTxManager ¶
type EthTxManager struct { *EthClient // contains filtered or unexported fields }
EthTxManager contains fields for the Ethereum client, the KeyStore, the local Config for the application, and the database.
func NewEthTxManager ¶
func NewEthTxManager(ethClient *EthClient, config Config, keyStore *KeyStore, orm *orm.ORM) *EthTxManager
NewEthTxManager constructs an EthTxManager using the passed variables and initializing internal variables.
func (*EthTxManager) BumpGasUntilSafe ¶
func (txm *EthTxManager) BumpGasUntilSafe(hash common.Hash) (*models.TxReceipt, AttemptState, error)
BumpGasUntilSafe process a collection of related TxAttempts, trying to get at least one TxAttempt into a safe state, bumping gas if needed
func (*EthTxManager) CheckAttempt ¶
func (txm *EthTxManager) CheckAttempt(txAttempt *models.TxAttempt, blockHeight uint64) (*models.TxReceipt, AttemptState, error)
CheckAttempt retrieves a receipt for a TxAttempt, and check if it meets the minimum number of confirmations
func (*EthTxManager) Connect ¶
func (txm *EthTxManager) Connect(bn *models.Head) error
Connect iterates over the available accounts to retrieve their nonce for client side management.
func (*EthTxManager) Connected ¶
func (txm *EthTxManager) Connected() bool
Connected returns a bool indicating whether or not it is connected.
func (*EthTxManager) ContractLINKBalance ¶
func (txm *EthTxManager) ContractLINKBalance(wr models.WithdrawalRequest) (assets.Link, error)
ContractLINKBalance returns the balance for the contract associated with this withdrawal request, or any errors
func (*EthTxManager) CreateTxWithEth ¶
func (txm *EthTxManager) CreateTxWithEth(from, to common.Address, value *assets.Eth) (*models.Tx, error)
CreateTxWithEth signs and sends a transaction with some ETH to transfer.
func (*EthTxManager) CreateTxWithGas ¶
func (txm *EthTxManager) CreateTxWithGas(surrogateID null.String, to common.Address, data []byte, gasPriceWei *big.Int, gasLimit uint64) (*models.Tx, error)
CreateTxWithGas signs and sends a transaction to the Ethereum blockchain.
func (*EthTxManager) Disconnect ¶
func (txm *EthTxManager) Disconnect()
Disconnect marks this instance as disconnected.
func (*EthTxManager) GetETHAndLINKBalances ¶
func (txm *EthTxManager) GetETHAndLINKBalances(address common.Address) (*big.Int, *assets.Link, error)
GetETHAndLINKBalances attempts to retrieve the ethereum node's perception of the latest ETH and LINK balances for the active account on the txm, or an error on failure.
func (*EthTxManager) GetLINKBalance ¶
GetLINKBalance returns the balance of LINK at the given address
func (*EthTxManager) NextActiveAccount ¶
func (txm *EthTxManager) NextActiveAccount() *ManagedAccount
NextActiveAccount uses round robin to select a managed account from the list of available accounts as defined in Register(...)
func (*EthTxManager) OnNewHead ¶
func (txm *EthTxManager) OnNewHead(*models.Head)
OnNewHead does nothing; exists to comply with interface.
func (*EthTxManager) Register ¶
func (txm *EthTxManager) Register(accts []accounts.Account)
Register activates accounts for outgoing transactions and client side nonce management.
func (*EthTxManager) WithdrawLINK ¶
func (txm *EthTxManager) WithdrawLINK(wr models.WithdrawalRequest) (common.Hash, error)
WithdrawLINK withdraws the given amount of LINK from the contract to the configured withdrawal address. If wr.ContractAddress is empty (zero address), funds are withdrawn from configured OracleContractAddress.
type HeadTrackable ¶
HeadTrackable represents any object that wishes to respond to ethereum events, after being attached to HeadTracker.
type KeyStore ¶
KeyStore manages a key storage directory on disk.
func NewKeyStore ¶
NewKeyStore creates a keystore for the given directory.
func (*KeyStore) GetAccounts ¶
GetAccounts returns all accounts
func (*KeyStore) GetFirstAccount ¶
GetFirstAccount returns the unlocked account in the KeyStore object. The client ensures that an account exists during authentication.
func (*KeyStore) HasAccounts ¶
HasAccounts returns true if there are accounts located at the keystore directory.
func (*KeyStore) NewAccount ¶
NewAccount adds an account to the keystore
type ManagedAccount ¶
ManagedAccount holds the account information alongside a client managed nonce to coordinate outgoing transactions.
func NewManagedAccount ¶
func NewManagedAccount(a accounts.Account, nonce uint64) *ManagedAccount
NewManagedAccount creates a managed account that handles nonce increments locally.
func (*ManagedAccount) GetAndIncrementNonce ¶
func (a *ManagedAccount) GetAndIncrementNonce(callback func(uint64) error) error
GetAndIncrementNonce will Yield the current nonce to a callback function and increment it once the callback has finished executing
func (*ManagedAccount) Nonce ¶
func (a *ManagedAccount) Nonce() uint64
Nonce returns the client side managed nonce.
func (*ManagedAccount) ReloadNonce ¶
func (a *ManagedAccount) ReloadNonce(txm *EthTxManager) error
ReloadNonce fetch and update the current nonce via eth_getTransactionCount
type QueuedRunChannel ¶
type QueuedRunChannel struct {
// contains filtered or unexported fields
}
QueuedRunChannel manages incoming results and blocks by enqueuing them in a queue per run.
func (*QueuedRunChannel) Close ¶
func (rq *QueuedRunChannel) Close()
Close closes the QueuedRunChannel so that no runs can be added to it without throwing an error.
func (*QueuedRunChannel) Receive ¶
func (rq *QueuedRunChannel) Receive() <-chan RunRequest
Receive returns a channel for listening to sent runs.
func (*QueuedRunChannel) Send ¶
func (rq *QueuedRunChannel) Send(jobRunID string) error
Send adds another entry to the queue of runs.
type RunChannel ¶
type RunChannel interface { Send(jobRunID string) error Receive() <-chan RunRequest Close() }
RunChannel manages and dispatches incoming runs.
func NewQueuedRunChannel ¶
func NewQueuedRunChannel() RunChannel
NewQueuedRunChannel initializes a QueuedRunChannel.
type RunRequest ¶
type RunRequest struct {
ID string
}
RunRequest is the type that the RunChannel uses to package all the necessary pieces to execute a Job Run.
type SecretGenerator ¶
SecretGenerator is the interface for objects that generate a secret used to sign or encrypt.
type Store ¶
type Store struct { *orm.ORM Config Config Clock utils.AfterNower KeyStore *KeyStore RunChannel RunChannel TxManager TxManager StatsPusher *synchronization.StatsPusher }
Store contains fields for the database, Config, KeyStore, and TxManager for keeping the application state in sync with the database.
func NewStore ¶
NewStore will create a new database file at the config's RootDir if it is not already present, otherwise it will use the existing db.sqlite3 file.
func NewStoreWithDialer ¶
NewStoreWithDialer creates a new store with the given config and dialer
func (*Store) AuthorizedUserWithSession ¶
AuthorizedUserWithSession will return the one API user if the Session ID exists and hasn't expired, and update session's LastUsed field.
func (*Store) SyncDiskKeyStoreToDB ¶
SyncDiskKeyStoreToDB writes all keys in the keys directory to the underlying orm.
type TxManager ¶
type TxManager interface { HeadTrackable Connected() bool Register(accounts []accounts.Account) CreateTx(to common.Address, data []byte) (*models.Tx, error) CreateTxWithGas(surrogateID null.String, to common.Address, data []byte, gasPriceWei *big.Int, gasLimit uint64) (*models.Tx, error) CreateTxWithEth(from, to common.Address, value *assets.Eth) (*models.Tx, error) CheckAttempt(txAttempt *models.TxAttempt, blockHeight uint64) (*models.TxReceipt, AttemptState, error) BumpGasUntilSafe(hash common.Hash) (*models.TxReceipt, AttemptState, error) ContractLINKBalance(wr models.WithdrawalRequest) (assets.Link, error) WithdrawLINK(wr models.WithdrawalRequest) (common.Hash, error) GetLINKBalance(address common.Address) (*assets.Link, error) NextActiveAccount() *ManagedAccount GetEthBalance(address common.Address) (*assets.Eth, error) SubscribeToNewHeads(channel chan<- models.BlockHeader) (models.EthSubscription, error) GetBlockByNumber(hex string) (models.BlockHeader, error) SubscribeToLogs(channel chan<- models.Log, q ethereum.FilterQuery) (models.EthSubscription, error) GetLogs(q ethereum.FilterQuery) ([]models.Log, error) GetTxReceipt(common.Hash) (*models.TxReceipt, error) GetChainID() (uint64, error) }
TxManager represents an interface for interacting with the blockchain
Source Files ¶
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. |