Developers
Get Started
How to Query Network Data using allorad

How to Query Network Data using allorad

To query network-level data on the Allora chain using the allorad CLI, you need to interact with various RPC methods designed to return aggregate or holistic information about the network. These methods enable you to pull data that is crucial for understanding the overall state and performance of the network.

Prerequisites

Query Functions

These functions read from the appchain only and do not write. Add the Command value into your query to retrieve the expected data.

allorad q emissions [Command] --node <RPC_URL>

Get Latest Available Network Inferences

  • RPC Method: GetLatestAvailableNetworkInferences
  • Command: latest-available-network-inferences [topic_id]
  • Description: Returns the latest network inference for a given topic, but only if all necessary information to compute the inference is present. The result is only provided when complete data from the network is available to ensure accuracy.
  • Positional Arguments:
    • topic_id: The identifier of the topic for which you want to retrieve the latest available network inference.

Use Case:

Why use it?

  • This command is useful when you need to retrieve the most recent network-wide inference for a topic, ensuring that all necessary data has been collected and processed. It is ideal for situations where decision-making relies on the completeness of the data and where partial data may lead to inaccurate conclusions.

Example Scenario:

  • If you want to make a decision based on network predictions, but only when the inference is fully computed, use this command. For example, you might want the latest ETH price prediction, but only when all worker and forecaster data is available to provide an accurate result.

Get Total Rewards to Distribute

  • RPC Method: GetTotalRewardToDistribute
  • Command: total-rewards
  • Description: Returns the total amount of rewards that will be distributed across all rewardable topics in the current block. It provides an aggregate view of the rewards available for distribution.

Use Case:

Why use it?

  • This command is useful if you want to understand the total reward pool for a given block. It helps participants gauge the potential rewards available and how they may be distributed across topics based on performance.

Example Scenario:

  • As a worker or forecaster, you might use this command to estimate the reward pool for the current block. This allows you to understand the potential total rewards before they are distributed across different topics and participants.

Get Current Module Parameters

  • RPC Method: GetParams
  • Command: params
  • Description: Retrieves the current parameters of the module in the Allora network. It is used to check the configuration and settings that control various aspects of the module's behavior.
  • Positional Arguments:
    • This command does not require any positional arguments.

Use Case:

Why use it?

  • This command is useful for querying the configuration settings of the module. It provides transparency into how the module is configured and allows participants to verify whether certain parameters, such as reward distribution rules or other operational settings, are up-to-date.

Example Scenario:

  • If you're troubleshooting the behavior of a module or need to verify the configuration before making any changes, this command can give you insight into the current parameters and their values.