Code Monkey home page Code Monkey logo

d8x-trader-backend's Introduction

d8x-trader-backend

The entire backend for the D8X Perpetuals trading frontend package consists of

The services can be setup with our command line interface tool

There must be one backend per chain-id.

History

Logs events such as trades and liquidity provision to the database. See more

API

Provides the main websocket and REST API for the trading interface (frontend). See more

Frontend Configuration

The Frontend package is tightly linked to these services, and the way it connects with them is configured entirely via environment variables in that project. Once you know on which URLs these API and Websocket services are hosted, they can be connected to the FE by specifying the following environment variables:

  • REACT_APP_API_URL: A semicolon separated list of endpoints served by the main REST API service.
    • For example, you could be hosting two main API services, one at https://api.mybackend.com for Polygon zkEVM (chain ID 1101) and one at https://api.test.mybackend.com for Polygon zkEVM Testnet (chain ID 1442).
    • You must also define a default chain for your frontend, in this example it's Mainnet
    • This entry should then take the form: REACT_APP_API_URL=1101::https://api.mybackend.com;1442::https://api.test.mybackend.com;default::https://api.mybackend.com
  • REACT_APP_HISTORY_URL: A semicolon separated list of endpoints served by the History API service.
    • In line with the example above, you may be hosting the frontend on two different networks, Polyon zkEVM and Polygon zkEVM Testnet as before, using URLS https://history.mybackend.com and https://history.test.mybackend.com, respectively
    • Then you would define REACT_APP_HISTORY_URL=137::https://history.mybackend.com;1442::https://history.test.mybackend.com;default::https://history.mybackend.com
  • REACT_APP_WEBSOCKET_URL: A semicolon separated list of endpoints served by the price Websocket service.
    • For example, you may be hosting wss://ws.mybackend.com for Polygon zkEVM and wss://ws.test.mybackend.com for Polygon zkEVM Testnet.
    • Then you would set this variable as REACT_APP_WEBSOCKET_URL=137::wss://ws.mybackend.com/;1442::wss://ws.test.mybackend.com/;default::wss://ws.mybackend.com/
  • REACT_APP_CANDLES_WEBSOCKET_URL: The URL of the candles service, hosted on a different server.
    • This service can be shared by different chains, but it adheres to the same notation as the previous two. If you are hosting this service at wss://candles.mybackend.com, then you would set this variable as REACT_APP_CANDLES_WEBSOCKET_URL=default::wss://candles.mybackend.com/

DEV

npx lerna exec npm run build

d8x-trader-backend's People

Contributors

b1674927 avatar m66260 avatar mantelijo avatar zografosg avatar c40003141 avatar web-flow avatar

Stargazers

知命 avatar

Watchers

Deepoo avatar Fedor Chmilev avatar

d8x-trader-backend's Issues

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.