LogoLogo
  • Introduction
    • Kujira Empowers Everyone
      • Ecosystem
      • Where Everyone Can Be a Whale
      • Grown-Up DeFi (GUD)
    • Why Kujira
      • User and Developer Experience
      • Values
        • Principles
        • Sustainability
    • Meet Team Kujira
  • Kujira Ecosystem
    • Our Products
    • Wider Ecosystem
    • Kujira Roadmap
    • How to Participate
    • Moving Funds to Kujira
    • Shipping Lane
    • Security
    • Media Coverage
    • Links
  • dApps & Infrastructure
    • Basics
    • Welcome to Kujira (Landing Page)
    • BLUE (Central Hub)
      • Dashboard
      • Wallet
      • Swap
      • IBC / Bridge
      • Mint
      • Stake
      • Govern
      • Developer
      • Product Guides
        • How to Send Tokens
        • How to Convert balances to KUJI
        • How to Swap tokens
        • How to Bridge tokens
        • How to use IBC
        • How to Mint USK
        • How to Stake KUJI
        • How to Redelegate KUJI
        • How to Unstake KUJI
        • How to Check the Status of Governance Proposals and/or Vote
        • How to Nominate a Candidate for the Senate
        • How to View Information on Senate Candidates
    • BOW (Liquidity Engine)
      • Dashboard
      • Pools
        • Featured Pools
        • All Liquidity Pools
          • Pool Overview
          • Provide to a Pool
          • Leveraged Liquidity
          • Stake LP with a Pool
      • Swap
      • Stake USK
        • Overview
        • Stake / Unstake
        • Rewards
      • Product Guides
        • How to View LP positions
        • How to Add Liquidity
        • How to Remove Liquidity
        • How to Provide Incentives
        • How to Check the Reward Schedule of a Pool
    • FIN (DEX)
      • Overview
      • How to Use FIN
        • Search and Filter by View
        • Price Chart and Charting Tools
        • Orderbook status and Recent Trades
        • Personal Order Activity
        • Spot and Margin Trade UI
          • Isolated FIN Margin
      • Listing tokens on FIN
      • Coingecko API
      • Product Guides
        • How to Buy KUJI Using axlUSDC
        • How to Sell ATOM for USK
        • How to List a New Pair
        • How to Toggle View to see Certain Pairs
        • How to Save Favourite Pairs
        • How to Check Unclaimed Orders
        • How to Navigate to BOW Pools
        • How to Look at Your History
    • FINDER (Explorer)
      • Product Guides
        • How to View a Wallet's Balance
        • How to Bookmark Wallets for Tracking
        • How to View and Manage Bookmarked Wallets
    • GHOST (Money Market)
      • Basics
      • Dashboard
      • Borrow
      • Lend
    • ORCA (Liquidations)
      • Basics
        • Lending Markets
          • Analytics
          • USK Lending Markets
            • Isolated FIN Margin
          • xAsset Lending Markets
      • How to Integrate ORCA
      • Product Guides
        • How to Bid on Collateral
        • How to View Active Bids on Collateral
        • How to View the Analytics on a Liquidation Market
    • PILOT (Launchpad)
    • POD (Cross-chain Staking)
      • Product Guides
        • How to Stake any Cosmos Layer 1 Token
        • How to Redelegate any Cosmos L1 Token
        • How to Unstake any Cosmos L1 Token
    • Pond (Developer Toolkit)
    • (Retired) SENATE (Grant Oversight)
      • Senators
      • Constitution
      • Treasury
      • Contacting the Senate
      • Past Senate Proposals
      • Past Senate Meetings
      • Transparency
    • Sonar (Native Wallet)
      • Basics
      • Setup
        • Create a wallet
        • Fund your wallet
        • Customize your settings
      • Using Sonar
        • Mobile
          • Home
          • Swap
          • Launch
            • Trade
            • Mint
            • Borrow
            • Liquidate
            • Launch (PILOT)
            • Buy gift cards with Bidali
            • Fin orders (dashboard)
            • Mint & manage USK positions (dash)
            • Borrow on GHOST (dashboard)
          • Stake
          • Send/Receive
        • Desktop
    • USK (Stablecoin)
      • Basics
      • Technical Specifics
      • Use Cases
      • Transparency
      • How to Mint USK
  • Developers
    • Developer Kickstart Page
    • Smart Contracts
      • Token Factory
      • Price Oracle
      • Scheduler
      • Entropy Beacon
    • Indexers
      • SubQuery
    • Core Module Accounts
    • List of Tokens
    • dApp Front Ends
      • FIN
    • Contacting the Team
  • Tokenomics
    • KUJI Token
      • Staking KUJI
      • Staking Tiers and Symbols on BLUE, FIN, and ORCA
      • KUJI Sustainability
      • Kujira Governance
      • Lending and Borrowing KUJI
      • Buying Kujira NFTs
  • Validators
    • Run a Node
      • Create a validator
      • Oracle Price Feeder
      • Tips
    • Cosmovisor Setup
    • Community Tooling
    • Staking Rewards
    • Genesis Validator Allocation
  • Governance
    • Staking
      • Staking Overview
      • Redelegate
      • Unbond
      • Slashing
      • Staking UI
    • Vote on Proposals
    • Submit a Governance Proposal
    • (Retired) The Kujira Senate
      • Treasury
    • Discord Governance Forum
    • Capybara Labs
    • Smart Stake
  • Our Venture-Builder Program
    • Overview
  • Community
    • Kujira Amplifier
    • Kujira Communities
    • Kuji Kast
    • Kujira News
    • Kujira Support
      • Support Ticket System
      • Cosmobot
    • Kujira Social Media
      • Discord
      • Telegram
      • Twitter
      • WinkHUB
      • Medium
      • Reddit
      • Instagram
      • YouTube
  • Help Center
    • Kujira Classroom
    • FAQ
    • Handy Tools
    • Glossary
    • Common Error Messages
  • Brand Assets
    • Colors
    • Logo Options
      • Kujira Brand
      • Native Token Logos
      • Product Logos
      • Legacy Logos
    • Fonts
