Node and Blockchain
List of endpoints useful in work with ADAMANT blockchain in general.
Get Peers List
GET /api/peersDescription
Get list of connected peer nodes using endpoint
/api/peers.Node's information includes:
ip— IPv4 address of nodeport— port number of ADAMANT node. 36666 for mainnet or 36667 for testnet.state— state of the peer.Available values:
2— Connected1— Disconnected0— Banned
os— node's operating systemversion— ADAMANT node software versionbroadhash— broadhash on the peer node. Broadhash is established as an aggregated rolling hash of the past five blocks present in the database.height— current node's blockchain heightupdated— Unix timestamp based in ms, when peer updatednonce— unique Identifier for the peer. Random string.syncProtocol—"http"if the node is subscribed to the peer using HTTP only."ws"if the node is subscribed to the peer using WebSocket (which also allows receiving transactions via both WebSocket and HTTP).isBroadcastingViaSocket—trueif the node can send transactions to the peer over WebSocket.
Available parameters:
limit— how many nodes to retrieveoffset— offset value for results- You can use
os,ip, and other parameters for filtering results
Example
Request:
shGET https://endless.adamant.im/api/peersResponse:
json{ "success": true, "nodeTimestamp": 58052600, "peers": [ { "ip": "194.32.79.175", "port": 36666, "state": 2, "os": "linux4.15.0-36-generic", "version": "0.4.0", "broadhash": "3dfdf6c7bbaf7537eac9c70432f7ba1cae835b9b15e4ecd97e147616dde67e62", "height": 10146365, "clock": null, "updated": 1562424199553, "nonce": "jxXV6g0sHJhmDubq", "isBroadcastingViaSocket": false, "syncProtocol": "ws" }, { "ip": "144.217.93.8", "port": 36666, "state": 2, "os": "linux4.4.0-141-generic", "version": "0.4.0", "broadhash": "febfb2ac6fbf0a456fdb6a22d08e37dbe514e547ec7772a1f46c2d2595c89baa", "height": 10146364, "clock": null, "updated": 1562424195742, "nonce": "YngSDjA5MeUNk2iZ", "isBroadcastingViaSocket": false, "syncProtocol": "http" } ] }
Get Peers Stats
GET /api/peers/countDescription
Endpoint
/api/peers/countreturns count of connected, disconnected and banned peers for the requested node.WARNING
Each node maintains its own states for peers and may have discovered a different set of peers, so results can vary between nodes.
Example
Request:
shGET https://endless.adamant.im/api/peers/countResponse:
json{ "success": true, "nodeTimestamp": 239414812, "connected": 136, "disconnected": 3, "banned": 0 }
Get peer by IP and port
GET /api/peers/getDescription
Finds and returns the known peer of the node. See Get Peers List to learn peer's properties.
Required parameters:
ip— peer's IPv4 addressport— peer's port
Example
Request:
shGET https://endless.adamant.im/api/peers/get?ip=138.201.152.191&port=36666Response:
json{ "success": true, "nodeTimestamp": 239415353, "peer": { "ip": "138.201.152.191", "port": 36666, "state": 1, "os": "linux5.15.0-86-generic", "version": "0.8.3", "dappid": null, "broadhash": "15f6beddb5f68854618f0e06f35addadaeee067efd3cdaaae90f5beaf15cd370", "height": 38723235, "clock": null, "updated": 1713630137277, "nonce": "YWXG1LsX0QUw4tFD", "isBroadcastingViaSocket": false, "syncProtocol": "ws" } }
Get Loading Status
GET /api/loader/statusDescription
Endpoint
/api/loader/statusreturns information on node's loading process.loaded—falsewhile the node is verifying blocks during startup.syncing—trueif the node is currently syncing with the network.blocks— Target blockchain height the node is trying to reach during sync. Set to0when syncing is complete.blocksCount— Number of blocks the node needs to verify (e.g. during a full blockchain rebuild).now— Height of the last block loaded at startup. This is not the same as the current blockchain height.
Example
Request:
shGET https://endless.adamant.im/api/loader/statusResponse for node on actual blockchain height:
json{ "success": true, "nodeTimestamp": 58052355, "loaded": true, "now": 10144343, "blocksCount": 0 }Response for node in sync process:
json{ "success": true, "nodeTimestamp": 66424794, "loaded": true, "now": 1, "blocksCount": 1 }
Get Synchronization Status
GET /api/loader/status/syncDescription
Endpoint
/api/loader/status/syncreturns information on node's sync process with other peers:syncing—trueif node is still in sync processblocks— current blockchain height to achieve if in sync process;0if syncing is doneheight— node's blockchain heightbroadhash— broadhash on the peer node. Broadhash is established as an aggregated rolling hash of the past five blocks present in the database.consensus— consensus percentage with other nodes
Example
Request:
shGET https://endless.adamant.im/api/loader/status/syncResponse:
json{ "success": true, "nodeTimestamp": 58052432, "syncing": false, "blocks": 0, "height": 10146332, "broadhash": "09f2f5614cf7209979dc1df2dd92d16aade904dae6c9b68bccaeb234647b3c18", "consensus": 94.32 }
Get Ping Status
GET /api/loader/status/pingDescription
Ping
/api/loader/status/pingto check if the node is alive.Example
Request:
shGET https://endless.adamant.im/api/loader/status/pingResponse:
json{ "success": true }
Get Node Version
GET /api/peers/versionDescription
Endpoint
/api/peers/versionreturns node's software information:version,build, andcommit.Example
Request:
shGET https://endless.adamant.im/api/peers/versionResponse:
json{ "success": true, "nodeTimestamp": 58052984, "build": "", "commit": "b07aaf9580dffb5cc95cc65f303f6f1e5fca7d9c", "version": "0.5.2" }
Get Blockchain Broadhash
GET /api/blocks/getBroadhashDescription
Endpoint
/api/blocks/getBroadhashreturnsbroadhashon the node. Broadhash is established as an aggregated rolling hash of the past five blocks present in the database.Example
Request:
shGET https://endless.adamant.im/api/blocks/getBroadhashResponse:
json{ "success": true, "nodeTimestamp": 58645139, "broadhash": "e1aedd2818679c174e3f6e31891c34f4069927f33f145e1b81fe5d978733e794" }
Get Blockchain Epoch
GET /api/blocks/getEpochDescription
Endpoint
/api/blocks/getEpochreturns the time when blockchain epoch starts. Value2017-09-02T17:00:00.000Zis for ADAMANT mainnet.Example
Request:
shGET https://endless.adamant.im/api/blocks/getEpochResponse:
json{ "success": true, "nodeTimestamp": 58646306, "epoch": "2017-09-02T17:00:00.000Z" }
Get Blockchain Height
GET /api/blocks/getHeightDescription
Endpoint
/api/blocks/getHeightreturns current node's blockchain height.Example
Request:
shGET https://endless.adamant.im/api/blocks/getHeightResponse:
json{ "success": true, "nodeTimestamp": 58047354, "height": 10145318 }
Get Blockchain Fee
GET /api/blocks/getFeeDescription
Endpoint
/api/blocks/getFeereturns the current fee value fortype 0(token transfer) transactions. Integer amount of 1/10^8 ADM tokens (1 ADM = 100000000).Example
Request:
shGET https://endless.adamant.im/api/blocks/getFeeResponse:
json{ "success": true, "nodeTimestamp": 58046803, "fee": 50000000 }
Get Blockchain Fees
GET /api/blocks/getFeesDescription
Endpoint
/api/blocks/getFeesreturns current fee values for different transaction types:send— token transfer, type 0vote— voting for delegate, type 3delegate— registration of a new delegate, type 2old_chat_message— sending a message (not used for now)chat_message— sending a message, type 8state_store— storing data in KVS, type 9profile_update— not used for nowavatar_upload— not used for now
All values are integer amounts of 1/10^8 ADM tokens (1 ADM = 100000000).
More information about blockchain fees: Transaction Fees.
Example
Request:
shGET http://endless.adamant.im/api/blocks/getFeesResponse:
json{ "success": true, "nodeTimestamp": 58046908, "fees": { "send": 50000000, "vote": 5000000000, "delegate": 300000000000, "old_chat_message": 500000, "chat_message": 100000, "state_store": 100000, "profile_update": 5000000, "avatar_upload": 10000000 } }
Get Blockchain Nethash
GET /api/blocks/getNethashDescription
Endpoint
/api/blocks/getNethashdescribes the network. The nethash describes e.g. the Mainnet or the Testnet, that the node is connecting to.Example
Request:
shGET https://endless.adamant.im/api/blocks/getNethashResponse:
json{ "success": true, "nodeTimestamp": 58047702, "nethash": "bd330166898377fb28743ceef5e43a5d9d0a3efd9b3451fb7bc53530bb0a6d64" }
Get Blockchain Milestone
GET /api/blocks/getMilestoneDescription
Endpoint
/api/blocks/getMilestonereturnsmilestone— current slot height, which determines the reward a delegate will get for forging a block.More information about blockchain milestones: Milestones.
Example
Request:
shGET https://endless.adamant.im/api/blocks/getMilestoneResponse:
json{ "success": true, "nodeTimestamp": 58047777, "milestone": 1 }
Get Blockchain Reward
GET /api/blocks/getRewardDescription
Endpoint
/api/blocks/getRewardreturnsreward— the reward a delegate will get for forging a block. Integer amount of 1/10^8 ADM tokens (1 ADM = 100000000). Depends on the current slot height (milestone).Example
Request:
shGET https://endless.adamant.im/api/blocks/getRewardResponse:
json{ "success": true, "nodeTimestamp": 58047028, "reward": 45000000 }
Get Total Supply of ADAMANT Tokens
GET /api/blocks/getSupplyDescription
Endpoint
/api/blocks/getSupplyreturns total current supply of ADM tokens in the network. Integer amount of 1/10^8 ADM tokens (1 ADM = 100000000). Total supply increases with every new forged block.Example
Request:
shGET https://endless.adamant.im/api/blocks/getSupplyResponse:
json{ "success": true, "nodeTimestamp": 58047218, "supply": 10198038140000000 }
Get ADAMANT Blockchain Network Info
GET /api/blocks/getStatusDescription
Integrative endpoint
/api/blocks/getStatusreturns ADAMANT blockchain network information with a single request:Example
Request:
shGET https://endless.adamant.im/api/blocks/getStatusResponse:
json{ "success": true, "nodeTimestamp": 58047435, "broadhash": "4a28272c915f74d118120bb47db547a18a7512e1d48092c48be86939a6d45b89", "epoch": "2017-09-02T17:00:00.000Z", "height": 10145334, "consensusCodeName": "fairSystem", "fee": 50000000, "milestone": 1, "nethash": "bd330166898377fb28743ceef5e43a5d9d0a3efd9b3451fb7bc53530bb0a6d64", "reward": 45000000, "supply": 10198040075000000 }
Get Blockchain and Network Status
GET /api/node/statusDescription
Integrative endpoint
/api/node/statusreturns ADAMANT blockchain network and node information with a single request. The result includesnetwork,version,loader,consensusSchedule,milestoneSchedule, andwsClientinformation.wsClientshows whether the node accepts WebSocket connections and, when enabled, which port clients should use.network.consensusCodeNameidentifies the latest cumulative consensus upgrade active atnetwork.height. It isnullbefore the first configured activation. An upgrade configured for heightHis reported starting at blockH.consensusSchedule.activationHeightsmaps consensus codenames to their activation block heights. These are the node's effective runtime values after defaults, its selected configuration file, and startup overrides are merged. Activation heights are network- and configuration-specific; clients must not assume the example values below.milestoneScheduledescribes the block reward schedule:offset— first block height that receives a block rewarddistance— number of block heights between reward milestonesmilestones— reward at each milestone as integer base units, where1 ADM = 100000000
These fields are additive. Clients that support older node versions should handle their absence.
Example
Request:
shGET https://endless.adamant.im/api/node/statusResponse:
json{ "success": true, "nodeTimestamp": 230021386, "loader": { "loaded": true, "now": 1031082, "syncing": false, "consensus": 100, "blocks": 0, "blocksCount": 0 }, "network": { "broadhash": "2d94f9070fe4ca236aaee9fd9a6863fd0b9291a80b96ac9e470408a852f0f3d8", "epoch": "2017-09-02T17:00:00.000Z", "height": 1034307, "consensusCodeName": "fairSystem", "fee": 50000000, "milestone": 0, "nethash": "38f153a81332dea86751451fd992df26a9249f0834f72f58f84ac31cceb70f43", "reward": 0, "supply": 9800000000000000 }, "consensusSchedule": { "activationHeights": { "fairSystem": 809, "spaceship": 100000000 } }, "milestoneSchedule": { "offset": 2000000, "distance": 6300000, "milestones": [ 50000000, 45000000, 40000000, 35000000, 30000000, 25000000, 20000000, 15000000, 10000000 ] }, "version": { "build": "", "commit": "c32e740a83ef3ac6fdf7e579f7175b21be5c95e5", "version": "0.8.4" }, "wsClient": { "enabled": true, "port": 36668 } }