Skip to content

An oracle bridge fetching the oracle data from Nervos CKB and displaying data with web pages

License

Notifications You must be signed in to change notification settings

duanyytop/ckb-oracle-bridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CKB Oracle Bridge

License Github Actions CI Telegram Group

Live Demo

CKB Oracle Bridge is an oracle bridge fetching the oracle data of Band Protocol and Open Oracle(e.g. Okex oracle and Coinbase oracle) from Nervos CKB and displaying oracle data with web pages.

The Band Protocol oracle data of Nervos CKB is posted by ckb-band-oracle and the Open Oracle data is poster by ckb-open-oracle(Okex Oracle has been supported).

CKB Oracle Bridge includes two parts: server and client.

Server

Server is a web server (Node.js) to fetch, decode and store the oracle data of Band Protocol and Open Oracle from Nervos CKB and provide http api to client.

Before starting server, ckb node is needed whose websocket is enabled. Then ckb transactions containing oracle data are fetched, filtered and decoded from ckb node with ckb-lumos and http api is provided to the client

Client

Client is a web application(Vue.js) rendering oracle data which comes from the server part. Client includes three pages: latest price list page, token price history page and token detail page.

Oracle Snapshot

Prerequisites

Getting Started

$ git clone https://github.com/duanyytop/ckb-oracle-bridge
$ cd ckb-oracle-bridge
$ yarn bootstrap

Update CKB_NODE_URL and CKB_WEBSOCKET_URL for server/.env file which can be copied from server/.env.example

Update VUE_APP_SERVER_URL with server url for client/.env file which can be copied from client/.env.example

$ yarn start:server
$ yarn start:client

# build for client production
$ yarn build:client

Note: Server need a while to indexer ckb transactions which contain oracle data and put data to database, so client should wait a moment to start after server completing indexer.

Resource

  • Band Protocol - A cross-chain data oracle platform that aggregates and connects real-world data and APIs to smart contracts
  • Open Oracle - A standard and SDK allowing reporters to sign key-value pairs (e.g. a price feed) that interested users can post to the blockchain
  • CKB JavaScript SDK - JavaScript SDK of Nervos CKB which can help developers to interact ckb node
  • CKB Lumos - A full featured dapp framework for Nervos CKB
  • CKB Explorer - CKB blockchain explorer

About

An oracle bridge fetching the oracle data from Nervos CKB and displaying data with web pages

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published