Home

Awesome

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:

You are now ready to send extrinsics to the pallet.