Sign inSign up

smartcontract/keeper-ei

By smartcontract

•Updated over 5 years ago

Image
0

10K+

smartcontract/keeper-ei repository overview

⁠Keeper External Initiator

Chainlink Keeper network aims to provide options for smart contracts to outsource regular maintenance tasks(harvesting, liquidating etc) in a trust minimized manner. The network aims to provide a protocol for payment & governance for an off chain secure computation ecosystem.

Following are the details of how to run the keeper node as External Initiator.

⁠Installation

go install

⁠Configuration

⁠Environment variables
KeyDescriptionExample
EI_PORTThe port for the EI API to listen on8080
EI_DATABASEURLPostgres connection URLpostgresql://user:pass@localhost:5432/ei
EI_CHAINLINKURLThe URL of the Chainlink Core servicehttp://localhost:6688
EI_IC_ACCESSKEYThe Chainlink access key, used for traffic flowing from this service to Chainlink<ACCESSKEY>
EI_IC_SECRETThe Chainlink secret, used for traffic flowing from this service to Chainlink<SECRET>
EI_CI_ACCESSKEYThe External Initiator access key, used for traffic flowing from Chainlink to this service<OUTGOINGTOKEN>
EI_CI_SECRETThe External Initiator secret, used for traffic flowing from Chainlink to this service<OUTGOINGSECRET>
EI_KEEPER_ETH_ENDPOINTThe wss ethereum endpoint to usewss://infura.io/ws/v3/<your key>
EI_KEEPER_REGISTRY_SYNC_INTERVALThe interval at which the keeper registry is synced30s

⁠Build

Build the binary

go build -o keeper-external-initiator .

Build the docker image

docker build -t keeper-external-initiator:latest .

⁠Usage

(1) Create db

(2) Set the environment variables as described above

(3) Run

./keeper-external-initiator # local binary with env vars already set
# or
docker run --env-file ./path/to/env/vars keeper-external-initiator # docker
**```**

## Help Options

$ ./keeper-external-initiator --help Monitors external blockchains and relays events to Chainlink node. ENV variables can be set by prefixing flag with EI_: EI_ACCESSKEY

Usage: external-initiator [flags]

Flags: --chainlinkurl string The URL of the Chainlink Core Service (default "localhost:6688") --ci_accesskey string The External Initiator access key, used for traffic flowing from Chainlink to this Service --ci_secret string The External Initiator secret, used for traffic flowing from Chainlink to this Service --cl_retry_attempts uint The maximum number of attempts that will be made for job run triggers (default 3) --cl_retry_delay duration The delay between attempts for job run triggers (default 1s) --cl_timeout duration The timeout for job run triggers to the Chainlink node (default 5s) --databaseurl string DatabaseURL configures the URL for external initiator to connect to -h, --help Help for keeper-external-initiator --ic_accesskey string The Chainlink access key, used for traffic flowing from this Service to Chainlink --ic_secret string The Chainlink secret, used for traffic flowing from this Service to Chainlink --keeper_eth_endpoint string The ethereum endpoint to use for keeper jobs --keeper_registry_sync_interval duration The ethereum endpoint to use for keeper jobs (default 5m0s) --port int The port for the EI API to listen on (default 8080)


## Adding to Chainlink

In order to use external initiators in your Chainlink node, first enable the following config in your Chainlink node's environment:

FEATURE_EXTERNAL_INITIATORS=true


This unlocks the ability to run `chainlink initiators` commands. To add an initiator run:

```bash
chainlink initiators create NAME URL

Where NAME is the name that you can to assign the initiator (ex: chain-init), and URL is the URL of the /jobs endpoint of this external-initiator service (ex: http://localhost:8080/jobs⁠).

Once created, the output will provide the authentication necessary to add to the environment⁠ of this external-initiator service.

Once the initiator is created, you will be able to add jobs to your Chainlink node with the type of external, and the name in the param with the name that you assigned the initiator.

⁠Testing

Run the entire test suite

go test ./...

Tag summary

Content type

Image

Digest

Size

19.5 MB

Last updated

over 5 years ago

docker pull smartcontract/keeper-ei