Skip to content

aura-nw/band-consumer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Integration of Aura Network with Band Protocol: A Comprehensive Overview

This document elucidates the intricate integration process between Aura Network and Band Protocol. The integration encompasses the deployment of a Data Source, an Oracle Script on the Band Chain, and a Smart Contract on Aura Network.

The objective of this integration is to facilitate the extraction of APIs and services from the conventional web, including platforms like Coingecko, CoinmarketCap, and various centralized and decentralized exchanges, to ascertain the AURA Price.

Aura Network Integration with Band Protocol

Source: The BandChain Oracle

Data Source

The data source is the fundamental unit at the heart of BandChain's oracle system. Essentially, it is an executable that delineates the procedure for extracting specific data types.

A comprehensive introduction to Band Protocol's data source can be found here.

In the initial phase of integration, we will utilize the CoinGecko data source, a data source designed to extract price data from CoinGecko's API.

Data Source ID on laozi-testnet: 745

The codebase is situated within the data-source directory of this repository.

Oracle Script

When a user intends to request data from BandChain’s oracle, they do not interact directly with the data sources. Instead, they invoke an oracle script, which in turn executes the necessary data sources.

The primary function of an oracle script, unlike a data source, is to compile the results from various data sources to ensure on-chain security. Therefore, an oracle script, akin to a smart contract on other platforms such as Ethereum, Near, Solana and Aura Network, is executed on-chain rather than off-chain.

Oracle Script ID on laozi-testnet: 550

The codebase is situated within the oracle-script directory of this repository.

How to Run

First of all, you need to config the network in deploy-band/config/chain.js:

  1. Deploy the data source on BandChain with AURA API. Run the following command:
node ./data-source.js

The result will be the data source ID. Ex:

Successfully deployed AURA CoinGecko Price : 796
Successfully deployed AURA CoinMarketCap Price : 797
Successfully deployed AURA MEXC Price : 798
  1. Deploy the oracle script on BandChain.
node ./oracle-script.js

The result will be the oracle script ID. Ex: Successfully deployed OracleScript ID: 550

CW-Band Smart Contract

The cw-band introduces a standard for those seeking to integrate data from Band's oracle into their CosmWasm smart contract on a Cosmos-SDK-based blockchain via Inter-Blockchain Communication (IBC). The standard comprises data types necessary for requesting and receiving data.

Workflow:

Work Flow

Cw-band Contract Address on Euphoria Testnet: aura1rsjfz405ned8dd3yfjkl99lgu7d5a9h86xc4pe8yzk7d3thhtxqqfzcvay

Cw-band contract repository

Instantiate the Cw-band Contract

To instantiate the Cw-band contract, you need to provide the following parameters:

Example:

{
  client_id: 'cw-band-price-feed',
  oracle_script_id: '554',
  ask_count: '16',
  min_count: '10',
  fee_limit: [ { denom: 'uband', amount: '2500000' } ],
  prepare_gas: '2500000',
  execute_gas: '2500000',
  minimum_sources: 3
}

Where:

  • client_id: The client ID of the Cw-band contract.
  • oracle_script_id: The Oracle Script ID on BandChain.
  • ask_count: The number of validators to ask for the data.
  • min_count: The minimum number of validators to respond.
  • fee_limit: The fee limit for the transaction.
  • prepare_gas: The gas limit for the prepare transaction.
  • execute_gas: The gas limit for the execute transaction.
  • minimum_sources: The minimum number of data sources to respond.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published