Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fsobh/chainlink-external-initiator-template
Minimum requirements for an External Initiator that is used to trigger web-hooks to a chain-link node
https://github.com/fsobh/chainlink-external-initiator-template
Last synced: about 2 months ago
JSON representation
Minimum requirements for an External Initiator that is used to trigger web-hooks to a chain-link node
- Host: GitHub
- URL: https://github.com/fsobh/chainlink-external-initiator-template
- Owner: fsobh
- Created: 2022-02-15T16:03:12.000Z (almost 3 years ago)
- Default Branch: Dev
- Last Pushed: 2022-02-28T07:24:06.000Z (almost 3 years ago)
- Last Synced: 2024-02-07T15:45:35.856Z (12 months ago)
- Language: JavaScript
- Homepage:
- Size: 19.5 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Chain Link External Inititator Template
### *AWS Lambda Ready*[![JavaScript](https://img.shields.io/badge/JavaScript-ES9-%23FFFF00)](https://img.shields.io/badge/JavaScript-ES9-%23FFFF00) [![Node](https://img.shields.io/badge/NodeJS-v14.0.1-brightgreen)](https://img.shields.io/badge/NodeJS-v14.x.x-brightgreen)
[![AWS](https://img.shields.io/badge/AWS-Cloud%20provider-orange)](https://img.shields.io/badge/AWS-Cloud%20provider-orange) [![chainlink](https://img.shields.io/badge/Chain%20Link-v1.0.1-%23375BD2)](https://img.shields.io/badge/Chain%20Link-v1.0.1-%23375BD2)
[![serverless](https://img.shields.io/badge/Serverless-v3.1.1-red)](https://img.shields.io/badge/Serverless-v3.1.1-red) [![express](https://img.shields.io/badge/Express-%5E4.17.2-green)](https://img.shields.io/badge/Express-%5E4.17.2-green)
[![Dynamo](https://img.shields.io/badge/DynamoDB-Database-blue)](https://img.shields.io/badge/DynamoDB-Database-blue) [![Lambda](https://img.shields.io/badge/Lambda-service-%20%09%23a26c2f)](https://img.shields.io/badge/Lambda-service-%20%09%23a26c2f)## Pre-Deployment
#### 1) Install the [Serverless Framework](https://www.serverless.com/) globally```bash
npm install serverless -g
```#### 2) Install dependencies using [Node Package Manager](https://www.npmjs.com/)
```bash
npm install
```
#### 3) Create a ```.env``` file :
> **Note:** Ensure these values are safely stored and are **NOT public**.
```bash
CHAINLINK_ACCESS_KEY=
CHAINLINK_ACCESS_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.
```bash
sls deploy
```##
## API Reference
#### Health Check
```http
GET https:///
```
#### Job Registration (called by CL node when Job Spec is created)```http
POST https:///
```| 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 :
```toml
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
"""
```