diff --git a/README.md b/README.md index 810b7ad..9f52996 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ If you're a developer and want to contribute to, or want to utilize this marketp - [⛵️ Environment Variables](#️-environment-variables) - [Client](#client) - [Server](#server) - - [Network & Endpoint Switches](#network-amp-endpoint-switches) + - [Network & Endpoint Switches](#network--endpoint-switches) - [Feature Switches](#feature-switches) - [More Settings](#more-settings) - [👩‍🔬 Testing](#-testing) @@ -83,7 +83,12 @@ cd barge ./start_ocean.sh --no-commons ``` -Then set [environment variables](#️-environment-variables) to use those local connections. +Then set the [`REACT_APP_OCEAN_NETWORK` environment variable](#️-environment-variables) to `spree` to use those local connections: + +```bash +# in client/.env +REACT_APP_OCEAN_NETWORK=spree +``` Finally, you need to copy the generated contract artifacts out of the Docker container. To do this, execute this script in another terminal: @@ -116,13 +121,13 @@ The `./client/src/config.ts` file is setup to prioritize environment variables f By setting environment variables, you can easily switch between Ocean networks the commons client connects to, without directly modifying `./client/src/config.ts`. This is helpful e.g. for local development so you don't accidentially commit changes to the config file. -For local development, you can use a `.env.local` file. There's an example file with the most common network configurations preconfigured: +For local development, you can use a `.env` file. There's an example file with the most common network configurations preconfigured: ```bash -cp client/.env.local.example client/.env.local +cp client/.env.example client/.env # uncomment the config you need -vi client/.env.local +vi client/.env ``` #### Server @@ -153,6 +158,13 @@ For more control, you can overwrite individual endpoints in addition to the abov - `REACT_APP_SECRET_STORE_URI` - `REACT_APP_FAUCET_URI` +A common use case for that is to switch between different Aquarius instances to get a different asset catalogue. In that case, you would use `REACT_APP_OCEAN_NETWORK` to select the network, but then overwrite only `REACT_APP_AQUARIUS_URI`, e.g.: + +``` +REACT_APP_OCEAN_NETWORK=pacific +REACT_APP_AQUARIUS_URI=https://aquarius.test.oceanprotocol.com +``` + #### Feature Switches Beside configuring the network endpopints, the client allows to activate some features with environment variables in `client/.env.local`: diff --git a/client/.dockerignore b/client/.dockerignore index 38a2563..6f8316a 100644 --- a/client/.dockerignore +++ b/client/.dockerignore @@ -1,5 +1,4 @@ node_modules -.env.local .env build coverage diff --git a/client/.env.local.example b/client/.env.example similarity index 97% rename from client/.env.local.example rename to client/.env.example index 3bccfac..97e1e94 100644 --- a/client/.env.local.example +++ b/client/.env.example @@ -6,7 +6,7 @@ # # AUTO NETWORK CONNECTIONS # ------------------------ -# This env var is a shortcut for a set Ocean network component endpoints. +# This env var is a shortcut for a set of Ocean network component endpoints. # # Possible values: pacific, nile, duero, spree REACT_APP_OCEAN_NETWORK=pacific