<h3align="center">🦑🦑🦑<br/>This marketplace is deployed under <ahref="https://commons.oceanprotocol.com">commons.oceanprotocol.com</a> and can be used there. Feel free to <ahref="https://github.com/oceanprotocol/commons/issues">report any issues</a> you encounter.<br/>🦑🦑🦑</h3>
- **server**: Node.js app, utilizing [Express](https://expressjs.com). The server provides various microservices, like remote file checking. The endpoints are documented in [server Readme](server/).
Open [http://localhost:3000](http://localhost:3000) to view the client in the browser. The page will reload if you make edits to files in either `./client` or `./server`.
By default, the client will connect to Ocean components running within [Ocean's Pacific network](https://docs.oceanprotocol.com/concepts/pacific-network/) remotely.
By default, the client uses a burner wallet connected to the correct network automatically. If you choose to use MetaMask, you need to connect to the Pacific network with it too. To do this:
If you prefer to connect to locally running components instead of remote connections to Ocean's Nile network, you can spin up [`barge`](https://github.com/oceanprotocol/barge) and use a local Spree network:
If you are on macOS, you need to additionally tweak your `/etc/hosts` file so Brizo can connect to Aquarius. This is only required on macOS and is a [known limitation of Docker for Mac](https://docs.docker.com/docker-for-mac/networking/#known-limitations-use-cases-and-workarounds):
```bash
sudo vi /etc/hosts
# add this line, and save
127.0.0.1 aquarius
```
Then use this host for the local Aquarius url in the client config:
The `./client/src/config.ts` file is setup to prioritize environment variables for setting each Ocean component endpoint.
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:
| `REACT_APP_OCEAN_NETWORK` | This env var is a shortcut for a predefined set of Ocean network component endpoints. Possible values are `pacific`, `nile`, `duero`, `spree` |
This shortcut provides a unified place to switch a combination of Ocean component endpoints. This shortcut can also be triggered by using a `network` URL query parameter, e.g. `?network=nile`.
For more control, you can overwrite individual endpoints in addition to the above network selection:
| `REACT_APP_SHOW_CHANNELS` | Show the channels feature which shows assets based on a certain tag in a prominent view. This is deeactivated by default and only activated in live Commons deployments. |
| `REACT_APP_SHOW_REQUEST_TOKENS_BUTTON` | Shows a second button on the `/faucet` route to request Ocean Tokens in addition to Ether. Will only work in Ocean testnets. |
| `REACT_APP_ALLOW_PRICING` | Activate pricing feature. Will show a price input during publish flow, and output prices for each data asset. |
Test suite is setup with [Jest](https://jestjs.io) and [react-testing-library](https://github.com/kentcdodds/react-testing-library) for unit testing, and [Cypress](https://www.cypress.io) for integration testing.
The endpoints the integration tests run against are defined by your [Environment Variables](#️-Environment-Variables), and Cypress-specific variables in `cypress.json`.
This will work for daily development but it misses the full interactivity of the test runner. If you need that, you will need to run them in individual terminal sessions:
For the GitHub releases steps a GitHub personal access token, exported as `GITHUB_TOKEN` is required. [Setup](https://github.com/release-it/release-it#github-releases)