Powered by GitBook
On this page
  • Introduction
  • Requirements
  • User setup
  • Create the kujioracle user
  • Build environment setup
  • Install build packages
  • Install go toolchain
  • Build price-feeder
  • Configure price-feeder
  • Create a wallet
  • Set the feeder delegation
  • Create the config
  • Advanced Setup
  • Provider Endpoints
  • Addresses & Voting Delegate
  • Keyring Backend
  • RPC Endpoints
  • Telemetry & Prometheus
  • Run price-feeder
  • Create a service
Edit on GitHub
  1. Validators
  2. Run a Node

Oracle Price Feeder

PreviousCreate a validatorNextTips

Last updated 10 months ago

Introduction

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.

Requirements

  • 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.

User setup

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.

Create the kujioracle user

sudo useradd -m -s /bin/bash kujioracle

Build environment setup

If 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.

Install build packages

sudo apt install -y build-essential git unzip curl

Install go toolchain

  1. Download and extract go 1.21.8.

curl -fsSL https://golang.org/dl/go1.21.8.linux-amd64.tar.gz | sudo tar -xzC /usr/local
  1. Login as kujioracle.

sudo su -l kujioracle
  1. Configure environment variables for kujioracle.

cat <<EOF >> ~/.bashrc
export GOROOT=/usr/local/go
export GOPATH=\$HOME/go
export GO111MODULE=on
export PATH=\$PATH:/usr/local/go/bin:\$HOME/go/bin
EOF
source ~/.bashrc
go version  # should output "go version go1.21.8 linux/amd64"

