Fetch Oracle
  • Welcome to Fetch
  • THE BASICS
    • What Problem Does Fetch Solve?
    • What Can You Do With Fetch?
    • The FETCH Token
    • Staking
    • Contracts Overview
    • Contract Addresses
    • Contributing
    • Audits
  • REPORTING DATA
    • How to Report Data
    • Requirements
      • (Optional) Using Cloud Hosting
    • Installing Telliot
      • Adding Accounts
      • MAC Virtual Machine with UTM
    • Reporting With Telliot
      • Reporting Options
      • Discord Notifications
    • Gas Fees
    • Add support for a new spot price
  • GETTING DATA
    • Tipping
    • Receiving Data From Fetch
    • Solidity
    • User Checklists
    • Testnet
    • Creating a Query
  • VOTES & DISPUTES
    • Voting
    • Disputing
    • Introduction to DVM
      • Installing DVM
      • Monitoring
  • OPTIONAL CONFIGS
    • Claim Tip Script ENV Config
  • Connect
    • Whitepaper
    • Telegram
    • Twitter/X
    • YouTube
Powered by GitBook
On this page
  • Reporting a Price
  • Reporting a Random Number using RNG
  • Process Overview
  • Detailed steps
  • RNG on Fetch Dashboard
  1. REPORTING DATA

Reporting With Telliot

Learn how to automatically report data using the command line tool.

PreviousMAC Virtual Machine with UTMNextReporting Options

Last updated 2 months ago

Reporting a Price

It's really simple to report data with Telliot.

First, make sure you're in python's virtual environment (venv):

Everytime you run Telliot or DVM you need to enter this virtual environment. To enter it, go to telliot-feeds folder and run source venv/bin/activate. To exit it, run deactivate.

Through the command line you can use cd <name of folder> to enter a folder and cd .. to move one folder up (go back).

Now, confirm you have at least the minimum current stake amount of FETCH in your reporter's wallet address and run the command below to report a median spot price for PLS/USD.

You can check the current minimum stake amount in , top left of the page!

telliot report -a <yourAccName> -qt pls-usd-spot

telliot report is the base command to submit reports. -a is the option where you declare the acc name for the wallet you want to use. -qt is the query tag you want to report.

After running the above, Telliot will: Display some detailed info about contracts and where it is going to try to report, ask for your acc password, try to stake if you don't have the minimum stake amount and try to submit the report. That's it!

Each reporter is responsible for the data they're submitting.

Make sure to check FIRST which feed you are reporting for what sources they are using! (Submitting data to Testnet first is a great way to get familiar with Reporting without risking real money)

Submitting data that is deemed incorrect may be challenged by anyone in the community and you risk losing at least 1 stake per report disputed!

It's highly beneficial and recommended to check within the community of reporters which feeds and sources are being accepted as truth and what are the thresholds of tolerance for monitoring data submitted.

You can get more info on all the above at the official telegram group:

Below are the detailed information of what happens in the process:

Telliot will automatically calculate the current min stake amount and try to stake it by asking you to confirm your password again to submit a deposit transaction.

After that it will calculate the PLS/USD price using its sources and submit the median price.

After staking it calculates the PLS/USD price and submits it on chain. It will keep trying to report again after 7 seconds by default.

To stop it, press ctrl + c.

It will also display an approximate time for when you'll be able to submit a report again, based on the current min stake amount in the contract and your deposited stake amount.

Remember: It will keep trying to report to the same query tag unless you stop Telliot by pressing ctrl + c.

Reporting a Random Number using RNG

This is an example demonstrating how Fetch can be used to generate a ‘random’ number, based on the original Tellor RNG example feed.

Before using this example in Mainnet, where disputes may arise, proper due diligence is required. The primary goal is to showcase additional potential use cases for Fetch.

Process Overview

1. User Input: The user provides a timestamp.

2. Fetching Blocks: Telliot retrieves the next Bitcoin (BTC) and PulseChain (PLS) blocks based on the given timestamp.

3. Random Number Generation: A random number is generated using data from the retrieved blocks.

4. Reporting: The generated number is encoded and submitted for reporting.

Detailed steps

To report a random number using Telliot RNG use the query tag tellor-rng-example

The process begins by prompting the user to input a timestamp: From this timestamp, it will fetch the next BTC and PLS block.

Enter timestamp for generating a random number:
1742466660

Telliot confirms the generation process:

Generating random number from timestamp: 1742466660
Press [ENTER] to confirm.

Telliot retrieves the latest BTC block:

INFO | telliot_feeds.sources.blockhash_aggregator | Using BTC block number 888619

Next, it fetches the corresponding block from PulseChain (chain ID: 369):

INFO | telliot_feeds.sources.blockhash_aggregator | Trying to fetch block from chain: 369
INFO | telliot_feeds.sources.blockhash_aggregator | Block api data: {'blockNumber': '22996631'}
INFO | telliot_feeds.sources.blockhash_aggregator | Block received: 22996631
INFO | telliot_feeds.sources.blockhash_aggregator | Using block number 22996631

The random number is derived from the two retrieved blocks and stored:

INFO    | telliot_feeds.sources.blockhash_aggregator | Stored random number for timestamp 1742466660: 0x1989faad8a133a7ce5da64eddd6679a9dd3ef61f893da049895dc92c0f31663f
DEBUG   | telliot_feeds.reporters.tellor_360 | Current query: {"type":"TellorRNG","timestamp":0}

The random number is encoded for reporting:

DEBUG   | telliot_feeds.reporters.tellor_360 | Reporter Encoded value: 1989faad8a133a7ce5da64eddd6679a9dd3ef61f893da049895dc92c0f31663f

RNG on Fetch Dashboard

Currently, the Fetch Dashboard does not display the query or the generated random number. However, the reported data can be seen in the Discord notifications. Below is an example RNG notification in Discord;

Query: {"type":"TellorRNG","timestamp":0}
Price Submitted: 11,551,609,377,654,775,654,021,618,183,836,409,979,244,170,088,532,462,796,800

Congratulations you submitted your first report!

We encourage others to build upon this idea, improve it, or create new RNG feeds and data sources. If you would like to contribute, consider submitting a review on to enable broader participation in data provision.

🎉
Fetch Dashboard
https://t.me/fetchoracle
GitHub
Detailed info about wallet address and chain it will try to report after confirming password
If the FETCH price being used has changed, it can calculate the current stake amount for a new stake
Details about staking and asking for password to confirm the deposit of the min stake amount
Stake deposited and it will continue to submit the price
It has reported and tried again to report after 7 seconds. It's in 'reporter lock' period and the time left for a possible new report is displayed.