1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

update docs

This commit is contained in:
Matthias Kretschmann 2020-07-20 22:36:53 +02:00
parent a84af2e674
commit 43e2f7b6bd
Signed by: m
GPG Key ID: 606EEEF3C479A91F
4 changed files with 22 additions and 79 deletions

View File

@ -2,17 +2,16 @@
<h1 align="center">Ocean Marketplace</h1>
[![Build Status](https://travis-ci.com/oceanprotocol/market.svg?branch=master)](https://travis-ci.com/oceanprotocol/market)
[![Now deployment](https://flat.badgen.net/badge/now/auto-deployment/21c4dd?icon=now)](https://zeit.co/oceanprotocol/market)
[![Build Status](https://travis-ci.com/oceanprotocol/market.svg?token=3psqw6c8KMDqfdGQ2x6d&branch=master)](https://travis-ci.com/oceanprotocol/market)
[![Vercel deployment](https://flat.badgen.net/badge/vercel/auto-deployment/21c4dd?icon=now)](https://vercel.com/oceanprotocol/market)
[![Maintainability](https://api.codeclimate.com/v1/badges/d114f94f75e6efd2ee71/maintainability)](https://codeclimate.com/repos/5e3933869a31771fd800011c/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/d114f94f75e6efd2ee71/test_coverage)](https://codeclimate.com/repos/5e3933869a31771fd800011c/test_coverage)
[![js oceanprotocol](https://img.shields.io/badge/js-oceanprotocol-7b1173.svg)](https://github.com/oceanprotocol/eslint-config-oceanprotocol)
**Table of Contents**
- [🤓 Resources](#-resources)
- [🏄 Get Started](#-get-started)
- [Local Spree components with Barge](#local-spree-components-with-barge)
- [Local components with Barge](#local-components-with-barge)
- [🦑 Environment variables](#-environment-variables)
- [🎨 Storybook](#-storybook)
- [✨ Code Style](#-code-style)
@ -23,11 +22,9 @@
- [🏗 Ocean Protocol Infrastructure](#-ocean-protocol-infrastructure)
- [🏛 License](#-license)
## 🤓 Resources
## 🏄 Get Started
The app is a React app built with [Gatsby.js](https://www.gatsbyjs.org) + TypeScript + CSS modules and will connect to Ocean components in Pacific by default.
The app is a React app built with [Gatsby.js](https://www.gatsbyjs.org) + TypeScript + CSS modules and will connect to Ocean components in Rinkeby by default.
To start local development:
@ -45,30 +42,25 @@ This will start the development server under
To explore the generated GraphQL data structure fire up the accompanying GraphiQL IDE under
`http://localhost:8000/__graphql`.
### Local Spree components with Barge
### Local components with Barge
If you prefer to connect to locally running components instead of remote connections to Ocean's network, you can spin up [`barge`](https://github.com/oceanprotocol/barge) and use a local Spree network in another terminal before running `npm start`:
If you prefer to connect to locally running components instead of remote connections, you can spin up [`barge`](https://github.com/oceanprotocol/barge) and use a local Ganache network in another terminal before running `npm start`:
```bash
git clone git@github.com:oceanprotocol/barge.git
cd barge
# startup with local Spree node
./start_ocean.sh --no-commons
# use v3 branch for the time being
git checkout v3
# startup with local Ganache node
./start_ocean.sh
```
This will take some time on first start, and at the end you need to copy the generated contract artifacts out of the Docker container. To do so, use this script from the root of the app folder:
Finally, set environment variables to use this local connection in `.env` in the app:
```bash
./scripts/keeper.sh
```
The script will wait for all contracts to be generated in the `keeper-contracts` Docker container, then will copy the artifacts in place into `node_modules/@oceanprotocol/keeper-contracts/artifacts/`.
Finally, set environment variables to use those local connections in `.env` in the app:
```bash
# modify env variables, Spree is enabled by default when using those files
# modify env variables, Rinkeby is enabled by default when using those files
cp .env.example .env
```
@ -79,7 +71,7 @@ The `app.config.js` file is setup to prioritize environment variables for settin
For local development, you can use a `.env` file:
```bash
# modify env variables, Spree is enabled by default when using those files
# modify env variables, Rinkeby is enabled by default when using those files
cp .env.example .env
```
@ -114,7 +106,6 @@ npm run format
Test suite for unit tests is setup with [Jest](https://jestjs.io) as a test runner and:
- [react-testing-library](https://github.com/kentcdodds/react-testing-library) for all React components
- [node-mocks-http](https://github.com/howardabrams/node-mocks-http) for all `api/` routes
To run all linting and unit tests:
@ -148,11 +139,11 @@ npm run serve
Every branch or Pull Request is automatically deployed by [Vercel](https://vercel.com) with their GitHub integration. A link to a deployment will appear under each Pull Request.
The latest deployment of the `master` branch is automatically aliased to `xxx`.
The latest deployment of the `master` branch is automatically aliased to `market-six.now.sh`.
### Manual Deployment
If needed, app can be deployed manually. Make sure to switch to Ocean Protocol org before deploying:
If needed, app can be deployed manually to Vercel. Make sure to switch to Ocean Protocol org before deploying:
```bash
# first run
@ -171,25 +162,26 @@ The following Metadata Store & Provider instances specifically for marketplace a
**Rinkeby (Staging)**
- K8 namespace: `xxx`
- `[aquarius.rinkeby.v3.dev-ocean.com](https://aquarius.rinkeby.v3.dev-ocean.com)`
- `[provider.rinkeby.v3.dev-ocean.com](https://provider.rinkeby.v3.dev-ocean.com)`
Edit command with `kubectl`, e.g.:
```bash
kubectl edit deployment -n market-nile aquarius
kubectl edit deployment -n xxx aquarius
```
**Main (Production)**
- K8 namespace: `market-pacific`
- `aquarius.pacific.market.dev-ocean.com`
- `brizo.pacific.market.dev-ocean.com`
- K8 namespace: `xxx`
- `xxx`
- `xxx`
Edit command with `kubectl`, e.g.:
```bash
kubectl edit deployment -n market-pacific aquarius
kubectl edit deployment -n xxx aquarius
```
## 🏛 License

17
package-lock.json generated
View File

@ -25021,23 +25021,6 @@
}
}
},
"node-mocks-http": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/node-mocks-http/-/node-mocks-http-1.8.1.tgz",
"integrity": "sha512-qtd9YwXzCTdLfqjP7XSOtFei3TggwnjFIppmYEneQBaDIuknwgJTpItLskC5/pWOpU3lsK5aqdo+5CfIKHkXLg==",
"dev": true,
"requires": {
"accepts": "^1.3.7",
"depd": "^1.1.0",
"fresh": "^0.5.2",
"merge-descriptors": "^1.0.1",
"methods": "^1.1.2",
"mime": "^1.3.4",
"parseurl": "^1.3.3",
"range-parser": "^1.2.0",
"type-is": "^1.6.18"
}
},
"node-modules-regexp": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz",

View File

@ -100,7 +100,6 @@
"eslint-plugin-react": "^7.20.3",
"identity-obj-proxy": "^3.0.0",
"jest": "^26.1.0",
"node-mocks-http": "^1.8.1",
"prettier": "^2.0.5",
"serve": "^11.3.2",
"source-map-explorer": "^2.4.2",

View File

@ -1,31 +0,0 @@
#!/bin/bash
# Wait for contracts migration and extract Keeper artifacts
RETRY_COUNT=0
COMMAND_STATUS=1
printf '\n\e[33m◯ Waiting for contracts to be generated...\e[0m\n'
mkdir -p artifacts
until [ $COMMAND_STATUS -eq 0 ] || [ $RETRY_COUNT -eq 120 ]; do
keeper_contracts_docker_id=$(docker container ls | grep keeper-contracts | awk '{print $1}')
docker cp ${keeper_contracts_docker_id}:/keeper-contracts/artifacts/ready ./artifacts/ > /dev/null 2>&1
COMMAND_STATUS=$?
sleep 5
(( RETRY_COUNT=RETRY_COUNT+1 ))
done
printf '\e[32m✔ Found new contract artifacts.\e[0m\n'
rm -rf ./artifacts/
if [ $COMMAND_STATUS -ne 0 ]; then
echo "Waited for more than two minutes, but keeper contracts have not been migrated yet. Did you run an Ethereum RPC client and the migration script?"
exit 1
fi
docker cp "${keeper_contracts_docker_id}":/keeper-contracts/artifacts/. ./node_modules/@oceanprotocol/keeper-contracts/artifacts/
printf '\e[32m✔ Copied new contract artifacts.\e[0m\n'