Documentation ¶
Overview ¶
Package cmd is the front-end interface for the application as a command-line utility.
KeyStoreAuthenticator ¶
KeyStoreAuthenticator prompts the user for their password, which is used to unlock their keystore file to interact with the Ethereum blockchain. Since multiple keystore files can exist at the configured directory, the KeyStoreAuthenticator will try the password on all keystore files present.
Client ¶
Client is how the application is invoked from the command line. When you run the binary, for example `./chainlink n`, client.RunNode is called to start the Chainlink core. Similarly, running `./chainlink j` returns information on all jobs in the node, and `./chainlink s` with another argument as a JobID gives information specific to that job.
Renderer ¶
Renderer helps format and display data (based on the kind of data it is) to the command line.
Index ¶
- Variables
- func NewApp(client *Client) *cli.App
- type APIInitializer
- type AppFactory
- type BridgePresenter
- type BridgePresenters
- type CSAKeyPresenter
- type CSAKeyPresenters
- type ChainlinkAppFactory
- type ChainlinkRunner
- type ChangePasswordPrompter
- type Client
- func (cli *Client) ArchiveJobSpec(c *clipkg.Context) error
- func (cli *Client) CancelJobRun(c *clipkg.Context) error
- func (cli *Client) ChangePassword(c *clipkg.Context) (err error)
- func (cli *Client) CreateAndExportWeakVRFKey(c *cli.Context) error
- func (cli *Client) CreateBridge(c *cli.Context) (err error)
- func (cli *Client) CreateCSAKey(c *cli.Context) (err error)
- func (cli *Client) CreateETHKey(c *cli.Context) (err error)
- func (cli *Client) CreateExternalInitiator(c *clipkg.Context) (err error)
- func (cli *Client) CreateJobRun(c *clipkg.Context) (err error)
- func (cli *Client) CreateJobSpec(c *clipkg.Context) (err error)
- func (cli *Client) CreateJobV2(c *cli.Context) (err error)
- func (cli *Client) CreateOCRKeyBundle(c *cli.Context) error
- func (cli *Client) CreateP2PKey(c *cli.Context) (err error)
- func (cli *Client) CreateServiceAgreement(c *clipkg.Context) (err error)
- func (cli *Client) CreateVRFKey(c *cli.Context) error
- func (cli *Client) DeleteETHKey(c *cli.Context) (err error)
- func (cli *Client) DeleteExternalInitiator(c *clipkg.Context) (err error)
- func (cli *Client) DeleteJobV2(c *cli.Context) error
- func (cli *Client) DeleteOCRKeyBundle(c *cli.Context) error
- func (cli *Client) DeleteP2PKey(c *cli.Context) (err error)
- func (cli *Client) DeleteUser(c *clipkg.Context) (err error)
- func (cli *Client) DeleteVRFKey(c *cli.Context) error
- func (cli *Client) ExportETHKey(c *cli.Context) (err error)
- func (cli *Client) ExportOCRKey(c *cli.Context) (err error)
- func (cli *Client) ExportP2PKey(c *cli.Context) (err error)
- func (cli *Client) ExportVRFKey(c *cli.Context) error
- func (cli *Client) GetConfiguration(c *clipkg.Context) (err error)
- func (cli *Client) HardReset(c *clipkg.Context) error
- func (cli *Client) ImportETHKey(c *cli.Context) (err error)
- func (cli *Client) ImportKey(c *clipkg.Context) error
- func (cli *Client) ImportOCRKey(c *cli.Context) (err error)
- func (cli *Client) ImportP2PKey(c *cli.Context) (err error)
- func (cli *Client) ImportVRFKey(c *cli.Context) error
- func (cli *Client) IndexBridges(c *cli.Context) (err error)
- func (cli *Client) IndexJobRuns(c *clipkg.Context) error
- func (cli *Client) IndexJobSpecs(c *clipkg.Context) error
- func (cli *Client) IndexTransactions(c *cli.Context) error
- func (cli *Client) IndexTxAttempts(c *cli.Context) error
- func (cli *Client) ListCSAKeys(c *cli.Context) (err error)
- func (cli *Client) ListETHKeys(c *cli.Context) (err error)
- func (cli *Client) ListJobsV2(c *cli.Context) (err error)
- func (cli *Client) ListOCRKeyBundles(c *cli.Context) error
- func (cli *Client) ListP2PKeys(c *cli.Context) (err error)
- func (cli *Client) ListVRFKeys(c *cli.Context) error
- func (cli *Client) Migrate(c *cli.Context) error
- func (cli *Client) MigrateDatabase(c *clipkg.Context) error
- func (cli *Client) PrepareTestDatabase(c *clipkg.Context) error
- func (cli *Client) RebroadcastTransactions(c *clipkg.Context) (err error)
- func (cli *Client) RemoteLogin(c *clipkg.Context) error
- func (cli *Client) RemoveBridge(c *cli.Context) (err error)
- func (cli *Client) ResetDatabase(c *clipkg.Context) error
- func (cli *Client) RunNode(c *clipkg.Context) error
- func (cli *Client) SendEther(c *cli.Context) (err error)
- func (cli *Client) SetLogLevel(c *clipkg.Context) (err error)
- func (cli *Client) SetLogPkg(c *clipkg.Context) (err error)
- func (cli *Client) SetLogSQL(c *clipkg.Context) (err error)
- func (cli *Client) SetMinimumGasPrice(c *clipkg.Context) (err error)
- func (cli *Client) SetNextNonce(c *clipkg.Context) error
- func (cli *Client) ShowBridge(c *cli.Context) (err error)
- func (cli *Client) ShowJobRun(c *clipkg.Context) (err error)
- func (cli *Client) ShowJobSpec(c *clipkg.Context) (err error)
- func (cli *Client) ShowTransaction(c *cli.Context) (err error)
- func (cli *Client) Status(c *clipkg.Context) error
- func (cli *Client) TriggerPipelineRun(c *cli.Context) error
- func (cli *Client) VersionDatabase(c *clipkg.Context) error
- type CookieAuthenticator
- type CookieStore
- type DiskCookieStore
- type EthKeyPresenter
- type EthKeyPresenters
- type EthTxPresenter
- type EthTxPresenters
- type HTTPClient
- type HealthCheckPresenter
- type HealthCheckPresenters
- type JAID
- type JobPresenter
- type JobPresenters
- type KeyStoreAuthenticator
- type MemoryCookieStore
- type OCRKeyBundlePresenter
- type OCRKeyBundlePresenters
- type P2PKeyPresenter
- type P2PKeyPresenters
- type PasswordPrompter
- type Prompter
- type Renderer
- type RendererJSON
- type RendererTable
- type Runner
- type SessionCookieAuthenticator
- type SessionRequestBuilder
- type TableRenderer
- type TerminalKeyStoreAuthenticator
- func (auth TerminalKeyStoreAuthenticator) AuthenticateCSAKey(csaKeyStore *keystore.CSA, password string) error
- func (auth TerminalKeyStoreAuthenticator) AuthenticateEthKey(ethKeyStore *keystore.Eth, password string) (string, error)
- func (auth TerminalKeyStoreAuthenticator) AuthenticateOCRKey(ocrKeyStore *keystore.OCR, config *orm.Config, password string) error
- func (auth TerminalKeyStoreAuthenticator) AuthenticateVRFKey(vrfKeyStore *keystore.VRF, password string) error
- type VRFKeyPresenter
- type VRFKeyPresenters
Constants ¶
This section is empty.
Variables ¶
var ErrNoCredentialFile = errors.New("no API user credential file was passed")
var ( // ErrorNoAPICredentialsAvailable is returned when not run from a terminal // and no API credentials have been provided ErrorNoAPICredentialsAvailable = errors.New("API credentials must be supplied") )
Functions ¶
Types ¶
type APIInitializer ¶
type APIInitializer interface { // Initialize creates a new user for API access, or does nothing if one exists. Initialize(store *store.Store) (models.User, error) }
APIInitializer is the interface used to create the API User credentials needed to access the API. Does nothing if API user already exists.
func NewFileAPIInitializer ¶
func NewFileAPIInitializer(file string) APIInitializer
NewFileAPIInitializer creates a concrete instance of APIInitializer that pulls API user credentials from the passed file path.
func NewPromptingAPIInitializer ¶
func NewPromptingAPIInitializer(prompter Prompter) APIInitializer
NewPromptingAPIInitializer creates a concrete instance of APIInitializer that uses the terminal to solicit credentials from the user.
type AppFactory ¶
type AppFactory interface {
NewApplication(*orm.Config, ...func(chainlink.Application)) (chainlink.Application, error)
}
AppFactory implements the NewApplication method.
type BridgePresenter ¶
type BridgePresenter struct {
presenters.BridgeResource
}
func (*BridgePresenter) FriendlyConfirmations ¶
func (p *BridgePresenter) FriendlyConfirmations() string
FriendlyConfirmations converts the confirmations to a string
func (*BridgePresenter) RenderTable ¶
func (p *BridgePresenter) RenderTable(rt RendererTable) error
RenderTable implements TableRenderer
type BridgePresenters ¶
type BridgePresenters []BridgePresenter
func (BridgePresenters) RenderTable ¶
func (ps BridgePresenters) RenderTable(rt RendererTable) error
RenderTable implements TableRenderer
type CSAKeyPresenter ¶
type CSAKeyPresenter struct { JAID presenters.CSAKeyResource }
func (*CSAKeyPresenter) RenderTable ¶
func (p *CSAKeyPresenter) RenderTable(rt RendererTable) error
RenderTable implements TableRenderer
func (*CSAKeyPresenter) ToRow ¶
func (p *CSAKeyPresenter) ToRow() []string
type CSAKeyPresenters ¶
type CSAKeyPresenters []CSAKeyPresenter
func (CSAKeyPresenters) RenderTable ¶
func (ps CSAKeyPresenters) RenderTable(rt RendererTable) error
RenderTable implements TableRenderer
type ChainlinkAppFactory ¶
type ChainlinkAppFactory struct{}
ChainlinkAppFactory is used to create a new Application.
func (ChainlinkAppFactory) NewApplication ¶
func (n ChainlinkAppFactory) NewApplication(config *orm.Config, onConnectCallbacks ...func(chainlink.Application)) (chainlink.Application, error)
NewApplication returns a new instance of the node with the given config.
type ChainlinkRunner ¶
type ChainlinkRunner struct{}
ChainlinkRunner is used to run the node application.
func (ChainlinkRunner) Run ¶
func (n ChainlinkRunner) Run(app chainlink.Application) error
Run sets the log level based on config and starts the web router to listen for input and return data.
type ChangePasswordPrompter ¶
type ChangePasswordPrompter interface {
Prompt() (web.UpdatePasswordRequest, error)
}
ChangePasswordPrompter is an interface primarily used for DI to obtain a password change request from the User.
func NewChangePasswordPrompter ¶
func NewChangePasswordPrompter() ChangePasswordPrompter
NewChangePasswordPrompter returns the production password change request prompter
type Client ¶
type Client struct { Renderer Config *orm.Config AppFactory AppFactory KeyStoreAuthenticator KeyStoreAuthenticator FallbackAPIInitializer APIInitializer Runner Runner HTTP HTTPClient CookieAuthenticator CookieAuthenticator FileSessionRequestBuilder SessionRequestBuilder PromptingSessionRequestBuilder SessionRequestBuilder ChangePasswordPrompter ChangePasswordPrompter PasswordPrompter PasswordPrompter }
Client is the shell for the node, local commands and remote commands.
func (*Client) ArchiveJobSpec ¶
ArchiveJobSpec soft deletes a job and its associated runs.
func (*Client) CancelJobRun ¶
CancelJobRun cancels a running job, Run ID must be passed
func (*Client) ChangePassword ¶
ChangePassword prompts the user for the old password and a new one, then posts it to Chainlink to change the password.
func (*Client) CreateAndExportWeakVRFKey ¶
CreateAndExportWeakVRFKey creates a key in the VRF keystore, protected by the password in the password file, but with weak key-derivation-function parameters, which makes it cheaper for testing, but also more vulnerable to bruteforcing of the encrypted key material. For testing purposes only!
The key is only stored at the specified file location, not stored in the DB.
func (*Client) CreateBridge ¶
CreateBridge adds a new bridge to the chainlink node
func (*Client) CreateCSAKey ¶
CreateCSAKey creates a new CSA key
func (*Client) CreateETHKey ¶
CreateETHKey creates a new ethereum key with the same password as the one used to unlock the existing key.
func (*Client) CreateExternalInitiator ¶
CreateExternalInitiator adds an external initiator
func (*Client) CreateJobRun ¶
CreateJobRun creates job run based on SpecID and optional JSON
func (*Client) CreateJobSpec ¶
CreateJobSpec creates a JobSpec based on JSON input
func (*Client) CreateJobV2 ¶
CreateJobV2 creates a V2 job Valid input is a TOML string or a path to TOML file
func (*Client) CreateOCRKeyBundle ¶
CreateOCRKeyBundle creates a key and inserts it into encrypted_ocr_key_bundles, protected by the password in the password file
func (*Client) CreateP2PKey ¶
CreateP2PKey creates a new P2P key
func (*Client) CreateServiceAgreement ¶
CreateServiceAgreement creates a ServiceAgreement based on JSON input
func (*Client) CreateVRFKey ¶
CreateVRFKey creates a key in the VRF keystore, protected by the password in the vrf password file provided when starting the chainlink node.
func (*Client) DeleteETHKey ¶
DeleteETHKey deletes an Ethereum key, address of key must be passed
func (*Client) DeleteExternalInitiator ¶
DeleteExternalInitiator removes an external initiator
func (*Client) DeleteJobV2 ¶
DeleteJobV2 deletes a V2 job
func (*Client) DeleteOCRKeyBundle ¶
DeleteOCRKeyBundle creates a key and inserts it into encrypted_ocr_keys, protected by the password in the password file
func (*Client) DeleteP2PKey ¶
DeleteP2PKey deletes a P2P key, key ID must be passed
func (*Client) DeleteUser ¶
DeleteUser is run locally to remove the User row from the node's database.
func (*Client) DeleteVRFKey ¶
DeleteVRFKey deletes (hard or soft) the VRF key with given public key from the db and memory. V2 jobs referencing the VRF key will be removed if the key is deleted (no such protection for the V1 jobs exists).
func (*Client) ExportETHKey ¶
ExportETHKey exports an ETH key, address must be passed
func (*Client) ExportOCRKey ¶
ExportOCRKey exports OCR key bundles by ID ID of the key must be passed
func (*Client) ExportP2PKey ¶
ExportP2PKey exports a P2P key, key ID must be passed
func (*Client) ExportVRFKey ¶
ExportVRFKey saves encrypted copy of VRF key with given public key to requested file path.
func (*Client) GetConfiguration ¶
GetConfiguration gets the nodes environment variables
func (*Client) ImportETHKey ¶
ImportETHKey imports an Ethereum key, file path must be passed
func (*Client) ImportKey ¶
ImportKey imports a key to be used with the chainlink node NOTE: This should not be run concurrently with a running chainlink node. If you do run it concurrently, it will not take effect until the next reboot.
func (*Client) ImportOCRKey ¶
ImportOCRKey imports OCR key bundle, file path must be passed
func (*Client) ImportP2PKey ¶
ImportP2PKey imports and stores a P2P key, path to key must be passed
func (*Client) ImportVRFKey ¶
ImportVRFKey reads a file into an EncryptedVRFKey in the db
func (*Client) IndexBridges ¶
IndexBridges returns all bridges.
func (*Client) IndexJobRuns ¶
IndexJobRuns returns the list of all job runs for a specific job if no jobid is passed, defaults to returning all jobruns
func (*Client) IndexJobSpecs ¶
IndexJobSpecs returns all job specs.
func (*Client) IndexTransactions ¶
IndexTransactions returns the list of transactions in descending order, taking an optional page parameter
func (*Client) IndexTxAttempts ¶
IndexTxAttempts returns the list of transactions in descending order, taking an optional page parameter
func (*Client) ListCSAKeys ¶
ListCSAKeys retrieves a list of all CSA keys
func (*Client) ListETHKeys ¶
ListETHKeys renders the active account address with its ETH & LINK balance
func (*Client) ListJobsV2 ¶
ListJobsV2 lists all v2 jobs
func (*Client) ListOCRKeyBundles ¶
ListOCRKeyBundles lists the available OCR Key Bundles
func (*Client) ListP2PKeys ¶
ListP2PKeys retrieves a list of all P2P keys
func (*Client) ListVRFKeys ¶
ListKeys Lists the keys in the db
func (*Client) MigrateDatabase ¶
MigrateDatabase migrates the database
func (*Client) PrepareTestDatabase ¶
PrepareTestDatabase calls ResetDatabase then loads fixtures required for tests
func (*Client) RebroadcastTransactions ¶
RebroadcastTransactions run locally to force manual rebroadcasting of transactions in a given nonce range.
func (*Client) RemoteLogin ¶
RemoteLogin creates a cookie session to run remote commands.
func (*Client) RemoveBridge ¶
RemoveBridge removes a specific Bridge by name.
func (*Client) ResetDatabase ¶
ResetDatabase drops, creates and migrates the database specified by DATABASE_URL This is useful to setup the database for testing
func (*Client) SetLogLevel ¶
SetLogLevel sets the log level on the node
func (*Client) SetMinimumGasPrice ¶
SetMinimumGasPrice specifies the minimum gas price to use for outgoing transactions
func (*Client) SetNextNonce ¶
SetNextNonce manually updates the keys.next_nonce field for the given key with the given nonce value
func (*Client) ShowBridge ¶
ShowBridge returns the info for the given Bridge name.
func (*Client) ShowJobRun ¶
ShowJobRun returns the status of the given Jobrun.
func (*Client) ShowJobSpec ¶
ShowJobSpec returns the status of the given JobID.
func (*Client) ShowTransaction ¶
ShowTransaction returns the info for the given transaction hash
func (*Client) TriggerPipelineRun ¶
TriggerPipelineRun triggers a V2 job run based on a job ID
type CookieAuthenticator ¶
type CookieAuthenticator interface { Cookie() (*http.Cookie, error) Authenticate(models.SessionRequest) (*http.Cookie, error) }
CookieAuthenticator is the interface to generating a cookie to authenticate future HTTP requests.
func NewSessionCookieAuthenticator ¶
func NewSessionCookieAuthenticator(config *orm.Config, store CookieStore) CookieAuthenticator
NewSessionCookieAuthenticator creates a SessionCookieAuthenticator using the passed config and builder.
type CookieStore ¶
CookieStore is a place to store and retrieve cookies.
type DiskCookieStore ¶
DiskCookieStore saves a single cookie in the local cli working directory.
type EthKeyPresenter ¶
type EthKeyPresenter struct {
presenters.ETHKeyResource
}
func (*EthKeyPresenter) RenderTable ¶
func (p *EthKeyPresenter) RenderTable(rt RendererTable) error
RenderTable implements TableRenderer
func (*EthKeyPresenter) ToRow ¶
func (p *EthKeyPresenter) ToRow() []string
type EthKeyPresenters ¶
type EthKeyPresenters []EthKeyPresenter
func (EthKeyPresenters) RenderTable ¶
func (ps EthKeyPresenters) RenderTable(rt RendererTable) error
RenderTable implements TableRenderer
type EthTxPresenter ¶
type EthTxPresenter struct { JAID presenters.EthTxResource }
func (*EthTxPresenter) RenderTable ¶
func (p *EthTxPresenter) RenderTable(rt RendererTable) error
RenderTable implements TableRenderer
type EthTxPresenters ¶
type EthTxPresenters []EthTxPresenter
func (EthTxPresenters) RenderTable ¶
func (ps EthTxPresenters) RenderTable(rt RendererTable) error
RenderTable implements TableRenderer
type HTTPClient ¶
type HTTPClient interface { Get(string, ...map[string]string) (*http.Response, error) Post(string, io.Reader) (*http.Response, error) Put(string, io.Reader) (*http.Response, error) Patch(string, io.Reader, ...map[string]string) (*http.Response, error) Delete(string) (*http.Response, error) }
HTTPClient encapsulates all methods used to interact with a chainlink node API.
func NewAuthenticatedHTTPClient ¶
func NewAuthenticatedHTTPClient(config orm.ConfigReader, cookieAuth CookieAuthenticator, sessionRequest models.SessionRequest) HTTPClient
NewAuthenticatedHTTPClient uses the CookieAuthenticator to generate a sessionID which is then used for all subsequent HTTP API requests.
type HealthCheckPresenter ¶
type HealthCheckPresenter struct {
webPresenters.Check
}
func (*HealthCheckPresenter) ToRow ¶
func (p *HealthCheckPresenter) ToRow() []string
type HealthCheckPresenters ¶
type HealthCheckPresenters []HealthCheckPresenter
func (HealthCheckPresenters) RenderTable ¶
func (ps HealthCheckPresenters) RenderTable(rt RendererTable) error
RenderTable implements TableRenderer
type JAID ¶
type JAID struct {
ID string `json:"id"`
}
JAID represents a JSON API ID.
It implements the api2go MarshalIdentifier and UnmarshalIdentitier interface.
When you embed a JSONAPI resource into a presenter, it will not render the ID into the JSON object when you perform a json.Marshal. Instead we use this to override the ID field of the resource with a JSON tag that will render.
Embed this into a Presenter to render the ID. For example
type JobPresenter struct { JAID presenters.JobResource }
type JobPresenter ¶
type JobPresenter struct { JAID // This is needed to render the id for a JSONAPI Resource as normal JSON presenters.JobResource }
JobRenderer wraps the JSONAPI Job Resource and adds rendering functionality
func (JobPresenter) FriendlyCreatedAt ¶
func (p JobPresenter) FriendlyCreatedAt() string
FriendlyCreatedAt returns the created at timestamp of the spec which matches the type in RFC3339 format.
func (JobPresenter) FriendlyTasks ¶
func (p JobPresenter) FriendlyTasks() []string
FriendlyTasks returns the tasks
func (JobPresenter) GetTasks ¶
func (p JobPresenter) GetTasks() ([]string, error)
GetTasks extracts the tasks from the dependency graph
func (*JobPresenter) RenderTable ¶
func (p *JobPresenter) RenderTable(rt RendererTable) error
RenderTable implements TableRenderer
func (JobPresenter) ToRows ¶
func (p JobPresenter) ToRows() [][]string
ToRows returns the job as a multiple rows per task
type JobPresenters ¶
type JobPresenters []JobPresenter
func (JobPresenters) RenderTable ¶
func (ps JobPresenters) RenderTable(rt RendererTable) error
RenderTable implements TableRenderer
type KeyStoreAuthenticator ¶
type KeyStoreAuthenticator interface { AuthenticateEthKey(*keystore.Eth, string) (string, error) AuthenticateCSAKey(*keystore.CSA, string) error AuthenticateVRFKey(*keystore.VRF, string) error AuthenticateOCRKey(*keystore.OCR, *orm.Config, string) error }
KeyStoreAuthenticator implements the Authenticate method for the store and a password string.
type MemoryCookieStore ¶
MemoryCookieStore keeps a single cookie in memory
type OCRKeyBundlePresenter ¶
type OCRKeyBundlePresenter struct { JAID // Include this to overwrite the presenter JAID so it can correctly render the ID in JSON presenters.OCRKeysBundleResource }
func (*OCRKeyBundlePresenter) RenderTable ¶
func (p *OCRKeyBundlePresenter) RenderTable(rt RendererTable) error
RenderTable implements TableRenderer
func (*OCRKeyBundlePresenter) ToRow ¶
func (p *OCRKeyBundlePresenter) ToRow() []string
type OCRKeyBundlePresenters ¶
type OCRKeyBundlePresenters []OCRKeyBundlePresenter
func (OCRKeyBundlePresenters) RenderTable ¶
func (ps OCRKeyBundlePresenters) RenderTable(rt RendererTable) error
RenderTable implements TableRenderer
type P2PKeyPresenter ¶
type P2PKeyPresenter struct { JAID presenters.P2PKeyResource }
func (*P2PKeyPresenter) RenderTable ¶
func (p *P2PKeyPresenter) RenderTable(rt RendererTable) error
RenderTable implements TableRenderer
func (*P2PKeyPresenter) ToRow ¶
func (p *P2PKeyPresenter) ToRow() []string
type P2PKeyPresenters ¶
type P2PKeyPresenters []P2PKeyPresenter
func (P2PKeyPresenters) RenderTable ¶
func (ps P2PKeyPresenters) RenderTable(rt RendererTable) error
RenderTable implements TableRenderer
type PasswordPrompter ¶
type PasswordPrompter interface {
Prompt() string
}
PasswordPrompter is an interface primarily used for DI to obtain a password from the User.
func NewPasswordPrompter ¶
func NewPasswordPrompter() PasswordPrompter
NewPasswordPrompter returns the production password change request prompter
type Prompter ¶
Prompter implements the Prompt function to be used to display at the console.
func NewTerminalPrompter ¶
func NewTerminalPrompter() Prompter
NewTerminalPrompter prompts the user via terminal.
type RendererJSON ¶
RendererJSON is used to render JSON data.
func (RendererJSON) Render ¶
func (rj RendererJSON) Render(v interface{}, _ ...string) error
Render writes the given input as a JSON string.
type RendererTable ¶
RendererTable is used for data to be rendered as a table.
func (RendererTable) Render ¶
func (rt RendererTable) Render(v interface{}, headers ...string) error
Render returns a formatted table of text for a given Job or presenter and relevant information.
type Runner ¶
type Runner interface {
Run(chainlink.Application) error
}
Runner implements the Run method.
type SessionCookieAuthenticator ¶
type SessionCookieAuthenticator struct {
// contains filtered or unexported fields
}
SessionCookieAuthenticator is a concrete implementation of CookieAuthenticator that retrieves a session id for the user with credentials from the session request.
func (*SessionCookieAuthenticator) Authenticate ¶
func (t *SessionCookieAuthenticator) Authenticate(sessionRequest models.SessionRequest) (*http.Cookie, error)
Authenticate retrieves a session ID via a cookie and saves it to disk.
type SessionRequestBuilder ¶
type SessionRequestBuilder interface {
Build(flag string) (models.SessionRequest, error)
}
SessionRequestBuilder is an interface that returns a SessionRequest, abstracting how session requests are generated, whether they be from the prompt or from a file.
func NewFileSessionRequestBuilder ¶
func NewFileSessionRequestBuilder() SessionRequestBuilder
NewFileSessionRequestBuilder pulls credentials from a file to generate a SessionRequest.
func NewPromptingSessionRequestBuilder ¶
func NewPromptingSessionRequestBuilder(prompter Prompter) SessionRequestBuilder
NewPromptingSessionRequestBuilder uses a prompter, often via terminal, to solicit information from a user to generate the SessionRequest.
type TableRenderer ¶
type TableRenderer interface {
RenderTable(rt RendererTable) error
}
type TerminalKeyStoreAuthenticator ¶
type TerminalKeyStoreAuthenticator struct {
Prompter Prompter
}
TerminalKeyStoreAuthenticator contains fields for prompting the user and an exit code.
func (TerminalKeyStoreAuthenticator) AuthenticateCSAKey ¶
func (auth TerminalKeyStoreAuthenticator) AuthenticateCSAKey(csaKeyStore *keystore.CSA, password string) error
func (TerminalKeyStoreAuthenticator) AuthenticateEthKey ¶
func (auth TerminalKeyStoreAuthenticator) AuthenticateEthKey(ethKeyStore *keystore.Eth, password string) (string, error)
Authenticate checks to see if there are accounts present in the KeyStore, and if there are none, a new account will be created by prompting for a password. If there are accounts present, all accounts will be unlocked.
func (TerminalKeyStoreAuthenticator) AuthenticateOCRKey ¶
func (auth TerminalKeyStoreAuthenticator) AuthenticateOCRKey(ocrKeyStore *keystore.OCR, config *orm.Config, password string) error
AuthenticateOCRKey authenticates OCR keypairs
func (TerminalKeyStoreAuthenticator) AuthenticateVRFKey ¶
func (auth TerminalKeyStoreAuthenticator) AuthenticateVRFKey(vrfKeyStore *keystore.VRF, password string) error
AuthenticateVRFKey creates an encrypted VRF key protected by password in store's db if db store has no extant keys. It unlocks at least one VRF key with given password, or returns an error. password must be non-trivial, as an empty password signifies that the VRF oracle functionality is disabled.
type VRFKeyPresenter ¶
type VRFKeyPresenter struct { JAID // Include this to overwrite the presenter JAID so it can correctly render the ID in JSON presenters.VRFKeyResource }
func (VRFKeyPresenter) FriendlyDeletedAt ¶
func (p VRFKeyPresenter) FriendlyDeletedAt() string
func (*VRFKeyPresenter) RenderTable ¶
func (p *VRFKeyPresenter) RenderTable(rt RendererTable) error
RenderTable implements TableRenderer
func (*VRFKeyPresenter) ToRow ¶
func (p *VRFKeyPresenter) ToRow() []string
type VRFKeyPresenters ¶
type VRFKeyPresenters []VRFKeyPresenter
func (VRFKeyPresenters) RenderTable ¶
func (ps VRFKeyPresenters) RenderTable(rt RendererTable) error
RenderTable implements TableRenderer
Source Files ¶
- app.go
- bridge_commands.go
- client.go
- csa_keys_commands.go
- doc.go
- eth_keys_commands.go
- jobs_commands.go
- key_store_authenticator.go
- local_client.go
- local_client_common.go
- ocr_keys_commands.go
- p2p_keys_commands.go
- presenters.go
- prompter.go
- remote_client.go
- renderer.go
- transaction_commands.go
- vrf_keys_commands.go