To install dependencies:
yarn install
Make sure you have node.js >= v12 and yarn 2 installed.
To start a development server at http://localhost:3000
:
yarn dev
To build a production release:
yarn build
To start a production server with the release built:
yarn start
To export the production release built for static deployment:
yarn workspace @phala/app exec next export
And the output should be found in packages/app/out
.
Please follow the above instructions to build a production ready frontend. There are some additional environment variables to control the default API endpoints:
SUBSTRATE_API
: The Substrate websocket rpc endpoint (default:ws://localhost:9944
)PRUNTIME_API
: The pRuntime (TEE Encalve) http rpc endponint (default:http://localhost:8000
)APP_PHALA_URL
: This variable overrides the above two. It's equivalent to the following set up (default: "")SUBSTRATE_API="wss://${APP_PHALA_URL}/ws" PRUNTIME_API="https://${APP_PHALA_URL}/tee-api/"
For example, for Phala Network PoC-3, we build with:
APP_PHALA_URL=poc3.phala.network yarn build