Giter VIP home page Giter VIP logo

blockchainproject's Introduction

BlockChainProject

Read the initial pages of the documentation till the first api i.e. /assets api : https://docs.coincap.io/ ignore most of the stuff ( it might seem very verbose at this stage) and just try to get a basic idea Now create an API key from the section which says “Request API Key- Click here to request your API key” the “HEADER” section above it also contains details on how to use this API key “set the header field Authorization=Bearer XXXX” :- you have to create a header named “Authorization” and set its value to “Bearer XXXX” where XXXX stands for the API key that you have generated above

Now the assignment is to create an API that does the following ( one single API and not multiple separate API’s)

Get the list of all the top 100 cryptocurrency coins in the world using the /assets api ( the first api mentioned in the documentation) Save all the 100 coins in database ( each document to have data of 1 coin) The schema should have the following 4 keys: { "symbol" // String and Unique "name": // String and Unique "marketCapUsd": // String ( not Number) "priceUsd": //String } Notice that changePercent24Hr key is not present in the schema or collection

Send back the list of all the coins sorted in order of their growth in last 24 hours i.e. sort all the 100 coins based on their changePercent24Hr and send the sorted array in response

The above has to be done in one single API and not multiple separate API’s. SO go step by step and build features into your API one by one.

NOTE: When you hit the api for the first time, it will create 100 documents corresponding to the 100 coins in your database. Now next time when you hit your API, it will fail as you have made the symbol and name unique in your schema. Same coins can't be saved again as they will have the same symbol and name. SO you could do one of these 3 things to help yourself in the development phase:

  • delete the data from DB every time after hitting your API
  • Don't maintain “unique:true” in your schema till you are done with your development and add unique:true only towards the completion of your assignment
  • for inserting the documents, use findOneAndUpdate with upsert=true..this will create a new document in case there is no entry or will update the old doc with new values when there is an entry already there

blockchainproject's People

Contributors

sourabh1392 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.