mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
kick out squid-js, replace with lib
This commit is contained in:
parent
6d2ac9804a
commit
7b6cb91410
@ -174,9 +174,9 @@ vercel alias
|
||||
|
||||
## 🏗 Ocean Protocol Infrastructure
|
||||
|
||||
The following Aquarius & Brizo instances specifically for marketplace are deployed in Ocean Protocol's AWS K8:
|
||||
The following Metadata Store & Provider instances specifically for marketplace are deployed in Ocean Protocol's AWS K8:
|
||||
|
||||
**Nile (Staging)**
|
||||
**Rinkeby (Staging)**
|
||||
|
||||
- K8 namespace: `market-nile`
|
||||
- `aquarius.nile.market.dev-ocean.com`
|
||||
@ -188,7 +188,7 @@ Edit command with `kubectl`, e.g.:
|
||||
kubectl edit deployment -n market-nile aquarius
|
||||
```
|
||||
|
||||
**Pacific (Production)**
|
||||
**Main (Production)**
|
||||
|
||||
- K8 namespace: `market-pacific`
|
||||
- `aquarius.pacific.market.dev-ocean.com`
|
||||
|
22
package-lock.json
generated
22
package-lock.json
generated
@ -3971,6 +3971,23 @@
|
||||
"resolved": "https://registry.npmjs.org/@oceanprotocol/keeper-contracts/-/keeper-contracts-0.13.2.tgz",
|
||||
"integrity": "sha512-915dcnzCHEuvsmRKqVj0RxHT3T386lSJh8WREe4dsnrXHsi1ULNYxX0Ts/cvalv6bRL+aqyaZ6gN3l3nkfwEDg=="
|
||||
},
|
||||
"@oceanprotocol/lib": {
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-0.1.1.tgz",
|
||||
"integrity": "sha512-4lCF0jzBq735QzD7TSqyc7yMmcXL5eF0G1ZYx4bu4NS/vl2nzFVTa+QjqVbx31ZhHpFLgWr8d3QTsBGxTLXpmw==",
|
||||
"requires": {
|
||||
"@ethereum-navigator/navigator": "^0.5.0",
|
||||
"bignumber.js": "^9.0.0",
|
||||
"deprecated-decorator": "^0.1.6",
|
||||
"fs": "0.0.1-security",
|
||||
"node-fetch": "^2.6.0",
|
||||
"save-file": "^2.3.1",
|
||||
"uuid": "^8.2.0",
|
||||
"web3": "^1.2.9",
|
||||
"web3-eth-contract": "^1.2.9",
|
||||
"whatwg-url": "^8.0.0"
|
||||
}
|
||||
},
|
||||
"@oceanprotocol/react": {
|
||||
"version": "0.0.11",
|
||||
"resolved": "https://registry.npmjs.org/@oceanprotocol/react/-/react-0.0.11.tgz",
|
||||
@ -14920,6 +14937,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"fs": {
|
||||
"version": "0.0.1-security",
|
||||
"resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz",
|
||||
"integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ="
|
||||
},
|
||||
"fs-constants": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
|
||||
|
@ -22,8 +22,8 @@
|
||||
"@loadable/component": "^5.13.1",
|
||||
"@now/node": "^1.7.2",
|
||||
"@oceanprotocol/art": "^3.0.0",
|
||||
"@oceanprotocol/react": "0.0.11",
|
||||
"@oceanprotocol/squid": "^2.2.0",
|
||||
"@oceanprotocol/lib": "^0.1.1",
|
||||
"@oceanprotocol/react": "^0.0.11",
|
||||
"@oceanprotocol/typographies": "^0.1.0",
|
||||
"@sindresorhus/slugify": "^1.0.0",
|
||||
"@tippyjs/react": "^4.1.0",
|
||||
|
4
src/@types/MetaData.d.ts
vendored
4
src/@types/MetaData.d.ts
vendored
@ -1,5 +1,5 @@
|
||||
import { File, MetaData, AdditionalInformation } from '@oceanprotocol/squid'
|
||||
import { ServiceMetadata } from '@oceanprotocol/squid/dist/node/ddo/Service'
|
||||
import { File, MetaData, AdditionalInformation } from '@oceanprotocol/lib'
|
||||
import { ServiceMetadata } from '@oceanprotocol/lib/dist/node/ddo/Service'
|
||||
|
||||
export declare type AccessType = 'Download' | 'Compute'
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React, { ReactElement } from 'react'
|
||||
import { File as FileMetaData } from '@oceanprotocol/squid'
|
||||
import { File as FileMetaData } from '@oceanprotocol/lib'
|
||||
import filesize from 'filesize'
|
||||
import cleanupContentType from '../../utils/cleanupContentType'
|
||||
import styles from './File.module.css'
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from 'react'
|
||||
import ReactRating from 'react-rating'
|
||||
import Star from '../../images/star.svg'
|
||||
import { Curation } from '@oceanprotocol/squid'
|
||||
import { Curation } from '@oceanprotocol/lib'
|
||||
import styles from './Rating.module.css'
|
||||
|
||||
export default function Rating({
|
||||
|
@ -1,6 +1,6 @@
|
||||
import AssetTeaser from '../molecules/AssetTeaser'
|
||||
import * as React from 'react'
|
||||
import { DDO } from '@oceanprotocol/squid'
|
||||
import { DDO } from '@oceanprotocol/lib'
|
||||
import ddo from '../../../tests/unit/__fixtures__/ddo'
|
||||
|
||||
export default {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React, { useState, useEffect } from 'react'
|
||||
import { useNavigate } from '@reach/router'
|
||||
import { DDO } from '@oceanprotocol/squid'
|
||||
import { DDO } from '@oceanprotocol/lib'
|
||||
import { redeploy } from '../../utils'
|
||||
import Button from '../atoms/Button'
|
||||
import BaseDialog from '../atoms/BaseDialog'
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React, { ReactElement } from 'react'
|
||||
import { File } from '@oceanprotocol/squid'
|
||||
import { File } from '@oceanprotocol/lib'
|
||||
import { prettySize } from '../../../utils'
|
||||
import cleanupContentType from '../../../utils/cleanupContentType'
|
||||
import styles from './Info.module.css'
|
||||
|
@ -2,7 +2,7 @@ import React, { ReactElement } from 'react'
|
||||
import Compute from './Compute'
|
||||
import ddo from '../../../../tests/unit/__fixtures__/ddo'
|
||||
import web3Mock from '../../../../tests/unit/__mocks__/web3'
|
||||
import squidMock from '../../../../tests/unit/__mocks__/@oceanprotocol/squid'
|
||||
import squidMock from '../../../../tests/unit/__mocks__/@oceanprotocol/lib'
|
||||
import { context } from '../../../../tests/unit/__mocks__/web3provider'
|
||||
|
||||
export default {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React, { useState, useEffect, ReactElement } from 'react'
|
||||
import { Ocean } from '@oceanprotocol/squid'
|
||||
import { Ocean } from '@oceanprotocol/lib'
|
||||
import { fromWei } from 'web3-utils'
|
||||
import compareAsBN, { Comparisson } from '../../../utils/compareAsBN'
|
||||
import Loader from '../../atoms/Loader'
|
||||
|
@ -2,7 +2,7 @@ import React, { useState, useEffect, ReactElement } from 'react'
|
||||
import { toast } from 'react-toastify'
|
||||
import Rating from '../../atoms/Rating'
|
||||
import rateAsset from '../../../utils/rateAsset'
|
||||
import { DID } from '@oceanprotocol/squid'
|
||||
import { DID } from '@oceanprotocol/lib'
|
||||
import styles from './RatingAction.module.css'
|
||||
import getAssetRating from '../../../utils/getAssetRating'
|
||||
import Loader from '../../atoms/Loader'
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react'
|
||||
import { DDO } from '@oceanprotocol/squid'
|
||||
import { DDO } from '@oceanprotocol/lib'
|
||||
import AssetList from './AssetList'
|
||||
import asset from '../../../tests/unit/__fixtures__/ddo'
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
import AssetTeaser from '../molecules/AssetTeaser'
|
||||
import React from 'react'
|
||||
import { QueryResult } from '@oceanprotocol/squid/dist/node/aquarius/Aquarius'
|
||||
import { QueryResult } from '@oceanprotocol/lib/dist/node/metadatastore/MetadataStore'
|
||||
import shortid from 'shortid'
|
||||
import Pagination from '../molecules/Pagination'
|
||||
import { updateQueryStringParameter } from '../../utils'
|
||||
import styles from './AssetList.module.css'
|
||||
import { MetaDataMarket } from '../../@types/MetaData'
|
||||
import { DDO } from '@oceanprotocol/squid'
|
||||
import { DDO } from '@oceanprotocol/lib'
|
||||
|
||||
declare type AssetListProps = {
|
||||
queryResult: QueryResult
|
||||
|
@ -10,7 +10,7 @@ import Price from '../atoms/Price'
|
||||
import { fromWei } from 'web3-utils'
|
||||
import DateCell from '../atoms/Table/DateCell'
|
||||
import DdoLinkCell from '../atoms/Table/DdoLinkCell'
|
||||
import { MetaDataMain } from '@oceanprotocol/squid'
|
||||
import { MetaDataMain } from '@oceanprotocol/lib'
|
||||
|
||||
const consumedColumns = [
|
||||
{
|
||||
|
@ -11,7 +11,7 @@ import Price from '../atoms/Price'
|
||||
import { fromWei } from 'web3-utils'
|
||||
import Table from '../atoms/Table'
|
||||
import Button from '../atoms/Button'
|
||||
import { MetaDataMain, Logger } from '@oceanprotocol/squid'
|
||||
import { MetaDataMain, Logger } from '@oceanprotocol/lib'
|
||||
import DateCell from '../atoms/Table/DateCell'
|
||||
import DdoLinkCell from '../atoms/Table/DdoLinkCell'
|
||||
import shortid from 'shortid'
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React, { useEffect, useState, ReactElement } from 'react'
|
||||
import Loader from '../atoms/Loader'
|
||||
import { MetaDataMain } from '@oceanprotocol/squid'
|
||||
import { MetaDataMain } from '@oceanprotocol/lib'
|
||||
import {
|
||||
useOcean,
|
||||
OceanConnectionStatus,
|
||||
|
@ -7,7 +7,7 @@ import { useOcean } from '@oceanprotocol/react'
|
||||
import {
|
||||
Service,
|
||||
ServiceCompute
|
||||
} from '@oceanprotocol/squid/dist/node/ddo/Service'
|
||||
} from '@oceanprotocol/lib/dist/node/ddo/Service'
|
||||
import { Formik, Form as FormFormik, Field } from 'formik'
|
||||
import Input from '../../atoms/Input'
|
||||
import Button from '../../atoms/Button'
|
||||
@ -15,7 +15,7 @@ import { transformPublishFormToMetadata } from './utils'
|
||||
import { FormContent, FormFieldProps } from '../../../@types/Form'
|
||||
import { MetaDataPublishForm } from '../../../@types/MetaData'
|
||||
import AssetModel from '../../../models/Asset'
|
||||
import { File } from '@oceanprotocol/squid'
|
||||
import { File } from '@oceanprotocol/lib'
|
||||
|
||||
const validationSchema = Yup.object().shape<MetaDataPublishForm>({
|
||||
// ---- required fields ----
|
||||
@ -81,7 +81,7 @@ export default function PublishForm({
|
||||
// account,
|
||||
// metadata.main.price,
|
||||
// // Note: a hack without consequences.
|
||||
// // Will make metadata.main.datePublished (automatically created by Aquarius)
|
||||
// // Will make metadata.main.datePublished (automatically created by MetadataStore)
|
||||
// // go out of sync with this service.main.datePublished.
|
||||
// toStringNoMS(new Date(Date.now()))
|
||||
// )
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React, { ReactElement, useState, useEffect } from 'react'
|
||||
import { QueryResult } from '@oceanprotocol/squid/dist/node/aquarius/Aquarius'
|
||||
import { QueryResult } from '@oceanprotocol/lib/dist/node/metadatastore/MetadataStore'
|
||||
import SearchBar from '../../molecules/SearchBar'
|
||||
import AssetList from '../../organisms/AssetList'
|
||||
import { SearchPriceFilter } from '../../molecules/SearchPriceFilter'
|
||||
|
@ -1,9 +1,9 @@
|
||||
import {
|
||||
SearchQuery,
|
||||
QueryResult
|
||||
} from '@oceanprotocol/squid/dist/node/aquarius/Aquarius'
|
||||
} from '@oceanprotocol/lib/dist/node/metadatastore/MetadataStore'
|
||||
import { priceQueryParamToWei } from '../../../utils'
|
||||
import { Aquarius, Logger } from '@oceanprotocol/squid'
|
||||
import { MetadataStore, Logger } from '@oceanprotocol/lib'
|
||||
import { oceanConfig } from '../../../../app.config'
|
||||
|
||||
export function getSearchQuery(
|
||||
@ -52,8 +52,8 @@ export async function getResults(params: any): Promise<QueryResult> {
|
||||
])
|
||||
: undefined
|
||||
|
||||
const aquarius = new Aquarius(oceanConfig.aquariusUri, Logger)
|
||||
const queryResult = await aquarius.queryMetadata(
|
||||
const metadataStore = new MetadataStore(oceanConfig.metadataStoreUri, Logger)
|
||||
const queryResult = await metadataStore.queryMetadata(
|
||||
getSearchQuery(page, offset, text, tag, priceQuery)
|
||||
)
|
||||
|
||||
|
@ -4,7 +4,7 @@ import AssetContent from '../../components/organisms/AssetContent'
|
||||
import Layout from '../../components/Layout'
|
||||
import { PageProps } from 'gatsby'
|
||||
import { MetaDataMarket, ServiceMetaDataMarket } from '../../@types/MetaData'
|
||||
import { Aquarius, Logger } from '@oceanprotocol/squid'
|
||||
import { MetadataStore, Logger } from '@oceanprotocol/lib'
|
||||
import { oceanConfig } from '../../../app.config'
|
||||
import Alert from '../../components/atoms/Alert'
|
||||
|
||||
@ -18,12 +18,15 @@ export default function AssetRoute(props: PageProps): ReactElement {
|
||||
useEffect(() => {
|
||||
async function init() {
|
||||
try {
|
||||
const aquarius = new Aquarius(oceanConfig.aquariusUri, Logger)
|
||||
const ddo = await aquarius.retrieveDDO(did)
|
||||
const metadataStore = new MetadataStore(
|
||||
oceanConfig.metadataStoreUri,
|
||||
Logger
|
||||
)
|
||||
const ddo = await metadataStore.retrieveDDO(did)
|
||||
|
||||
if (!ddo) {
|
||||
setTitle('Could not retrieve asset')
|
||||
setError('The DDO was not found in Aquarius.')
|
||||
setError('The DDO was not found in MetadataStore.')
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import axios from 'axios'
|
||||
import { DID } from '@oceanprotocol/squid'
|
||||
import { DID } from '@oceanprotocol/lib'
|
||||
import { oceanConfig } from '../../app.config'
|
||||
|
||||
export declare type GetRatingResponse = {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import axios, { AxiosResponse } from 'axios'
|
||||
import { toast } from 'react-toastify'
|
||||
import { File } from '@oceanprotocol/squid'
|
||||
import { File } from '@oceanprotocol/lib'
|
||||
import numeral from 'numeral'
|
||||
import web3Utils from 'web3-utils'
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import axios, { AxiosResponse } from 'axios'
|
||||
import Web3 from 'web3'
|
||||
import { DID } from '@oceanprotocol/squid'
|
||||
import { DID } from '@oceanprotocol/lib'
|
||||
import { oceanConfig } from '../../app.config'
|
||||
|
||||
export declare type RatingResponse = [string, number]
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { DDO } from '@oceanprotocol/squid'
|
||||
import { DDO } from '@oceanprotocol/lib'
|
||||
import { MetaDataMarket } from '../../../src/@types/MetaData'
|
||||
|
||||
const ddo: Partial<DDO> = {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ComputeJob } from '@oceanprotocol/squid'
|
||||
import { ComputeJob } from '@oceanprotocol/lib'
|
||||
|
||||
// ComputeJob need to be updated in squid
|
||||
const job: Partial<ComputeJob> = {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import ddo from '../../__fixtures__/ddo'
|
||||
import job from '../../__fixtures__/job'
|
||||
|
||||
const aquarius = {
|
||||
const metadataStore = {
|
||||
queryMetadata: () => {
|
||||
return {
|
||||
results: [] as any[],
|
||||
@ -12,13 +12,13 @@ const aquarius = {
|
||||
}
|
||||
|
||||
const squidMock = {
|
||||
Aquarius: () => aquarius,
|
||||
MetadataStore: () => metadataStore,
|
||||
DDO: () => ddo,
|
||||
ocean: {
|
||||
accounts: {
|
||||
list: () => ['xxx', 'xxx']
|
||||
},
|
||||
aquarius,
|
||||
metadataStore,
|
||||
compute: {
|
||||
status: (account: string) => {
|
||||
return [job]
|
||||
@ -69,13 +69,13 @@ const squidMock = {
|
||||
name: 'Squid-js',
|
||||
status: 'Working'
|
||||
},
|
||||
aquarius: {
|
||||
name: 'Aquarius',
|
||||
metadataStore: {
|
||||
name: 'MetadataStore',
|
||||
status: 'Working'
|
||||
},
|
||||
brizo: {
|
||||
name: 'Brizo',
|
||||
network: 'Nile',
|
||||
provider: {
|
||||
name: 'Provider',
|
||||
network: 'Rinkeby',
|
||||
status: 'Working',
|
||||
contracts: {
|
||||
hello: 'hello',
|
@ -1,5 +1,5 @@
|
||||
import React, { ReactElement } from 'react'
|
||||
import squidMock from './squid'
|
||||
import libMock from './lib'
|
||||
import web3ProviderMock from '../web3provider'
|
||||
|
||||
const reactMock = {
|
||||
@ -19,7 +19,7 @@ const reactMock = {
|
||||
},
|
||||
useOcean: () => {
|
||||
return {
|
||||
ocean: squidMock.ocean
|
||||
ocean: libMock.ocean
|
||||
}
|
||||
},
|
||||
useWeb3: () => {
|
||||
|
Loading…
Reference in New Issue
Block a user