# Query feed configuration

> Query feed configuration using JS, Python, Rust, or Go.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.

Source: https://dev.flare.network/ftso/guides/query-feed-configuration

This guide provides code examples demonstrating how to read FTSOv2 feed configurations offchain using various programming languages. To achieve this, you need two key pieces of information:

1.  **RPC Endpoint URL:** The RPC Endpoint URL determines which network your code will interact with. You can either use a node provider service or point to your [own RPC node](/run-node#rpc-node). A list of public and private RPC endpoints for all Flare networks is available on the [Network Configuration](/network/overview#configuration) page.
    
2.  **Contract Address:** The address for the `FastUpdatesConfiguration` contract varies by network. You can obtain this address in two ways:
    
    -   **From the Solidity Reference page:** Find the `FastUpdatesConfiguration` address for each network on the [Solidity Reference](/ftso/solidity-reference) page.
        
        **OR**
        
    -   **Query the FlareContractRegistry Contract:** The `FlareContractRegistry` contract has the same address across all networks. You can query it to get the `FastUpdatesConfiguration` contract address. Refer to the specific language guides for examples: - [JavaScript](/network/guides/flare-for-javascript-developers#make-query) - [Python](/network/guides/flare-for-python-developers#make-query) - [Rust](/network/guides/flare-for-rust-developers#make-query) - [Go](/network/guides/flare-for-go-developers#make-query)
        

tip

All examples in this guide are available at [developer-hub/examples](https://github.com/flare-foundation/developer-hub/tree/main/examples).

This example uses [web3.js](https://github.com/web3/web3.js) and [Flare Periphery Contract Artifacts](https://www.npmjs.com/package/@flarenetwork/flare-periphery-contract-artifacts) to retrieve FTSOv2 feed configurations on Flare Testnet Coston2.

```
npm install web3npm install @flarenetwork/flare-periphery-contract-artifacts
```

ftsov2\_config.js

```
// THIS IS EXAMPLE CODE. DO NOT USE THIS CODE IN PRODUCTION.import { Web3 } from "web3";import { interfaceToAbi } from "@flarenetwork/flare-periphery-contract-artifacts";// FastUpdatesConfiguration address (Flare Testnet Coston2)// See https://dev.flare.network/ftso/solidity-referenceconst ADDRESS = "0xE7d1D5D58cAE01a82b84989A931999Cb34A86B14";const RPC_URL = "https://coston2-api.flare.network/ext/C/rpc";// ABI for FastUpdatesConfiguration contractconst abi = interfaceToAbi("IFastUpdatesConfiguration", "coston2");export async function main() {  // Connect to an RPC node  const w3 = new Web3(RPC_URL);  // Set up contract instance  const ftsov2Config = new w3.eth.Contract(abi, ADDRESS);  // Fetch feed configurations  const res = await ftsov2Config.methods.getFeedConfigurations().call();  // Log results  for (const feed of res) {    console.log(      "feedId:",      Buffer.from(feed["feedId"].slice(2), "hex").toString("utf-8"),      "rewardBandValue:",      feed["rewardBandValue"],      "inflationShare:",      feed["inflationShare"],    );  }  return res;}main();
```

This example uses [web3.js](https://github.com/web3/web3.js) and [Flare Periphery Contract Artifacts](https://www.npmjs.com/package/@flarenetwork/flare-periphery-contract-artifacts) to retrieve FTSOv2 feed configurations on Flare Testnet Coston2.

```
npm install ethersnpm install @flarenetwork/flare-periphery-contract-artifacts
```

ftsov2\_config.js

```
// THIS IS EXAMPLE CODE. DO NOT USE THIS CODE IN PRODUCTION.import { ethers } from "ethers";import { interfaceToAbi } from "@flarenetwork/flare-periphery-contract-artifacts";// FastUpdatesConfiguration address (Flare Testnet Coston2)// See https://dev.flare.network/ftso/solidity-referenceconst ADDRESS = "0xE7d1D5D58cAE01a82b84989A931999Cb34A86B14";const RPC_URL = "https://coston2-api.flare.network/ext/C/rpc";// ABI for FastUpdatesConfiguration contractconst abi = interfaceToAbi("IFastUpdatesConfiguration", "coston2");export async function main() {  // Connect to an RPC node  const provider = new ethers.JsonRpcProvider(RPC_URL);  // Set up contract instance  const ftsov2Config = new ethers.Contract(ADDRESS, abi, provider);  // Fetch feed configurations  const res = await ftsov2Config.getFeedConfigurations();  // Log results  for (const feed of res) {    console.log(      "feedId:",      Buffer.from(feed["feedId"].slice(2), "hex").toString("utf-8"),      "rewardBandValue:",      feed["rewardBandValue"],      "inflationShare:",      feed["inflationShare"],    );  }  return res;}
```

This example uses [web3.py](https://github.com/ethereum/web3.py) to retrieve FTSOv2 feed configurations on Flare Testnet Coston2.

```
uv add web3
```

```
pip install web3
```

ftsov2\_config.py

```
# THIS IS EXAMPLE CODE. DO NOT USE THIS CODE IN PRODUCTION.import asynciofrom web3 import AsyncHTTPProvider, AsyncWeb3# FastUpdatesConfiguration address (Flare Testnet Coston2)# See https://dev.flare.network/ftso/solidity-referenceADDRESS = "0xE7d1D5D58cAE01a82b84989A931999Cb34A86B14"RPC_URL = "https://coston2-api.flare.network/ext/C/rpc"# ABI for FastUpdatesConfiguration contractABI = '[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_governanceSettings","internalType":"contract IGovernanceSettings"},{"type":"address","name":"_initialGovernance","internalType":"address"},{"type":"address","name":"_addressUpdater","internalType":"address"}]},{"type":"event","name":"FeedAdded","inputs":[{"type":"bytes21","name":"feedId","internalType":"bytes21","indexed":true},{"type":"uint32","name":"rewardBandValue","internalType":"uint32","indexed":false},{"type":"uint24","name":"inflationShare","internalType":"uint24","indexed":false},{"type":"uint256","name":"index","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"FeedRemoved","inputs":[{"type":"bytes21","name":"feedId","internalType":"bytes21","indexed":true},{"type":"uint256","name":"index","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"FeedUpdated","inputs":[{"type":"bytes21","name":"feedId","internalType":"bytes21","indexed":true},{"type":"uint32","name":"rewardBandValue","internalType":"uint32","indexed":false},{"type":"uint24","name":"inflationShare","internalType":"uint24","indexed":false},{"type":"uint256","name":"index","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"GovernanceCallTimelocked","inputs":[{"type":"bytes4","name":"selector","internalType":"bytes4","indexed":false},{"type":"uint256","name":"allowedAfterTimestamp","internalType":"uint256","indexed":false},{"type":"bytes","name":"encodedCall","internalType":"bytes","indexed":false}],"anonymous":false},{"type":"event","name":"GovernanceInitialised","inputs":[{"type":"address","name":"initialGovernance","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"GovernedProductionModeEntered","inputs":[{"type":"address","name":"governanceSettings","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"TimelockedGovernanceCallCanceled","inputs":[{"type":"bytes4","name":"selector","internalType":"bytes4","indexed":false},{"type":"uint256","name":"timestamp","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"TimelockedGovernanceCallExecuted","inputs":[{"type":"bytes4","name":"selector","internalType":"bytes4","indexed":false},{"type":"uint256","name":"timestamp","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addFeeds","inputs":[{"type":"tuple[]","name":"_feedConfigs","internalType":"struct IFastUpdatesConfiguration.FeedConfiguration[]","components":[{"type":"bytes21","name":"feedId","internalType":"bytes21"},{"type":"uint32","name":"rewardBandValue","internalType":"uint32"},{"type":"uint24","name":"inflationShare","internalType":"uint24"}]}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"cancelGovernanceCall","inputs":[{"type":"bytes4","name":"_selector","internalType":"bytes4"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"executeGovernanceCall","inputs":[{"type":"bytes4","name":"_selector","internalType":"bytes4"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IIFastUpdater"}],"name":"fastUpdater","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"_addressUpdater","internalType":"address"}],"name":"getAddressUpdater","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"","internalType":"struct IFastUpdatesConfiguration.FeedConfiguration[]","components":[{"type":"bytes21","name":"feedId","internalType":"bytes21"},{"type":"uint32","name":"rewardBandValue","internalType":"uint32"},{"type":"uint24","name":"inflationShare","internalType":"uint24"}]}],"name":"getFeedConfigurations","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes21","name":"_feedId","internalType":"bytes21"}],"name":"getFeedId","inputs":[{"type":"uint256","name":"_index","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes21[]","name":"_feedIds","internalType":"bytes21[]"}],"name":"getFeedIds","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"_index","internalType":"uint256"}],"name":"getFeedIndex","inputs":[{"type":"bytes21","name":"_feedId","internalType":"bytes21"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getNumberOfFeeds","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"","internalType":"uint256[]"}],"name":"getUnusedIndices","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"governance","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IGovernanceSettings"}],"name":"governanceSettings","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialise","inputs":[{"type":"address","name":"_governanceSettings","internalType":"contract IGovernanceSettings"},{"type":"address","name":"_initialGovernance","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isExecutor","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"productionMode","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeFeeds","inputs":[{"type":"bytes21[]","name":"_feedIds","internalType":"bytes21[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"switchToProductionMode","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"allowedAfterTimestamp","internalType":"uint256"},{"type":"bytes","name":"encodedCall","internalType":"bytes"}],"name":"timelockedCalls","inputs":[{"type":"bytes4","name":"selector","internalType":"bytes4"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateContractAddresses","inputs":[{"type":"bytes32[]","name":"_contractNameHashes","internalType":"bytes32[]"},{"type":"address[]","name":"_contractAddresses","internalType":"address[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateFeeds","inputs":[{"type":"tuple[]","name":"_feedConfigs","internalType":"struct IFastUpdatesConfiguration.FeedConfiguration[]","components":[{"type":"bytes21","name":"feedId","internalType":"bytes21"},{"type":"uint32","name":"rewardBandValue","internalType":"uint32"},{"type":"uint24","name":"inflationShare","internalType":"uint24"}]}]}]'  # noqa: E501async def main() -> list:    # Connect to an RPC node    w3 = AsyncWeb3(        AsyncHTTPProvider(RPC_URL),    )    # Set up contract instance    ftsov2_config = w3.eth.contract(address=w3.to_checksum_address(ADDRESS), abi=ABI)    # Fetch feed configurations    feed_configurations = await ftsov2_config.functions.getFeedConfigurations().call()    # Print results    for feed_id, reward_band_value, inflation_share in feed_configurations:        print(            f"feedId: {feed_id.decode('ascii')}, "            f"rewardBandValue: {reward_band_value}, "            f"inflationShare: {inflation_share}"        )    return feed_configurationsif __name__ == "__main__":    asyncio.run(main())
```

This example uses [alloy-rs](https://github.com/alloy-rs) to retrieve FTSOv2 feed configurations on Flare Testnet Coston2.

```
cargo add alloy eyre tokio --features alloy/full,tokio/rt,tokio/rt-multi-thread,tokio/macros
```

src/bin/ftsov2\_config.rs

```
// THIS IS EXAMPLE CODE. DO NOT USE THIS CODE IN PRODUCTION.use alloy::{primitives::address, providers::ProviderBuilder, sol};use eyre::Result;sol!(    #[sol(rpc)]    FastUpdatesConfiguration,    r#"[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_governanceSettings","internalType":"contract IGovernanceSettings"},{"type":"address","name":"_initialGovernance","internalType":"address"},{"type":"address","name":"_addressUpdater","internalType":"address"}]},{"type":"event","name":"FeedAdded","inputs":[{"type":"bytes21","name":"feedId","internalType":"bytes21","indexed":true},{"type":"uint32","name":"rewardBandValue","internalType":"uint32","indexed":false},{"type":"uint24","name":"inflationShare","internalType":"uint24","indexed":false},{"type":"uint256","name":"index","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"FeedRemoved","inputs":[{"type":"bytes21","name":"feedId","internalType":"bytes21","indexed":true},{"type":"uint256","name":"index","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"FeedUpdated","inputs":[{"type":"bytes21","name":"feedId","internalType":"bytes21","indexed":true},{"type":"uint32","name":"rewardBandValue","internalType":"uint32","indexed":false},{"type":"uint24","name":"inflationShare","internalType":"uint24","indexed":false},{"type":"uint256","name":"index","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"GovernanceCallTimelocked","inputs":[{"type":"bytes4","name":"selector","internalType":"bytes4","indexed":false},{"type":"uint256","name":"allowedAfterTimestamp","internalType":"uint256","indexed":false},{"type":"bytes","name":"encodedCall","internalType":"bytes","indexed":false}],"anonymous":false},{"type":"event","name":"GovernanceInitialised","inputs":[{"type":"address","name":"initialGovernance","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"GovernedProductionModeEntered","inputs":[{"type":"address","name":"governanceSettings","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"TimelockedGovernanceCallCanceled","inputs":[{"type":"bytes4","name":"selector","internalType":"bytes4","indexed":false},{"type":"uint256","name":"timestamp","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"TimelockedGovernanceCallExecuted","inputs":[{"type":"bytes4","name":"selector","internalType":"bytes4","indexed":false},{"type":"uint256","name":"timestamp","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addFeeds","inputs":[{"type":"tuple[]","name":"_feedConfigs","internalType":"struct IFastUpdatesConfiguration.FeedConfiguration[]","components":[{"type":"bytes21","name":"feedId","internalType":"bytes21"},{"type":"uint32","name":"rewardBandValue","internalType":"uint32"},{"type":"uint24","name":"inflationShare","internalType":"uint24"}]}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"cancelGovernanceCall","inputs":[{"type":"bytes4","name":"_selector","internalType":"bytes4"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"executeGovernanceCall","inputs":[{"type":"bytes4","name":"_selector","internalType":"bytes4"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IIFastUpdater"}],"name":"fastUpdater","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"_addressUpdater","internalType":"address"}],"name":"getAddressUpdater","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"","internalType":"struct IFastUpdatesConfiguration.FeedConfiguration[]","components":[{"type":"bytes21","name":"feedId","internalType":"bytes21"},{"type":"uint32","name":"rewardBandValue","internalType":"uint32"},{"type":"uint24","name":"inflationShare","internalType":"uint24"}]}],"name":"getFeedConfigurations","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes21","name":"_feedId","internalType":"bytes21"}],"name":"getFeedId","inputs":[{"type":"uint256","name":"_index","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes21[]","name":"_feedIds","internalType":"bytes21[]"}],"name":"getFeedIds","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"_index","internalType":"uint256"}],"name":"getFeedIndex","inputs":[{"type":"bytes21","name":"_feedId","internalType":"bytes21"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getNumberOfFeeds","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"","internalType":"uint256[]"}],"name":"getUnusedIndices","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"governance","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IGovernanceSettings"}],"name":"governanceSettings","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialise","inputs":[{"type":"address","name":"_governanceSettings","internalType":"contract IGovernanceSettings"},{"type":"address","name":"_initialGovernance","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isExecutor","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"productionMode","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeFeeds","inputs":[{"type":"bytes21[]","name":"_feedIds","internalType":"bytes21[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"switchToProductionMode","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"allowedAfterTimestamp","internalType":"uint256"},{"type":"bytes","name":"encodedCall","internalType":"bytes"}],"name":"timelockedCalls","inputs":[{"type":"bytes4","name":"selector","internalType":"bytes4"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateContractAddresses","inputs":[{"type":"bytes32[]","name":"_contractNameHashes","internalType":"bytes32[]"},{"type":"address[]","name":"_contractAddresses","internalType":"address[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateFeeds","inputs":[{"type":"tuple[]","name":"_feedConfigs","internalType":"struct IFastUpdatesConfiguration.FeedConfiguration[]","components":[{"type":"bytes21","name":"feedId","internalType":"bytes21"},{"type":"uint32","name":"rewardBandValue","internalType":"uint32"},{"type":"uint24","name":"inflationShare","internalType":"uint24"}]}]}]"#);#[tokio::main]async fn main() -> Result<()> {    // FastUpdatesConfiguration address (Flare Testnet Coston2)    // See https://dev.flare.network/ftso/solidity-reference    let address = address!("222768c5AbCe56Af9Fd75c5f59614a8B7F5dBe80");    let rpc_url = "https://coston2-api.flare.network/ext/C/rpc".parse()?;    // Connect to an RPC node    let provider = ProviderBuilder::new().connect_http(rpc_url);    // Set up contract instance    let ftsov2_config = FastUpdatesConfiguration::new(address, provider);    // Fetch feed configurations    let result = ftsov2_config.getFeedConfigurations().call().await?;    // Print results    for feed in result {        println!(            "feedId: {}, rewardBandValue: {}, inflationShare: {}",            String::from_utf8(feed.feedId.as_slice().to_vec())?,            feed.rewardBandValue,            feed.inflationShare        );    }    Ok(())}
```

This example uses the Go API from [Geth](https://geth.ethereum.org) to retrieve FTSOv2 feed configurations on Flare Testnet Coston2.

```
go get github.com/ethereum/go-ethereum/ethclient
```

With Go, you need to manually fetch the contract's ABI and generate the Go bindings.

Copy the [FastUpdatesConfiguration ABI](https://api.routescan.io/v2/network/testnet/evm/114/etherscan/api?module=contract&action=getabi&address=0xE7d1D5D58cAE01a82b84989A931999Cb34A86B14&format=raw) and paste it into a file named `FastUpdatesConfiguration.abi`, located in the root of your project, i.e. same level as `go.mod`. Then using [abigen](https://geth.ethereum.org/docs/tools/abigen), generate the Go bindings.

```
abigen --abi FastUpdatesConfiguration.abi --pkg main --type FastUpdatesConfiguration --out FastUpdatesConfiguration.go
```

ftsov2\_config.go

```
// THIS IS EXAMPLE CODE. DO NOT USE THIS CODE IN PRODUCTION.package mainimport (	"context"	"fmt"	"github.com/ethereum/go-ethereum/accounts/abi/bind"	"github.com/ethereum/go-ethereum/common"	"github.com/ethereum/go-ethereum/ethclient")func FtsoV2Config() {	// FastUpdatesConfiguration address (Flare Testnet Coston2)	// See https://dev.flare.network/ftso/solidity-reference	address := common.HexToAddress("0xE7d1D5D58cAE01a82b84989A931999Cb34A86B14")	rpcUrl := "https://coston2-api.flare.network/ext/C/rpc"	// Connect to an RPC node	client, _ := ethclient.Dial(rpcUrl)	// Set up contract instance	ftsov2, _ := NewFastUpdatesConfiguration(address, client)	// Fetch current feeds	opts := &bind.CallOpts{Context: context.Background()}	res, _ := ftsov2.GetFeedConfigurations(opts)	// Print results	for i := 0; i < len(res); i++ {		fmt.Printf("feedId: %s, rewardBandValue %d, inflationShare %d\n", string(res[i].FeedId[:]), res[i].RewardBandValue, res[i].InflationShare)	}}
```
