Oracle Price Feeder
Last updated
Was this helpful?
Last updated
Was this helpful?
Validators are required to submit price feeds for the on-chain oracle. The price-feeder
app can get price data from multiple providers and submit oracle votes to perform this duty.
This guide assumes you are running Ubuntu 22.04.
price-feeder
needs access to a running node's RPC and gRPC ports. This guide assumes you have it on the same machine and uses localhost
with default ports 26657 and 9090. Change these in config.toml
as needed.
This guide assumes you are configuring the oracle for a mainnet (kaiyo-1
) validator.
Best practice is to run node software on an isolated unprivileged user. We'll create the kujioracle
user in this guide; if your username is different change it wherever it appears.
kujioracle
userIf you've already followed the guide, the only steps you need in this section are Install go toolchain #2 and #3. Repeating the others won't hurt if you want to be safe.
Download and extract go 1.18.5.
Login as kujioracle
.
Configure environment variables for kujioracle
.
price-feeder
Login as kujioracle
(skip if you're already logged in).
Build kujirad
v0.8.7. We'll use the binary to create the keyring file.
Build price-feeder
.
price-feeder
This wallet will be relatively insecure, only store the funds you need to send votes.
Login as kujioracle
(skip if you're already logged in).
Create the wallet and a password for the keyring.
Configure the keyring-file
directory. This allows price-feeder
to find the keyring.
This step will authorize your new wallet to send oracle votes on behalf of your validator. The transaction should be sent from the validator wallet so run on a node where it's available.
Replace <oracle_wallet>
with your new wallet address.
Replace <validator_wallet>
with you validator wallet name.
Login as kujioracle
(skip if you're already logged in).
Create the config file with your favorite text editor (for example nano
).
Replace <wallet_address>
with your oracle wallet address (e.g. kujira16jchc8l8hfk98g4gnqk4pld29z385qyseeqqd0
)
Replace <validator_address>
with your validator address (e.g. kujiravaloper1e9rm4nszmfg3fdhrw6s9j69stqddk7ga2x84yf
)
The [[currency_pairs]]
provided in the config above is only an example, each validator should modify this to submit prices for the denoms whitelisted by the chain. Keep an eye out for governance proposals introducing new denoms.
NOTE: It is important that currency pairs in this config exactly match those in the currently configured whitelist for the chain:
You can also query the oracle params using kujirad
It is possible to overwrite default provider endpoints (e.g. to point to an alternate mirror) by specifying them in [[provider_endpoints]]
.
The price-feeder submits transactions on behalf of your validator that contain prices of specified denoms. The feeder account will need enough funding to pay for gas for these automatic vote transactions perpetually. Due to how this is performed by price-feeder, it's highly recommended to use a delegate feeder account rather than the validator account as the feeder wallet key is potentially more exposed.
To set a delegate:
Depending on your infrastructure you may have a different preference for your keyring backend. If you are running price-feeder on a separate account or separate server, you can experiment with different keyring backends without any risk to your running validator - however, you risk corrupting your validator keys if you are not using a separate account or server for price-feeder (again, this configuration is not recommended)
Create a file keyring
Set the password variable
Update config.toml
You may need to install pass
first:
And then set your passphrase to env
If price-feeder is running on the same server as your node and your node is using default ports, the default RPC configuration should work.
If you are running a different node configuration, you may need to edit these RPC settings to match your infrastructure.
curl "http://localhost:7171/api/v1/metrics" | jq
To publish price-feeder metrics in prometheus format, the config.toml must include the prometheus_retention
flag
Example Telemetry configuration block with Prometheus format enabled:
Example scrape_config in Prometheus:
price-feeder
Login as kujioracle
(skip if you're already logged in).
Run the app, providing the password on stdin
.
A systemd service will keep price-feeder
running in the background and restart it if it stops.
Create the service file with sudo
using your favorite text editor. Replace <keyring_password>
with the one you created.
Reload systemd
to pick up the new service.
Start the service.
Tail your service logs.
(Optional) Enable the service. This will set it to start on every boot.
Testnet:
Mainnet:
Ensure the validator
address is set to
Ensure that address
is set to the address of . By default this is the same as the kujira
address for your validator key, however it's likely that you'll want to set a delegate feeder account to your validator so that you can run price-feeder on a separate user account or separate server, with different keys.
Telemetry is provided by the . To query metrics from a running price-feeder, pipe the output into jq