GithubHelp home page GithubHelp logo

luiis / chainlink-polkadot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from smartcontractkit/chainlink-polkadot

0.0 0.0 0.0 1.71 MB

License: Other

Makefile 0.44% Rust 48.93% Shell 7.89% HTML 1.64% JavaScript 41.10%

chainlink-polkadot's Introduction

Chainlink-polkadot

This repository contains all relevant project necessary to have polkadot and substrate chains interact with chainlink.

This is WIP and will evolve frequently.

What is Polkadot and Chainlink?

Chainlink is a decentralized oracle technology that allows off-chain data to be connected to any chain. Polkadot is a scalable, heterogeneous, multi-chain technology, that can be used to create, maintain, and connect blockchains.

Run the example

Requirements

rust-toolchain is used to make sure the correct rust version is used. Make sure to install the WASM target using:

rustup target add wasm32-unknown-unknown

Running the example

You can view a youtube demo here.

substrate-node-example shows off out to use pallet-chainlink end-to-end. It first makes a local dummy substrate built parachain, and then spins up some local Chainlink nodes that have parameters to connect to the parachain. To test:

  • start the chain using make run-chain
  • install frontend dependencies cd substrate-node-example/front-end && yarn install && cd ../..
  • start the frontend using make run-front-end

To spin up some simple Chainlink nodes to intereact with the parachain you just created, run the setupcommand:

cd substrate-chainlink
./setup

This will run a number of docker commands that will spin up your Chainlink node. You can access them by going to your browser at: http://localhost:6691.

The password to this Chainlink node is [email protected] and the password is twochains. You can see in the logs of ./setup if the address has moved.

note If you'd like to restart you will have to remove all the docker containers. You can do this by running:

docker-compose down
docker-compose up

You are now ready to send test requests and see the result being provided back by an Oracle. You can continue to follow the demo youtube video to see how to interact with the GUIs.

Send a test request using PolkadotJS

const alice = ...;
const txHash = await api.tx._exampleModule_
  .sendRequest("ACCOUNT_ID")
  .signAndSend(alice);
console.log(`Submitted with hash ${txHash}`);

Send a test request using PolkadotJS Apps

Make sure you add the following additional to Settings/Developer section:

{ "SpecIndex": "Vec<u8>", "RequestIdentifier": "u64", "DataVersion": "u64" }

Then in Extrinsincs, example / sendRequest can be submitted.

How to use pallet-chainlink?

Complete documentation is accessible in the pallet README.

See the full example for more details.

chainlink-polkadot's People

Contributors

jeluard avatar boxhock avatar dependabot[bot] avatar thodges-gh avatar j16r 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.