Skip to content

Reign-Protocol/chainlink-polkadot

This branch is up to date with smartcontractkit/chainlink-polkadot:master.

Folders and files

NameName
Last commit message
Last commit date
Jun 16, 2021
Sep 21, 2021
Jul 21, 2021
Jun 15, 2021
Sep 6, 2021
Feb 26, 2021
Dec 19, 2019
Jul 21, 2021
Feb 25, 2020
Apr 1, 2021
Jun 2, 2021
Mar 23, 2021

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 52.8%
  • Rust 23.5%
  • Solidity 15.3%
  • JavaScript 6.4%
  • Shell 1.4%
  • Python 0.3%
  • Other 0.3%