pricefeeder

module
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2023 License: Apache-2.0

README

Nibiru x/oracle Price Feeder

Submits prices to the nibiru decentralized oracle.

Configuration using .env

Feeder requires the following environment variables to run:

CHAIN_ID="nibiru-localnet-0"
GRPC_ENDPOINT="localhost:9090"
WEBSOCKET_ENDPOINT="ws://localhost:26657/websocket"
FEEDER_MNEMONIC="guard cream sadness conduct invite crumble clock pudding hole grit liar hotel maid produce squeeze return argue turtle know drive eight casino maze host"
EXCHANGE_SYMBOLS_MAP='{"bitfinex": {"ubtc:unusd": "tBTCUSD", "ueth:unusd": "tETHUSD", "uusd:unusd": "tUSTUSD"}}'
Enabling TLS

To enable TLS, you need to set the following env vars:

TLS_ENABLED="true"
Delegating post pricing

In order to be able to delegate the post pricing you need to set the env variable for the validator that delegated you the post pricing:

VALIDATOR_ADDRESS="nibiruvaloper1..."

And from your validator node, you need to delegate responsibilites to the feeder address

nibid tx oracle set-feeder <feeder address> --from validator
Configuring specific exchanges
CoinGecko

Coingecko source allows to use paid api key to get more requests per minute. In order to configure it, you need to set env var:

DATASOURCE_CONFIG_MAP='{"coingecko": {"api_key": "0123456789"}}'

Build

make build-feeder

Run

make run

or to run as a daemon:

make docker-compose up -d price_feeder

Directories

Path Synopsis
cmd
mocks
Package mock_types is a generated GoMock package.
Package mock_types is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL