Smart Contracts
Key Components of the Hemera Protocol
Indexer registry
Indexers stake and register to the network. After registration, validators will distribute queries to the indexer. Indexers should also submit proof of indexing records periodically and broadcast them to the whole network.
Indexers capable of real-time indexing should set a flag in their metadata. The flag status is broadcasted to indicate real-time indexing capability and should be updated regularly.
Query book
Validators upload all the queries from end users. Validators submit records of any indexer failures, including inactive indexers and incorrect query results.
The query book should run settlements regularly. Following settlement, the balances for indexers and end users should be updated accordingly.
User account
End users must deposit a specified amount of $DAY tokens as a stake. A key will be generated for the user. Users should be able to check overall usage and manage account balances (deposit or withdraw $DAY tokens).
Key Functions for Protocol Participants
Indexers
Stake $DAY token to the smart contract and register to the network
Submit "proof of indexing" to the smart contract
Broadcast real-time indexing status
Validators
Check the indexing status through the smart contract
Record usage history by batch (usage from end users & query served by indexers)
Submit indexer failure (including inactive indexer and wrong query result) records
Administrator
Triggers settlement for indexer/validator/end user
End users/developers
Stake $DAY tokens and get valid keys to access the data API