Clock
sysvar (unix_timestamp
) rather than local or client clocks.SLOT_NUMBER
with the desired slot and CHAINSTACK_SOLANA_URL
with your Solana node endpoint.
SLOT_NUMBER
and CHAINSTACK_SOLANA_URL
with your Solana node endpoint.
Clock
sysvarClock
sysvar:
unix_timestamp
— consensus-agreed timestamp of the current slot, updated every slot.1743118653
(Unix timestamp for Thursday, March 27, 2025, 23:37:33 UTC)1743211690
(Saturday, March 29, 2025, 01:28:10 UTC)1743118653 + 93204 = 1743211857
329849011
should be around 1743211857
(remember we also rounded up).
Step 4: what’s the allowed ange? The timestamp can drift:
Clock::get()?.unix_timestamp
) for critical on-chain logic. Do not depend on client-side or local times.getBlock
takes a slot number but returns block-specific information, including block height. Again, Solana: Understanding the difference between blocks and slots.getBlock
calls efficiently — see Solana: optimize your getBlock performance.