GithubHelp home page GithubHelp logo

od-app's Introduction

OD App

License: MIT Twitter: open_dollar

Frontend application for Open Dollar

Deployments

https://app.opendollar.com/ Production main branch

https://app.dev.opendollar.com/ Testnet dev branch

⚡️ Run the app locally

For security and resiliency we publish the app as a self-contained Docker image

  1. Install Docker
  2. Get the latest Release, eg. 1.7.0
  3. Run the start command, replacing <VERSION_NUMBER> with the release
docker run -p 3000:3000 ghcr.io/open-dollar/od-app:<VERSION_NUMBER>
# For example:
docker run -p 3000:3000 ghcr.io/open-dollar/od-app:1.7.0

The application will be available on http://localhost:3000

For network Arbitrum Sepolia, use a release candidate (eg. 1.2.0-rc.abc123) version from the container registry

Development

Setup

Install dependencies

yarn

Setup the environment by creating the file .env.development.local:

cp example.env .env.development.local

Start the app

yarn start

If you have issues, check you are using node v16

Configuring the environment

To have the app default to a different network when a wallet is not connected:

  1. Create a file and name it .env.development.local
  2. Change REACT_APP_NETWORK_ID to "420"
  3. Change REACT_APP_NETWORK_URL to e.g. "https://opt-goerli.g.alchemy.com/v2/{YOUR_INFURA_KEY}"
  4. Change REACT_APP_FALLBACK_SUBGRAPH_URL to actual values in the format https://${GRAPH_NODE_PLAYGROUND_BASE_URL}/subgraphs/name/NAME_OF_YOUR_SUBGRAPH The current value of the GRAPH_NODE_PLAYGROUND_BASE_URL in the Render-deployed subgraph can be found in the Render dashboard under the Environment section of the NGINX Render service. The subgraph name can be queried in the Render database service by following the README.md instructions in the od-subgraph repo.

Subgraph Redundancy

When a request fails to our hosted subgraph in The Graph, we will automatically retry the request to our Render-hosted subgraph in the querySubgraph SDK function. Make sure you've set REACT_APP_FALLBACK_SUBGRAPH_URL as a .env variable to ensure there's a fallback subgraph to query.

Testing

Cypress integration test

yarn test:e2e

Jest test

yarn test

Docker

Build the image locally

For Arbitrum-Sepolia:

docker build --build-arg REACT_APP_NETWORK_ID=421614 \
--build-arg REACT_APP_NETWORK_URL=https://arbitrum-sepolia.blockpi.network/v1/rpc/public \
--build-arg REACT_APP_WALLET_CONNECT_PROJECT_ID=fb1d2dba2f157d3d719134e58dda98a7 \
-t open-dollar/od-app .

For Arbitrum One:

docker build --build-arg REACT_APP_NETWORK_ID=42161 \
--build-arg REACT_APP_NETWORK_URL=https://arbitrum.blockpi.network/v1/rpc/public \
--build-arg REACT_APP_WALLET_CONNECT_PROJECT_ID=fb1d2dba2f157d3d719134e58dda98a7 \
-t open-dollar/od-app .

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.