LogoLogo
  • The Basics
    • Welcome
    • Fundamentals
    • Contracts Overview
    • Contracts Reference
    • Tutorials
  • Getting Data
    • Introduction
    • Solidity Integration
    • User Checklists
    • Local Testing
    • Testnet
    • Creating a Query
    • Funding a Feed
    • Tellor Functions
    • DataSpecs Registry
    • SnapShot Vote Results
  • Reporting Data
    • Introduction
    • Becoming a Reporter
    • Getting Paid
  • Disputing Data
    • Introduction
    • Monitoring
    • How to Dispute
    • Voting/Resolution
  • Vulnerability Disclosure
Powered by GitBook
On this page
  • Deployed Contracts
  • Contract Interactions
  • How to Contribute

Was this helpful?

  1. Getting Data

DataSpecs Registry

PreviousTellor FunctionsNextSnapShot Vote Results

Last updated 1 year ago

Was this helpful?

DataSpecsRegistry is an on-chain registry for tellor oracle query types. Users register a query type name and pay a fee which determines the registration duration. The user then sets the IPFS document hash of the dataspec document in the registry contract. This provides an on-chain, tamperproof record of all Tellor query type definitions.

to view and manage query type registrations.

Deployed Contracts

Polygon - Official Deployment

Sepolia Testnet

Contract Interactions

Register a Query Type

Registering a query type requires some TRB tokens and a unique query type name string. The minimum registration time is one year, and registrations cost $1000 per year in TRB. To find the current cost per year in TRB, we'll call getCostperYearInTRB:

Now we know the minimum amount of TRB we need to register our query type.


Next, we will approve the token transfer in the token contract by inputting the registry contract address and an amount for one year's worth of tokens.


Now we can register our query type in the registry contract. For the name of our query type, we'll use ExampleQueryType, and again we'll input a token fee amount for a one year registration:


Now we finally have a query type registered.


Manage a Query Type

There are a few actions you can take to manage your query type. The extendRegistration function can be used to extend the registration time for an existing query type. It can be called by anyone, and any amount of tokens can be paid.

Each query type registration has a manager role and an owner role. The manager can set the document hash, and the owner can change the manager address and the owner address. The manager and owner addresses can be changed using these functions.

Query the Registry

Function Name
Function Purpose

getAllRegisteredQueryTypes()

Get a list of all registered query type names:

getCostPerYearInTRB()

Get the registration cost per year in TRB tokens

getRegistration("ExampleQueryType")

Get all info for a given query type registration.

getRegistrationreturns a struct in this form:

struct Spec {

address owner; // sets the manager and owner addresses

address manager; // sets the document hash and lock time

string documentHash; // IPFS hash of data specs document (ex: ipfs://bafybeic6nwiuutq2fs3wq7qg5t5xcqghg6bnv65atis3aphjtatb26nc5u)

uint256 expirationTime; // timestamp when spec registration expires

bool registered; // registered at some point in time

}

Install Dependencies:

npm i

Compile Smart Contracts:

npx hardhat compile

Test Locally:

npx hardhat test

How to Contribute

We have officially registered a query type, but now we need to set our IPFS data specs document hash. There are many ways to get a document on IPFS, but one quick solution can be found at .

Check out our issues log here on Github, join our or feel free to reach out anytime at info@tellor.io.

nft.storage
discord
See the official frontend
0x06Be23ea84148a5E439dFe2A0bcCE441ea74E2D6
0x9413c3b2Fb74A7b7e6CDeBa683b31646Ceb534F2