Oracle Price Feeder

Setting up the oracle price feeder is necessary for validators.

Exocore relies on an external price oracle to determine the total vote power for each validator, who may be staking multiple assets. Validators are required to run a price feeder to participate in the network, which periodically fetches prices from data sources and submits them to the oracle module. Failing to run the price feeder tool may result in penalties like slashing.

Before you start, make sure to set in grpc.enable = true in app.toml, as previously advised.

There are two methods to run the price feeder tool. The first method is recommended for most validators, while the second method is suited for the more technical and risk-averse validators.

Option 1: Embedded version

  1. Set up the configuration of the price feeder tool. It requires three files: the first for its own configuration, the second for the price sources and the last for native restaking.

    $HOMEDIR/config/oracle_feeder.yaml
    sources:
      chainlink
    tokens:
      - ETHUSDT
      - WSTETHUSDT
    sender:
      # either path or mnemonic must be supplied. if both are supplied,
      # mnemonic takes priority. alternatively, the mnemonic may be supplied
      # via CLI flag `--mnemonic`.
      path: "$HOMEDIR/config" # actual value not `$HOMEDIR`
      mnemonic: "your consensus mnemonic goes here"
    exocore:
      chainid: exocoretestnet_233-6
      appName: exocore
      rpc: 127.0.0.1:9090
      ws:
        addr: !!str ws://127.0.0.1:26657
        endpoint: /websocket

    The prices are sourced from Chainlink contracts on Ethereum, so you’ll need an RPC URL from providers like Alchemy and Infura or a self-hosted version.

    $HOMEDIR/config/oracle_env_chainlink.yaml
    urls:
      mainnet: !!str https://eth-mainnet.g.alchemy.com/v2/${YOUR_API_KEY}
      sepolia: !!str https://eth-sepolia.g.alchemy.com/v2/${YOUR_API_KEY}
    tokens:
      ETHUSDT: 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419_mainnet
      WSTETHUSDT: 0xaaabb530434B0EeAAc9A42E25dbC6A22D7bE218E_sepolia

    To support native restaking on Holesky, another file is used.

    $HOMEDIR/config/oracle_env_beaconchain.yaml
    url:
      !!str https://rpc.ankr.com/premium-http/eth_holesky_beacon/${YOUR_API_KEY}
  2. Run your validator as described on the next page.

Option 2: As an independent binary

This option is designed for validators who would like to decouple the two processes for security and/or reliability.

  1. Download and save the price feeder tool to a location within $PATH.

    VERSION="0.1.9"
    wget -O price-feeder_${VERSION}.tar.gz "https://github.com/ExocoreNetwork/price-feeder/releases/download/v${VERSION}/price-feeder_${VERSION}_$(uname -s)_$(uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/').tar.gz"
    tar -xvzf price-feeder_${VERSION}.tar.gz
    mv bin/price-feeder /usr/bin/
  2. Set up its configuration as described under Option 1 Step 1.

  3. Start the price feeder tool

    price-feeder start --config $HOMEDIR/config/oracle_feeder.yaml --sources $HOMEDIR/config/
  4. If everything works, productionize the process with systemd or another tool of your choice and keep it running. The expected logs are shown below.

    2024/09/11 18:02:04 Triggered, height:31, feeder-parames:{feederID:1, startBlock:20, interval:10, roundID:1}:
    2024/09/11 18:02:04 price not changed, skip submitting price for roundID:2, feederID:1

Last updated