Git Product home page Git Product logo

psyoptions-frontend's Introduction

Run the App locally

  1. Clone the repo

git clone https://github.com/mithraiclabs/psyoptions-frontend.git

  1. Copy .env-example and rename it .env.local.

OR run touch .env.local and add the following lines to it and fill in the blanks:

REACT_APP_LOCAL_PROGRAM_ID=R2y9ip6mxmWUj4pt54jP2hz2dgvMozy9VTSwMWE7evs
REACT_APP_DEVNET_PROGRAM_ID=R2y9ip6mxmWUj4pt54jP2hz2dgvMozy9VTSwMWE7evs
REACT_APP_LOCAL_DEX_PROGRAM_ID=9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin
REACT_APP_DEVNET_DEX_PROGRAM_ID=DESVgJVGajEgKGXhb6XmqDHGz3VjdgP7rEVESBgxmroY
REACT_APP_INITIALIZE_PAGE_ENABLED='true'

OPTIONS_REPO=
FRONTEND_REPO=
DEX_REPO=
KEY_FILE=
WALLET_ADDRESS=

To use mainnet locally add this

REACT_APP_MAINNET_PROGRAM_ID=R2y9ip6mxmWUj4pt54jP2hz2dgvMozy9VTSwMWE7evs
  1. Install dependencies

yarn

  1. Run the app!

yarn start

Protocol Development

Note this is presently unsupported. Fixes coming soon

We aim to make development setup as easy as possible. Follow the steps below:

  1. Run yarn wholeShebang
    • This will run a few scripts to build the programs, run a local Solana network (with Psy American and Serum DEX deployed to the right addresses at genesis) airdrop SOL to your wallet, create and airdrop SPL tokens to your wallet, deploy PsyOptions, deploy Serum, and create an example PsyOptions market with a Serum market attached.
  2. In a separate temrinal yarn dev
    • This will run the local UI server

Extracting market meta data

./node_modules/ts-node/dist/bin.js scripts/extractMetaDataFromMarkets.ts --rpc-url http://localhost:8899 --psyoption-program-id LOCAL_PROGRAM_ID --dex-program-id LOCAL_DEX_PROGRAM_ID --mint1-address MINT1_ADDRESS --mint2-address MINT2_ADDRESS

Deploying the app to dev and prod:

See Deploy Docs

Troubleshooting

If a build fails in google cloud, you can run yarn build-docker locally to simulate a cloud build and debug errors.

psyoptions-frontend's People

Contributors

evanpipta avatar taylor123 avatar tomjohn1028 avatar danmatuszak avatar jasonchitla avatar jasonhargrove avatar samaugust avatar t-wall 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.