Giter Site home page Giter Site logo

adapter.js's Introduction

Adapter.js

A Chainlink external adapter for securely executing custom JavaScript

Overview

Watch the project overview on YouTube

Problem

Chainlink external adapters are extremely powerful, but have some limitations.

Setting up an external adapter is time consuming. Developers must first create and host the adapter, then either operate a Chainlink node themselves, or get another node operator to create a new bridge and job for the adapter.

Additionally, for data received from an external adapter to be truly decentralized, separate instances of the adapter must be hosted on multiple independent Chainlink nodes. This requires smart contract developers to contact many node operators each time they want to create an external adapter with new functionality and achieve decentralization.

Solution

Adapter.js seeks to solve the problems currently facing external adapters by becoming the universal external adapter. Adapter.js can fetch data from any API or website, then securely process data using custom JavaScript provided by users. In a Chainlink request to the external adapter, users can provide custom code as a string or reference a JavaScript file hosted on IPFS.

In addition, Adapter.js can securely access web resources which require authentication by allowing users to upload headers containing private keys to the external adapter’s database. These custom headers are only able to be used in data requests initiated by an approved smart contract address.

Adapter.js is open source and is being developed such that any Chainlink node operator can run their own independent instance of the external adapter. To achieve decentralization, smart contract developers can then make requests to many nodes which host an instance of the adapter. Consensus can be reached on-chain by comparing the resulting data provided by each node.

How to Use

Use the tool at adapterjs.link/simulator.html to simulate making a request to the external adapter. Then, click "Generate Code" to automatically generate the required Solidity code to make the Chainlink request on-chain. Swap out the Chainlink oracle address and job id to send the request to a different Chainlink node which hosts Adapter.js. Check out adapterjs.link/documentation.html for more in-depth documentation about working with Adapter.js

Current Status

Adapter.js is currently hosted on an independent Chainlink node for the Mumbai Polygon testnet. However, any Chainlink node operator can host the external adapter themselves for any Chainlink-supported blockchain. As more node operators host Adapter.js, this list will be updated.

Blockchain: Mumbai

Oracle Address: 0xa8E22A742d39b13D54df6A912FCC7b8E71dFAFE0

  • Job ID for returning uint256: 9d8c783d0b9645958697b880fd823137
  • Job ID for job returning int256: fe689d575d904580b454415399713c01
  • Job ID for job returning bool: 84a2d337e80c4f61bab7aff465666adc
  • Job ID for job returning bytes32: 1302aee4e8604b36830c801e613d8082

Contact

For suggestions and support, please check out the Adapter.js Discord community!

adapter.js's People

Contributors

kuphjr avatar thodges-gh avatar patrickalphac avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.