# PQ Devnet Node APIs ## Introduction This document lists endpoints that must be implemented for supporting the explorer(`leanView`). ## GET `/lean/v0/node/version` Returns the version of the node. ### Request ```bash curl 127.0.0.1:5052/lean/v0/node/version ``` ### Response ```json { "data": { "version": "ream/fd77c17-fd77c17/darwin-aarch64/rustc1.91.0-nightly" } } ``` ## GET `/lean/v0/blocks/{block_id}` Returns the block of the chain for corresponding `block_id`. `block_id` can be one of: "head" (canonical head in node's view), "genesis", "finalized", \<slot\>, \<hex encoded blockRoot with 0x prefix\>. Similar to `/eth/v2/beacon/blocks/{block_id}` ([Link](https://ethereum.github.io/beacon-APIs/#/Beacon/getBlockV2)). ### Request ```bash curl 127.0.0.1:5052/lean/v0/blocks/head ``` ### Response ```json { "slot": 12, "proposer_index": 0, "parent_root": "0xe7da5a31be6f5e741164ea1d7f3ff4982be2c94d03ab02d7f2a434850c1936aa", "state_root": "0xa503fa59f2e46f5a079079239a39f7f99178971a5015d3bf941de109df693f65", "body": { "votes": [ { "validator_id": 0, "slot": 11, "head": { "root": "0xe7da5a31be6f5e741164ea1d7f3ff4982be2c94d03ab02d7f2a434850c1936aa", "slot": 11 }, "target": { "root": "0xbf4a25347476f6c760789c98ae60b65634c307ab3ea371f8f69a5788d84233c9", "slot": 10 }, "source": { "root": "0x5e731d3fcd959c331d2605d87e7385c45697a0d88edeb5f0f453788f1348657a", "slot": 9 } }, { "validator_id": 1, "slot": 11, "head": { "root": "0xe7da5a31be6f5e741164ea1d7f3ff4982be2c94d03ab02d7f2a434850c1936aa", "slot": 11 }, "target": { "root": "0xbf4a25347476f6c760789c98ae60b65634c307ab3ea371f8f69a5788d84233c9", "slot": 10 }, "source": { "root": "0x5e731d3fcd959c331d2605d87e7385c45697a0d88edeb5f0f453788f1348657a", "slot": 9 } }, { "validator_id": 2, "slot": 11, "head": { "root": "0xe7da5a31be6f5e741164ea1d7f3ff4982be2c94d03ab02d7f2a434850c1936aa", "slot": 11 }, "target": { "root": "0xbf4a25347476f6c760789c98ae60b65634c307ab3ea371f8f69a5788d84233c9", "slot": 10 }, "source": { "root": "0x5e731d3fcd959c331d2605d87e7385c45697a0d88edeb5f0f453788f1348657a", "slot": 9 } }, { "validator_id": 3, "slot": 11, "head": { "root": "0xe7da5a31be6f5e741164ea1d7f3ff4982be2c94d03ab02d7f2a434850c1936aa", "slot": 11 }, "target": { "root": "0xbf4a25347476f6c760789c98ae60b65634c307ab3ea371f8f69a5788d84233c9", "slot": 10 }, "source": { "root": "0x5e731d3fcd959c331d2605d87e7385c45697a0d88edeb5f0f453788f1348657a", "slot": 9 } } ] } } ``` ## GET `/lean/v0/headers/{block_id}` Returns the header of the block for corresponding `block_id`. `block_id` can be one of: "head" (canonical head in node's view), "genesis", "finalized", \<slot\>, \<hex encoded blockRoot with 0x prefix\>. Similar to `/eth/v1/beacon/headers/{block_id}` ([Link](https://ethereum.github.io/beacon-APIs/#/Beacon/getBlockHeader)). ### Request ```bash curl 127.0.0.1:5052/lean/v0/blocks/head ``` ### Response ```json { "slot": 115, "proposer_index": 3, "parent_root": "0x4cad7858df462b958a70da92bcc81cabce5d26203685d4e79b6c8ce83ce0f509", "state_root": "0x578e4e292e0aa040e8d36c6c0efb3ebb45d4dda95f5fc6c1ff7f9fc3eddbc5fb", "body_root": "0xa8f2242114fb4676536f08a73801bafcc3a65665220c6905e69d4fc7b9bca554" } ```