Oracle Price Feeder
Setting up the oracle price feeder is necessary for validators.
Imua 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 results in penalties like jailing and slashing.
Before you start, make sure to set in grpc.enable = true
in app.toml
, as previously advised.
Option 1: Embedded version
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.
tokens: - token: ETHUSDT sources: chainlink - token: WSTETHUSDT sources: chainlink - token: USDCUSDT sources: chainlink - token: NSTETH sources: beaconchain - token: SOLUSDT sources: chainlink - token: XRPUSDT sources: chainlink sender: path: $HOMEDIR/config # actual path not `homedir` imua: chainid: imuachaintestnet_233-8 appName: imua grpc: 127.0.0.1:9090 ws: !!str ws://127.0.0.1:26657/websocket rpc: !!str http://127.0.0.1:26657
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.
urls: # Use your own API keys and/or URLs. Any JSON-RPC provider is supported, # including self-hosted nodes. mainnet: !!str https://rpc.ankr.com/eth/<YOUR_API_KEY_HERE> sepolia: !!str https://rpc.ankr.com/eth_sepolia/<YOUR_API_KEY_HERE> tokens: ETHUSDT: 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419_mainnet WSTETHUSDT: 0xaaabb530434B0EeAAc9A42E25dbC6A22D7bE218E_sepolia USDCUSDT: 0x8fFfFfd4AfB6115b954Bd326cbe7B4BA576818f6_mainnet SOLUSDT: 0x4ffC43a60e009B551865A93d232E33Fce9f01507_mainnet XRPUSDT: 0xB4AD57B52aB9141de9926a3e0C8dc6264c2ef205_arbitrum
To support native restaking on Holesky, another file is used.
url: # This needs a paid Ankr subscription or you can connect to your own Holesky # Beacon chain node. Alternatively, use the free but heavily rate-limited # https://ethereum-holesky-beacon-api.publicnode.com !!str https://rpc.ankr.com/premium-http/eth_holesky_beacon/${YOUR_API_KEY} nstid: !!str 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee_0x9d19
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.
Download and save the price feeder tool to a location within
$PATH
.VERSION="0.2.4" wget -O price-feeder_${VERSION}.tar.gz "https://github.com/imua-xyz/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/
Set up its configuration as described under Option 1 Step 1.
Start the price feeder tool
price-feeder start --config $HOMEDIR/config/oracle_feeder.yaml --sources $HOMEDIR/config/
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