From 0757ab3d10cfceea58c98931a69cd03d4a51b192 Mon Sep 17 00:00:00 2001 From: Lavysh Alexander Date: Fri, 27 Oct 2023 23:25:00 +0300 Subject: [PATCH 1/2] remove requiered tag from block height --- cmd/api/handler/block.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/api/handler/block.go b/cmd/api/handler/block.go index 24adfb95..ee1ce808 100644 --- a/cmd/api/handler/block.go +++ b/cmd/api/handler/block.go @@ -40,11 +40,11 @@ func NewBlockHandler( } type getBlockByHeightRequest struct { - Height types.Level `param:"height" validate:"required,min=0"` + Height types.Level `param:"height" validate:"min=0"` } type getBlockRequest struct { - Height types.Level `param:"height" validate:"required,min=0"` + Height types.Level `param:"height" validate:"min=0"` Stats bool `query:"stats" validate:"omitempty"` } From 713c05dba0fd99959e52332c0c6ddd5863eadcba Mon Sep 17 00:00:00 2001 From: Lavysh Alexander Date: Fri, 27 Oct 2023 23:30:09 +0300 Subject: [PATCH 2/2] added block requests --- .run/requests/block.http | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .run/requests/block.http diff --git a/.run/requests/block.http b/.run/requests/block.http new file mode 100644 index 00000000..ce7ef006 --- /dev/null +++ b/.run/requests/block.http @@ -0,0 +1,24 @@ +### Get blocks list +http://{{host}}/v1/block + +### Get blocks count +http://{{host}}/v1/block/count + +### Get genesis block +http://{{host}}/v1/block/0 + +### Get block by height +http://{{host}}/v1/block/12 + +### Get block events +http://{{host}}/v1/block/20345/events + +### Get block stats +http://{{host}}/v1/block/20345/stats + +### Get block namespaces +http://{{host}}/v1/block/20345/namespace + +### Get block namespaces count +http://{{host}}/v1/block/20345/namespace/count +