diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 3c3629e..0000000 --- a/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/.eslintrc b/.eslintrc index 6087027..2419f4e 100644 --- a/.eslintrc +++ b/.eslintrc @@ -19,7 +19,8 @@ "@typescript-eslint/member-delimiter-style": [ "error", { "multiline": { "delimiter": "none" } } - ] + ], + "@typescript-eslint/no-explicit-any": "off" }, "env": { "es6": true, diff --git a/.travis.yml b/.travis.yml index a228dcd..d48f64f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,12 +13,12 @@ addons: env: global: # run E2E tests against these values - - REACT_APP_NODE_URI="https://nile.dev-ocean.com" - - REACT_APP_AQUARIUS_URI="https://aquarius.nile.dev-ocean.com" - - REACT_APP_BRIZO_URI="https://brizo.nile.dev-ocean.com" - - REACT_APP_SECRET_STORE_URI="https://secret-store.nile.dev-ocean.com" - - REACT_APP_FAUCET_URI="https://faucet.nile.dev-ocean.com" - - REACT_APP_BRIZO_ADDRESS="0x4aaab179035dc57b35e2ce066919048686f82972" + - REACT_APP_NODE_URI="https://pacific.oceanprotocol.com" + - REACT_APP_AQUARIUS_URI="https://aquarius.commons.oceanprotocol.com" + - REACT_APP_BRIZO_URI="https://brizo.commons.oceanprotocol.com" + - REACT_APP_SECRET_STORE_URI="https://secret-store.oceanprotocol.com" + - REACT_APP_FAUCET_URI="https://faucet.oceanprotocol.com" + - REACT_APP_BRIZO_ADDRESS="0x008c25ed3594e094db4592f4115d5fa74c4f41ea" before_install: - npm install -g npm @@ -29,7 +29,10 @@ before_install: script: # - ./scripts/install.sh # runs automatically with npm ci - - ./scripts/test.sh + # executing `npm test` scripts individually here, so first one failing will exit the build + - npm run lint || travis_terminate 1 + - ./scripts/test.sh || travis_terminate 1 + - npm run test:e2e || travis_terminate 1 - ./scripts/coverage.sh - ./scripts/build.sh diff --git a/README.md b/README.md index 036c14a..5662627 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ If you're a developer and want to contribute to, or want to utilize this marketplace's code in your projects, then keep on reading. - [πŸ„ Get Started](#-Get-Started) - - [πŸ– Remote Ocean: Nile](#-Remote-Ocean-Nile) + - [πŸ– Remote Ocean: Pacific](#-Remote-Ocean-Pacific) - [🐳 Use with Barge](#-Use-with-Barge) - [⛡️ Environment Variables](#️-Environment-Variables) - [πŸ‘©β€πŸ”¬ Testing](#-Testing) @@ -52,15 +52,17 @@ npm start 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`. -### πŸ– Remote Ocean: Nile +### πŸ– Remote Ocean: Pacific -To make use of all the functionality, you need to connect to the Ocean network. By default, the client will connect to Ocean components running within [Ocean's Nile test network](https://docs.oceanprotocol.com/concepts/testnets/#the-nile-testnet) remotely. +To make use of all the functionality, you need to connect to an Ocean network. -This means you need to connect with your MetaMask to the Nile network too. To do this: +By default, the client will connect to Ocean components running within [Ocean's Pacific network](https://docs.oceanprotocol.com/concepts/pacific-network/) remotely. + +With your MetaMask, connect to the Pacific network. To do this: 1. select Custom RPC in the network dropdown in MetaMask -2. under New Network, enter `https://nile.dev-ocean.com` as the custom RPC URL -3. Hit _Save_, and you’re now connected to Nile +2. under New Network, enter `https://pacific.oceanprotocol.com` as the custom RPC URL +3. Hit _Save_, and you’re now connected to Pacific ### 🐳 Use with Barge @@ -100,6 +102,8 @@ To run all linting, unit and integration tests in one go, run: npm test ``` +The endpoints the integration tests run against are defined by your [Environment Variables](#️-Environment-Variables), and Cypress-specific variables in `cypress.json`. + ### Unit Tests For local development, you can start the test runners for client & server in a watch mode. @@ -128,8 +132,6 @@ npm run test:e2e This will automatically spin up all required resources to run the integrations tests, and then run them. -The endpoints Cypress runs against are defined by your [Environment Variables](#️-Environment-Variables), and Cypress-specific variables in `cypress.json`. - You can also use the UI of Cypress to run and inspect the integration tests locally: ```bash diff --git a/client/.env.local.example b/client/.env.local.example index aac819a..e435616 100644 --- a/client/.env.local.example +++ b/client/.env.local.example @@ -1,27 +1,27 @@ # # When none of the following variables are set, -# Commons will default connecting to Nile +# Commons will default connecting to Pacific # # # Connect to Pacific # -# REACT_APP_NODE_URI="https://pacific.oceanprotocol.com" -# REACT_APP_AQUARIUS_URI="https://aquarius.pacific.dev-ocean.com" -# REACT_APP_BRIZO_URI="https://brizo.pacific.dev-ocean.com" -# REACT_APP_SECRET_STORE_URI="https://secret-store.pacific.oceanprotocol.com" -# REACT_APP_FAUCET_URI="https://faucet.pacific.dev-ocean.com" -# REACT_APP_BRIZO_ADDRESS="0x008c25ed3594e094db4592f4115d5fa74c4f41ea" +REACT_APP_NODE_URI="https://pacific.oceanprotocol.com" +REACT_APP_AQUARIUS_URI="https://aquarius.commons.oceanprotocol.com" +REACT_APP_BRIZO_URI="https://brizo.commons.oceanprotocol.com" +REACT_APP_SECRET_STORE_URI="https://secret-store.oceanprotocol.com" +REACT_APP_FAUCET_URI="https://faucet.oceanprotocol.com" +REACT_APP_BRIZO_ADDRESS="0x008c25ed3594e094db4592f4115d5fa74c4f41ea" # # Connect to Nile # -REACT_APP_NODE_URI="https://nile.dev-ocean.com" -REACT_APP_AQUARIUS_URI="https://nginx-aquarius.dev-ocean.com" -REACT_APP_BRIZO_URI="https://nginx-brizo.dev-ocean.com" -REACT_APP_SECRET_STORE_URI="https://secret-store.dev-ocean.com" -REACT_APP_FAUCET_URI="https://faucet.nile.dev-ocean.com" -REACT_APP_BRIZO_ADDRESS="0x4aaab179035dc57b35e2ce066919048686f82972" +# REACT_APP_NODE_URI="https://nile.dev-ocean.com" +# REACT_APP_AQUARIUS_URI="https://aquarius.nile.dev-ocean.com" +# REACT_APP_BRIZO_URI="https://brizo.nile.dev-ocean.com" +# REACT_APP_SECRET_STORE_URI="https://secret-store.nile.dev-ocean.com" +# REACT_APP_FAUCET_URI="https://faucet.nile.dev-ocean.com" +# REACT_APP_BRIZO_ADDRESS="0x4aaab179035dc57b35e2ce066919048686f82972" # # Connect to Duero @@ -47,7 +47,7 @@ REACT_APP_BRIZO_ADDRESS="0x4aaab179035dc57b35e2ce066919048686f82972" # Connect to Spree (local with Barge) # # REACT_APP_NODE_URI="http://localhost:8545" -# REACT_APP_AQUARIUS_URI="http://aquarius:5000" +# REACT_APP_AQUARIUS_URI="http://localhost:5000" # REACT_APP_BRIZO_URI="http://localhost:8030" # REACT_APP_SECRET_STORE_URI="http://localhost:12001" # REACT_APP_FAUCET_URI="http://localhost:3001" diff --git a/client/src/config.ts b/client/src/config.ts index 8be81ec..46f0479 100644 --- a/client/src/config.ts +++ b/client/src/config.ts @@ -8,19 +8,20 @@ export const serviceUri = // OCEAN REMOTE CONNECTIONS // export const nodeUri = - process.env.REACT_APP_NODE_URI || 'https://nile.dev-ocean.com' + process.env.REACT_APP_NODE_URI || 'https://pacific.oceanprotocol.com' export const aquariusUri = - process.env.REACT_APP_AQUARIUS_URI || 'https://aquarius.nile.dev-ocean.com' + process.env.REACT_APP_AQUARIUS_URI || + 'https://aquarius.commons.oceanprotocol.com' export const brizoUri = - process.env.REACT_APP_BRIZO_URI || 'https://brizo.nile.dev-ocean.com' + process.env.REACT_APP_BRIZO_URI || 'https://brizo.commons.oceanprotocol.com' export const brizoAddress = process.env.REACT_APP_BRIZO_ADDRESS || - '0x4aaab179035dc57b35e2ce066919048686f82972' + '0x008c25ed3594e094db4592f4115d5fa74c4f41ea' export const secretStoreUri = process.env.REACT_APP_SECRET_STORE_URI || - 'https://secret-store.nile.dev-ocean.com' + 'https://secret-store.oceanprotocol.com' export const faucetUri = - process.env.REACT_APP_FAUCET_URI || 'https://faucet.nile.dev-ocean.com' + process.env.REACT_APP_FAUCET_URI || 'https://faucet.oceanprotocol.com' // // APP CONFIG diff --git a/client/src/routes/About.tsx b/client/src/routes/About.tsx index eb723ab..c6ae988 100644 --- a/client/src/routes/About.tsx +++ b/client/src/routes/About.tsx @@ -8,7 +8,7 @@ class About extends Component { return (

diff --git a/client/src/routes/Publish/Files/index.test.tsx b/client/src/routes/Publish/Files/index.test.tsx index c48ff49..defeebc 100644 --- a/client/src/routes/Publish/Files/index.test.tsx +++ b/client/src/routes/Publish/Files/index.test.tsx @@ -1,7 +1,6 @@ import React from 'react' import { render, fireEvent, waitForElement } from '@testing-library/react' import mockAxios from 'jest-mock-axios' -import { serviceUri } from '../../../config' import Files from '.' const onChange = jest.fn() diff --git a/cypress.json b/cypress.json index c8c92fa..52b427a 100644 --- a/cypress.json +++ b/cypress.json @@ -1,8 +1,8 @@ { "baseUrl": "http://localhost:3000", "env": { - "NODE_URI": "https://nile.dev-ocean.com", + "NODE_URI": "https://pacific.oceanprotocol.com", "SEEDPHRASE": "taxi music thumb unique chat sand crew more leg another off lamp", - "CONSUME_ASSET": "did:op:73f50d7449ca478aabd2f34116dbdb1acf4304a407aa4251ab75ce15257b63bd" + "CONSUME_ASSET": "did:op:8f0086cf21e84389ad69b3272c56bd0ddc12cd7d98db4e02b4075c481fc2d32d" } } diff --git a/package.json b/package.json index 7aedac4..c96d56d 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "start": "concurrently \"cd client && npm start\" \"cd server && npm start\"", "start:commons-and-ganache": "concurrently 'npm run start:ganache' 'npm run start'", "build": "./scripts/build.sh", - "test": "npm run lint && scripts/test.sh", + "test": "npm run lint && scripts/test.sh && npm run test:e2e", "test:e2e": "start-test start:commons-and-ganache http-get://localhost:3000 cypress:run", "test:watch": "npm run lint && concurrently \"cd client && npm run test:watch\" \"cd server && npm run test:watch\"", "start:ganache": "ganache-cli -m 'stamp polar cup smart ill agree human episode reform trigger text forget' -i 5777", diff --git a/scripts/test.sh b/scripts/test.sh index 78c67e3..244698b 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -1,4 +1,4 @@ -#/usr/bin/env/sh +#!/bin/bash set -e components="server client" @@ -10,7 +10,3 @@ do npm test cd .. done - -echo "Running End-to-End tests" - -npm run test:e2e diff --git a/server/src/server.ts b/server/src/server.ts index 5b0c975..7062d4b 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -64,7 +64,7 @@ app.get('/', (req, res) => { app.use('/api/v1/urlcheck', UrlCheckRouter) /// catch 404 -app.use((req, res, next) => { +app.use((req, res) => { res.status(404).send() })