Code Monkey home page Code Monkey logo

tzkt-delegations-api's Introduction

TZKT DELEGATIONS API

Original assignement :

Build a service that :

  • gathers new delegations made on the Tezos protocol,
  • exposes them through a public API.

The original assignement document can be viewed here.

Usage :

Using Docker-compose :

Using Docker-compose, you can execute the following commands :

docker-compose up -d

Using Go locally :

  • Using a local install of Go, you can execute the following commands :
cp .env.dist .env
  • Set up your Environement Variables, then :
cd app/indexer
go build . -o indexer
./indexer
cd app/api
go build . -o api
./api

Checklist :

  • The service will poll the new delegations from this Tzkt API endpoint: https://api.tzkt.io/#operation/Operations_GetDelegations
  • For each delegation, save the following information: sender's address, timestamp, amount, and block.
  • Expose the collected data through a public API at the endpoint /xtz/delegations.
    • The expected response format is:

      {
      "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"
          }
      ],
      }
    • 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.

  • Ensure the service is production-ready, considering factors like performance, scalability, error handling, and reliability.

tzkt-delegations-api's People

Contributors

charafzellou avatar dependabot[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.