Basic concepts of the ADAMANT blockchain you need to know if you're interacting with the blockchain or just running a node.
ADM is the native token of the ADAMANT blockchain. It’s used to pay transaction fees and can be transferred between accounts. For consistency and precision, ADM amounts and fees are stored as strings in transactions and measured in 1/108 ADM (1 ADM = 100,000,000).
Every transaction in ADAMANT requires a fee, paid in ADM. Fees help prevent spam and support the network. Fees are intentionally very low, making ADAMANT affordable for active messaging.
Most transaction types have a fixed fee, but Message and Key-Value Store (KVS) transaction fees scale with content length.
You can get blockchain fees using the /api/blocks/getFees API endpoint.
A timestamp in ADAMANT shows how many seconds have passed since the creation of the blockchain — the blockchain epoch, set at September 2, 2017, 17:00:00 GMT+0.
For example, to convert time to ADAMANT's timestamp using TypeScript:
const EPOCH = Date.UTC(2017, 8, 2, 17, 0, 0, 0);
/**
* Converts provided timestamp into ADAMANT's epoch timestamp
* @param time - timestamp in ms
*/
const getEpochTime = (time: number = Date.now()) =>
Math.floor((time - EPOCH) / 1000);Some upgraded transaction responses also include timestampMs. This value uses the same ADAMANT epoch, but in milliseconds. It is not a Unix timestamp.
/**
* Converts provided timestamp into ADAMANT's epoch timestamp in ms
* @param time - timestamp in Unix ms
*/
const getEpochTimeMs = (time: number = Date.now()) => time - EPOCH;
const timestampMs = getEpochTimeMs();
const timestamp = Math.floor(timestampMs / 1000);Clients should derive timestamp from timestampMs with Math.floor(timestampMs / 1000). Do not use Math.round() or Math.ceil(), because this can make timestampMs belong to the previous ADAMANT second while timestamp points to the next one.
After the spaceship consensus activation, nodes can store and return timestampMs for transactions that include it. Historical transactions and transactions from older clients may still have timestampMs: null, so clients should prefer timestampMs for ordering when it exists and fall back to timestamp * 1000 otherwise.
You can get blockchain's epoch time using /blocks/getEpochTime endpoint. Additionally, consider using /blocks/getStatus or /node/status endpoints to get more blockchain and network information in a single request.
Milestones define block rewards for delegates and are triggered at specific block heights.
You can use REST API to: