Giter Site home page Giter Site logo

cosmscan-rs's Issues

Use `sqlx` instead of `diesel-rs`

After few days using diesel in our data store.

I feels that I cannot fully control what will happens to our database.

I decided to migrate from diesel-rs to sqlx

Serve REST API

  • /block/{hash}
  • /blocks?start=2&limit=50&sort=desc
  • /blocks?top=50
  • /txes_in_block/{hash}
  • /tx/{hash}

First Milestone API Server Implementation

Endpoints to be implemented.

  • GET /api/chains

  • GET /api/block/by_height/{height}
  • GET /api/block/latest_height
  • GET /api/block/list?skip=0&limit=50

  • GET /api/transaction/{hash}
    • the response includes messages and events
  • GET /api/transaction/list/by_height/{height}

e2e test environment

Provide a simpler way to test the services (engine and api-server) like below.

$ cd e2e
$ docker-compose up

Then it starts all the component we need to test.

Configure CORS policy to be accessed from the different host

Background

API server is inherently designed as standalone server
It wouldn't contains any frontend sources

So, if frontend website is needed to access to our server
We must allow different host to access to the api server

Details

  • Add allowed_host to the config.toml
    • "*" means any website, if specific host is needed, then wite hostname like http://localhost:3000/
  • Write response with header Access-Control-Allow-Origin for each api handlers.

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.