Add v2 RESTful API routes for go-chaintracks compatibility #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
/v2/tip,/v2/header/height/:height,/v2/header/hash/:hash,/v2/headers)X-Block-HeightHTTP header (.binsuffix variants)ChaintracksService.startJsonRpcServer()to custom Express app mounting both v1 and v2 routesRoutes Added
V2 JSON Routes
GET /v2/network- Get blockchain network nameGET /v2/tip- Get chain tip headerGET /v2/header/height/:height- Get header by heightGET /v2/header/hash/:hash- Get header by hashGET /v2/headers?height=N&count=M- Get multiple headersV2 Binary Routes
GET /v2/tip.bin- Chain tip as 80-byte binaryGET /v2/header/height/:height.bin- Header by height as binaryGET /v2/header/hash/:hash.bin- Header by hash as binaryGET /v2/headers.bin?height=N&count=M- Multiple headers as binaryBinary routes return raw 80-byte block headers with
X-Block-HeightHTTP header for height metadata. Hash fields (previousHash, merkleRoot) are correctly converted from display format (byte-reversed) to internal byte order for binary serialization.