Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/charafzellou/tzkt-delegations-api
A basic API that exposes Delegation Operations from TZKT.io using Go Fiber
https://github.com/charafzellou/tzkt-delegations-api
fiber-go golang tezos tzkt tzkt-api
Last synced: 12 days ago
JSON representation
A basic API that exposes Delegation Operations from TZKT.io using Go Fiber
- Host: GitHub
- URL: https://github.com/charafzellou/tzkt-delegations-api
- Owner: charafzellou
- Created: 2023-07-01T11:34:59.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-09T15:51:58.000Z (6 months ago)
- Last Synced: 2024-07-09T20:13:12.971Z (6 months ago)
- Topics: fiber-go, golang, tezos, tzkt, tzkt-api
- Language: Go
- Homepage:
- Size: 178 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TZKT DELEGATIONS API
## Original assignement :
Build a service that :
- gathers new [delegations](https://opentezos.com/baking/delegating/) made on the Tezos protocol,
- exposes them through a public API.The original assignement document can be viewed [here](./docs/ASSIGNEMENT.md).
## Usage :
### Using `Docker-compose` :
Using `Docker-compose`, you can execute the following commands :```bash
docker-compose up -d
```### Using Go locally :
- Using a local install of Go, you can execute the following commands :```bash
cp .env.dist .env
```- Set up your Environement Variables, then :
```bash
cd app/indexer
go build . -o indexer
./indexer
```
```bash
cd app/api
go build . -o api
./api
```## Checklist :
- [X] The service will poll the new delegations from this Tzkt API endpoint: https://api.tzkt.io/#operation/Operations_GetDelegations
- [X] For each delegation, save the following information: sender's address, timestamp, amount, and block.
- [X] Expose the collected data through a public API at the endpoint `/xtz/delegations`.
- [X] The expected response format is:
```json
{
"data": [
{
"timestamp": "2022-05-05T06:29:14Z",
"amount": "125896",
"delegator": "tz1a1SAaXRt9yoGMx29rh9FsBF4UzmvojdTL",
"block": "2338084"
},
{
"timestamp": "2021-05-07T14:48:07Z",
"amount": "9856354",
"delegator": "KT1JejNYjmQYh8yw95u5kfQDRuxJcaUPjUnf",
"block": "1461334"
}
],
}
```
- [X] The sender’s address is the delegator.
- [X] The delegations must be listed most recent first.
- [X] 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.
- [ ] Ensure the service is production-ready, considering factors like performance, scalability, error handling, and reliability.