Epoch API
Last updated
An epoch is a certain period of time in which the network operates.
Each epoch, the network assigns a new quorum, new sequences of shard leaders, and so on.
Use this list of APIs to get information about epoch data.
In our system, the threads of block confirmation and their processing (i.e. parsing transactions and executing them to change the state) work independently of each other.
This is logical - the network in one thread votes for accepted blocks, and in another thread - simply searches for the next block and proofs of approval of this block for its processing.
Since these tasks are asynchronous, the epochs on the threads may differ. Most of the time they will be the same, but sometimes they may still differ
To request the current epoch on the threads, call:
await web1337.getCurrentEpochOnThread("vt");await web1337.getCurrentEpochOnThread("at");Leader is a validator who generate blocks in a particular timeframe.
Each epoch, each shard is assigned a list of leaders who will receive their own window for generating blocks for a certain time.
To find out who is currently generating blocks, use this API
You can find out the current epoch from the API examples above. You can also find out the index of the current epoch there.
However, if you want to study the historical data of the network, you can request data on a certain epoch by its index.
For example, to request data on the very first epoch, call this API:
This API returns stats for specific epoch. You can use this API, for example, for time series charts. It's also useful for metrics and stats tracking:
Last updated
await web1337.getCurrentLeader();let epochIndex = 0;
await web1337.getEpochDataByEpochIndex(epochIndex);let epochIndex = 196;
await web1337.getVerificationThreadStatsPerEpoch()