Build price-feeder

  1. Login as kujioracle (skip if you're already logged in).

sudo su -l kujioracle
  1. Build kujirad v1.1.0. We'll use the binary to create the keyring file.

git clone https://github.com/Team-Kujira/core
cd core
git checkout v1.1.0
make install
cd ..
kujirad version  # should output "1.1.0"
  1. Build price-feeder.

git clone https://github.com/Team-Kujira/oracle-price-feeder
cd oracle-price-feeder
make install
price-feeder version

Configure price-feeder

Create a wallet

This wallet will be relatively insecure, only store the funds you need to send votes.

  1. Login as kujioracle (skip if you're already logged in).

sudo su -l kujioracle
  1. Create the wallet and a password for the keyring.

kujirad keys add oracle
  1. Configure the keyring-file directory. This allows price-feeder to find the keyring.

mkdir ~/.kujira/keyring-file
mv ~/.kujira/*.info ~/.kujira/*.address ~/.kujira/keyring-file

Set the feeder delegation

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.

kujirad tx oracle set-feeder <oracle_wallet> --from <validator_wallet> --fees 250ukuji

Create the config

  1. Login as kujioracle (skip if you're already logged in).

sudo su -l kujioracle
  1. Create the config file with your favorite text editor (for example nano).

    • Refer to config.example.toml for a sample file.

    • Replace <wallet_address> with your oracle wallet address (e.g. kujira16jchc8l8hfk98g4gnqk4pld29z385qyseeqqd0)

    • Replace <validator_address> with your validator address (e.g. kujiravaloper1e9rm4nszmfg3fdhrw6s9j69stqddk7ga2x84yf)

Configure the currency pairs

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

kujirad query oracle params

Advanced Setup

Provider Endpoints

It is possible to overwrite default provider endpoints (e.g. to point to an alternate mirror) by specifying them in [[provider_endpoints]].

Example for Binance.US

[[provider_endpoints]]
name = "binance"
rest = "https://api.binance.us"
websocket = "stream.binance.us:9443"

Addresses & Voting Delegate

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.

[account]
address = "kujira...." # feeder wallet address
chain_id = "<kaiyo-1>"
validator = "kujiravaloper...." # validator address
prefix = "kujira"

Ensure the validator address is set to your validator address.

Ensure that address is set to the address of your feeder wallet. 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.

To set a delegate:

kujirad tx oracle set-feeder kujira1243.....

Keyring Backend

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)

OS

[keyring]
backend = "os"
# dir is ignored for os
dir = "/home/kuji/.kujira"

FILE

Create a file keyring

kujirad keys add oracle
mkdir ~/.kujira/keyring-file
mv ~/.kujira/*.address ~/.kujira/*.info ~/.kujira/keyring-file

Set the password variable

export PRICE_FEEDER_PASS=<keyring_password>

Update config.toml

[keyring]
backend = "file"
dir = "/home/kuji/.kujira"

PASS

You may need to install pass first:

And then set your passphrase to env

export PRICE_FEEDER_PASS=...  
[keyring]
backend = "pass"
# dir is ignored for pass
dir = "/home/kuji/.kujira"

RPC Endpoints

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.

[rpc]
grpc_endpoint = "localhost:9090"
rpc_timeout = "100ms"
tmrpc_endpoint = "http://localhost:26657"

Telemetry & Prometheus

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:

[telemetry]
enable_hostname = true
enable_hostname_label = true
enable_service_label = true
enabled = true
global_labels = [["chain_id", "kaiyo-1/harpoon-4"]]
service_name = "price-feeder"
type = "prometheus"
prometheus_retention = 120

Example scrape_config in Prometheus:

scrape_configs:
  - job_name: price-feeder
    metrics_path: '/api/v1/metrics'
    params:
      format: ['prometheus']
    static_configs:
      - targets:
          - <price-feeder-IP-addr>:7171
        labels: {}

Run price-feeder

  1. Login as kujioracle (skip if you're already logged in).

sudo su -l kujioracle
  1. Run the app, providing the password on stdin.

echo <keyring_password> | price-feeder ~/config.toml

Create a service

A systemd service will keep price-feeder running in the background and restart it if it stops.

  1. Create the service file with sudo using your favorite text editor. Replace <keyring_password> with the one you created.

[Unit]
Description=kujira-price-feeder
After=network.target

[Service]
Type=simple
User=kujioracle
ExecStart=/home/kujioracle/go/bin/price-feeder /home/kujioracle/config.toml --log-level debug
Restart=on-abort
LimitNOFILE=65535
Environment="PRICE_FEEDER_PASS=<keyring_password>"

[Install]
WantedBy=multi-user.target
  1. Reload systemd to pick up the new service.

sudo systemctl daemon-reload
  1. Start the service.

sudo systemctl start kujira-price-feeder
  1. Tail your service logs.

sudo journalctl -fu kujira-price-feeder
  1. (Optional) Enable the service. This will set it to start on every boot.

sudo systemctl enable kujira-price-feeder

Testnet:

Mainnet:

Follow the instructions in to set up the right currency pairs and enpoints. For a deeper overview of the oracle fetures and setup check the official

Telemetry is provided by the . To query metrics from a running price-feeder, pipe the output into jq

Run a node
harpoon-4
kaiyo-1
feeder-config
oracle-price-feeder
https://github.com/Team-Kujira/oracle-price-feeder/blob/master/config.example.toml#L55-L57
https://www.passwordstore.org
Cosmos SDK Telemetry module
Page cover image