This contains the Oracle feeder software that is used for periodically submitting oracle votes for the exchange rate of the different assets offered by the oracle chain. This implementation can be used as-is, but also can serve as a reference for creating your own custom oracle feeder.
This solution has 2 components:
-
- Obtain information from various data sources (exchanges, forex data, etc),
- Model the data,
- Enable a url to query the data,
-
- Reads the exchange rates data from a data source (
price-server
) - Periodically submits vote and prevote messages following the oracle voting procedure
- Reads the exchange rates data from a data source (
- Install Node.js version 18 or greater
- Clone this repository
git clone https://github.com/terra-money/oracle-feeder
cd oracle-feeder
- 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
- Configure and launch
feeder
, following instructions here.
cd feeder
npm install
# configure to use feeder account
npm start add-key
# start voting
$ npm start vote -- \
--source http://localhost:8532/latest \
--lcd-url https://lcd-1.anr.dev \
--lcd-url https://lcd-2.anr.dev \
--chain-id andromeda-oralce-1 \
--validators anrvaloper1xx \
--validators anrvaloper1yy \
--password "<password>"