In this exercise, you will build a Golang service that gathers all delegations made on the Tezos protocol and exposes them through a public API.
The solution is composed of two parts:
The endpoint must be available at: GET /xtz/delegations
The API must read data from the store.
The response format must be:
{
"data": [
{
"timestamp": "2022-05-05T06:29:14Z",
"amount": "125896",
"delegator": "tz1a1SAaXRt9yoGMx29rh9FsBF4UzmvojdTL",
"level": "2338084"
},
{
"timestamp": "2021-05-07T14:48:07Z",
"amount": "9856354",
"delegator": "KT1JejNYjmQYh8yw95u5kfQDRuxJcaUPjUnf",
"level": "1461334"
}
],
}
The sender’s address is the delegator.
The delegations must be listed most recent first.
The endpoint takes one optional query parameter year
, which is specified in the format YYYY and will result in the data being filtered for that year only.
The result must be paginated 50 at a time.
Please share a archive ( zip
, tar
or equivalent) of your git project via email.