Skip to content

Minimum requirements for an External Initiator that is used to trigger web-hooks to a chain-link node

Notifications You must be signed in to change notification settings

fsobh/Chainlink-External-Initiator-Template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chainlink logo

Chain Link External Inititator Template

AWS Lambda Ready

JavaScript Node AWS chainlink serverless express Dynamo Lambda

Pre-Deployment

1) Install the Serverless Framework globally

  npm install serverless -g 

2) Install dependencies using Node Package Manager

  npm install 

3) Create a .env file :

Note: Ensure these values are safely stored and are NOT public.

  CHAINLINK_ACCESS_KEY=<Your EI Access Key>
  CHAINLINK_ACCESS_SECRET=<Your EI Secret>

Deployment

Deploy service using serverless:

Note: Ensure You have configured you Serverless CLI to use your AWS ACCESS KEY and SECRET KEY with the appropriate permissions to deploy.

  sls deploy

API Reference

Health Check

  GET https://<your-aws-api-url>/

Job Registration (called by CL node when Job Spec is created)

  POST https://<your-aws-api-url>/
Parameter Type Description
jobId string Required. The External JOB ID of the Job Spec (on CL node). This is automatically populated and sent at time of job registration
type string Required. The Name of the External Inititator admin created on the Node via Chainlink CLI. This is automatically populated and sent at time of job registration
params JSON Object Required. Any spec params that are sent when the job is registered. (these are written in your job spec file)
params.jobName String Required. The unique name of the Job Spec file. (the value of the name field in your job spec). You must specify this in your job spec
ip string Required. The IP Address of the Node thats registering the JOB. This is automatically populated and sent at time of job registration

Example of a valid Job Spec :

type = "webhook"
schemaVersion = 1
name = "job-1"
externalJobID = "unique-external-job-id" # you can pre-define it or just have the node auto generate one for you at creation by removing the attribute from your job spec
externalInitiators = [
  { name = "name-of-your-ei-on-your node", spec = "{\"jobName\": \"job-1\"}" }

]
observationSource = """
    parse_request  [type="jsonparse" path="foo" data="$(jobRun.requestBody)"]


    parse_request 
"""

About

Minimum requirements for an External Initiator that is used to trigger web-hooks to a chain-link node

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published