-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Missing block timestamp in the block details #2811
Comments
Which timestamp do you need? The one that is used in the block while building it? |
@bkchr Yes, I think so because every event in the block will take the same timestamp. |
As the timestamp is stored in the block, you should be able to extract it. Cc @jacogr if it is js. |
Substrate does not have the concept of "a block timestamp". However, in each block an inherent is added (assuming it is pure substrate) which does the timestamp setting. So to extract, you would need to look at the extrinsics in the block, e.g https://polkascan.io/pre/alexander/system/block/1651859 So to extract -
|
@bkchr Yes, I want to access from the js. Thanks @jacogr to make me understand the process. Out of curiosity, I want to ask one more thing what does the second extrinsic do it also shows some data. By seeing its data I can guess that it gives the previous block number. Could you please shed some light on this as well.
|
This is probably the aura slot number you are seeing. |
For some reason, we never exposed the human-readable module & method names on the actual Method. (Easy enough to find, however from a convenience pov, was missing - addressed in polkadot-js/api#975) So on polkadot, it always adds parachains.setHeads (as intrinsic #2) - can see that in the polkadot.js.org/apps explorer (or on polkascan). Substrate only adds the first by default. |
I don't know whether it was intentional or it was missed to add the timestamp of the block in the block metadata.
I was trying to access the event data and the timestamp at which events get emitted but it seems impossible to get
Block Data -
Event data -
In both data sets there is no way to get the timestamp
The text was updated successfully, but these errors were encountered: