Giter Club home page Giter Club logo

block_explorer's People

Contributors

dependabot[bot] avatar flannoo avatar kpudlik avatar marcinwadon avatar mwadon avatar tbekas avatar themmaciek avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

block_explorer's Issues

Add README

Add API doc and general project description

Implement snapshots endpoint

#DoD:

Endpoints:

  • /snapshot/latest - returns the highest indexed snapshot
  • /snapshot/{height} - returns snapshot by heght (long)
  • /snapshot/{hash} - return snapshot by hash
  • /snapshot/{height}/transaction - returns all transactions from the given snapshot
  • /snapshot/{hash}/transaction - returns all transactions from the given snapshot
  • /snapshot/latest/transaction - returns all transactions from the latest snapshot

Wallet balances endpoint

Would it be possible to implement an endpoint where we can retrieve all wallet balances at a certain snapshot height?

With the new implementation of incremental snapshots, there is no easy way anymore to query this information from the node API, so it would be nice to have that query available in the block explorer.

The result of the API endpoint could looks something like this:
{ "ordinal": 0, "balances": { "DAGXXXX": 1000000000000, "DAGYYYY": 2000000000000, "DAGZZZZ": 3000000000000 } }

Thx!

Implement transactions endpoint

DoD:

Endpoints:

  • /transaction/{hash} - return transaction by hash
  • /address/{dag_address}/transaction - all sent and received (sorted by timestamp DESC)
  • /address/{dag_address}/transaction/sent - only sent (sorted by ordinal DESC)
  • /address/{dag_address}/transaction/received - only received (sorted by timestamp DESC)

Implement balance endpoints

DoD

Endpoints:

  • /address/{dag_address}/balance - returns balance for given address, from latest snapshot
  • /balance/total - returns sum of all balances

Both endpoints should support ?height=# query parameter to return balances by the snapshot height. Default: latest

Return 404 NotFound when get document by hash fails

Ideally, we should map elasticsearch errors to our custom ones.
i.e. below we can see that elasticsearch returned 404 status code. It would be great not to return exact reason to end user.

image.png

Consider such a mapping:

Elasticsearch -> Our own

404 Not Found -> 404 Not Found
anything else -> 500 Internal Server Error

Pagination support

DoD:

Implement pagination in all endpoints returning large arrays:

  • all transactions' endpoints
  • snapshot transactions
  • address list endpoint

Consider offset & limit + X-Total-Count header.

Hide explicit errors on production environment

Currently errors on mainnet are visible to the end user. We would like to hide the explicit reason and return only the summary message.
I.e. for a given URL, the error returns the whole elasticsearch response with error message but it should return only a message, for example: "Transaction not found".

https://block-explorer.constellationnetwork.io/transaction/ee76a4b5315372aa2cdd8b98db453f28927bea630019795d0cee1ea58ccc637f

Additional things if possible:

  • log the error
  • hide errors based on the environment (env variables?) so on dev we will see the full log but on prod only the message

Implement address endpoints

DoD

Endpoints:

  • /address/count - returns count of all addresses
  • /address - returns all addresses sorted DESC by balance

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.