zack-bitcoin/amoveo

New api functionality

Closed this issue · 1 comments

Some api endpoints that I'm accessing internally right now. I think they might be useful to add to the api module interface

  • Get block by height
  • Get header by height, i.e. block:block_to_header(block:get_by_height(Height))

These both already exist.

header by height:
https://github.com/zack-bitcoin/amoveo/blob/master/apps/amoveo_http/src/ext_handler.erl#L76

example:

2> talker:talk({header, 0}, {{127,0,0,1}, 3010}).
talker:talk({header, 0}, {{127,0,0,1}, 3010}).
{ok,{header,0,
            <<18,225,195,60,163,69,34,203,46,35,56,255,228,146,229,22,
              150,51,55,136,49,143,47,203,...>>,
            <<34,19,237,43,45,86,158,227,44,237,205,172,193,135,198,
              149,18,66,89,233,171,59,243,...>>,
            <<43,69,42,179,57,216,105,162,206,131,247,102,183,100,79,
              233,84,47,38,233,197,238,...>>,
            0,10,2,
            <<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,...>>,
            0,5}}

block by height:
https://github.com/zack-bitcoin/amoveo/blob/master/apps/amoveo_http/src/ext_handler.erl#L69

example:

talker:talk({block, 0}, {{127,0,0,1}, 3010}).