Code Monkey home page Code Monkey logo

chainlink-polkadot's Introduction

Chainlink-polkadot

This repository contains the Chainlink feed pallet as well as an example node showing how to integrate it in Substrate-based chains.

It also includes the pallet-chainlink for interacting with the Chainlink job-based oracle system.

How to integrate the Chainlink feed pallet into a runtime?

The pallet is added to the runtime like any regular pallet (see tutorial). It then needs to be configured. See the pallet readme for details.

The usage is simple:

let feed = T::Oracle::feed(0.into()).ok_or(Error::<T>::FeedMissing)?;
let RoundData { answer, .. } = feed.latest_data();
do_something_with_answer(answer);

See the template pallet for a full example showing how to access a price feed.

Run the example

substrate-node-example demonstrates how to use pallet-chainlink-feed end-to-end. To test:

  • start the chain using make run-temp (for a temporary node which cleans up after itself)
  • connect to the chain by pointing https://polkadot.js.org/apps/ (or a locally hosted version) to the local dev node
  • specify the types by copying substrate-node-example/types.json into the input at Settings > Developer

You are now ready to send extrinsics to the pallet.

chainlink-polkadot's People

Contributors

apopiak avatar ebarakos avatar boxhock avatar laurenttrk avatar jeluard avatar mattsse avatar j16r avatar dependabot[bot] avatar clearloop avatar thodges-gh avatar patrickalphac avatar se3000 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.