DigiOracle Docs v1.0.1
  • 📔KlayOracle Documentation
  • Fundamentals
    • Introduction
    • Architecture
    • Aggregation Mechanism
    • Node & data provider communication
    • Installing KlayOracle
  • Smart Contract Developers
    • Price Feeds
      • Quick Start: Code Samples
      • How to Use KlayOracle Price Feeds
    • Random Number Generator
      • Quick Start: Code Samples
      • How to Use KlayOracle Random Number Generator
  • Data Providers
    • Introduction
    • Install & run data providers locally
    • How It Works
      • Configuring Data Feeds
      • Reducers
      • Data provider utilities
      • Configuration Files & Environmental Variables
      • OracleProvider Contract
      • Bootstrap Data Providers
    • Best Practices
  • Nodes
    • Introduction
    • Install & run node locally
  • Community
    • DigiOracle Champion Program
      • About the DigiOracle Champion Program
      • How to create content & become a DigiOracle Champion
      • Contribution Guidelines
      • FAQs
    • Bounties
Powered by GitBook
On this page
  1. Data Providers
  2. How It Works

Data provider utilities

PreviousReducersNextConfiguration Files & Environmental Variables

Last updated 2 years ago

KlayOracle contains a couple of utitilties written as Makefiles

Some of the key utilities

  • generate adapter ID

    For each feed defined by the data provider, an adapter ID needs to be generated. This ID uniquely identifies that feed when being processed by the node. This also ensures that the oracle contract defined can uniquely identify the adapter.

    To generate the adapter ID:

    • For each data feed you want to define, create the adapter JSON file . All of the required properties for the adapter file should have been defined, except for the adapterID, which should be an empty string.

    • Let’s assume we’ve created two data feeds, KLAY_USD.json and WEMIX_USD.json within the feeds folder of our data provider package

    • Run the following command:

      • ADAPTERS=KLAY_USD.json WEMIX_USD.json make adapter-id-gen

    The generate adapter ID generates an ID for each of the feeds defined in the ADAPTERS array.

    Once the command runs successfully, the feed file is compressed into 1 line.

    If you’d like to decompress or prettify the output, copy the contents of the file and head to JSONFormatter.

  • dryrun

    This command mimics the of the data provider and verifies that the adapter configuration defined is correct and would run correctly on the node.

    To dry run,

    • Run the following command:

      • ADAPTERS=KLAY_USD.json make adapter-dry-run

    • This generates an output

within the feed path
aggregation mechanism