Skip to content

Fully working oracle feeder April 2023 up to terrad v1.1.0 only

License

Notifications You must be signed in to change notification settings

lunanauts/oracle-feeder

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terra Oracle Feeder

This contains the Oracle feeder software that is used internally by Terraform Labs' validator nodes for periodically submitting oracle votes for the exchange rate of LUNC (LUNA Classic). This implementation can be used as-is, but also can serve as a reference for creating your own custom oracle feeder. For more information regarding the oracle process, please refer to the oracle module specs.

Overview

This solution has 2 components:

  1. price-server

    • Obtain information from various data sources (exchanges, forex data, etc)
    • Use data to compute the exchange rates of LUNC for a given set of fiat denominations
    • Most recent LUNC exchange rates are available through HTTP endpoint
  2. feeder

    • Reads LUNC exchange rates from a data source (price-server)
    • Periodically submits vote and prevote messages following the oracle voting procedure

You can easily modify the logic for how LUNC exchange rates are computed by either directly modifying price-server or replacing the input stream for feeder.

Prerequisites

Instructions

  1. Clone this repository
git clone https://github.com/lunanauts/oracle-feeder
cd oracle-feeder
  1. Configure and launch price-server, following instructions here.
cd price-server
npm install

# Copy sample config file
cp ./config/default-sample.js ./config/default.js
# make edits
vim ./config/default.js

# price is available at `http://127.0.0.1:8532/latest`
npm run start
  1. Configure and launch feeder, following instructions here.
cd feeder
npm install

# configure to use feeder account
npm start update-key

# start voting
npm start vote -- \
   --source http://localhost:8532/latest \
   --lcd https://lcd.terra.dev \
   --chain-id columbus-4 \
   --validator terravaloper1xx \
   --validator terravaloper1yy \
   --password "<password>"

About

Fully working oracle feeder April 2023 up to terrad v1.1.0 only

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 88.6%
  • JavaScript 10.5%
  • Dockerfile 0.9%