Reporting With Telliot

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

Reporting a Price

It's really simple to report data with Telliot.

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

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 Fetch Dashboard, top left of the page!

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

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!

Congratulations you submitted your first report! 🎉

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

Detailed info about wallet address and chain it will try to report after confirming password

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.

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

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.

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.

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

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

Last updated