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

fix publish with pool

This commit is contained in:
mihaisc 2022-01-11 12:55:06 +02:00
parent 2504eba886
commit 7cac17d906
6 changed files with 5 additions and 67 deletions

View File

@ -1,9 +0,0 @@
interface Credential {
type: string
values: string[]
}
interface Credentials {
allow: Credential[]
deny: Credential[]
}

View File

@ -10,19 +10,3 @@ interface MetadataAlgorithm {
version?: string
container: MetadataAlgorithmContainer
}
interface Metadata {
created: string
updated: string
name: string
description: string
type: 'dataset' | 'algorithm' | string
author: string
license: string
links?: string[]
tags?: string[]
copyrightHolder?: string
contentLanguage?: string
algorithm?: MetadataAlgorithm
additionalInformation?: any
}

View File

@ -1,30 +0,0 @@
interface PublisherTrustedAlgorithm {
did: string
filesChecksum: string
containerSectionChecksum: string
}
interface ServiceComputeOptions {
namespace: string
cpu?: number
gpu?: number
gpuType?: string
memory?: string
volumeSize?: string
allowRawAlgorithm: boolean
allowNetworkAccess: boolean
publisherTrustedAlgorithmPublishers: string[]
publisherTrustedAlgorithms: PublisherTrustedAlgorithm[]
}
interface Service {
id: string
type: 'access' | 'compute' | string
files: string
datatokenAddress: string
serviceEndpoint: string
timeout: number
name?: string
description?: string
compute?: ServiceComputeOptions
}

View File

@ -1,10 +0,0 @@
// DDO spec
interface DDO {
'@context': string[]
id: string
version: string
chainId: number
metadata: Metadata
services: Service[]
credentials?: Credentials
}

View File

@ -1,3 +1,4 @@
import { ServiceComputeOptions } from '@oceanprotocol/lib'
import { DataTokenOptions } from '@utils/datatokens'
import { NftOptions } from '@utils/nft'
import { ReactElement } from 'react'
@ -28,7 +29,7 @@ export interface FormPublishData {
}
metadata: {
nft: NftOptions
type: 'Dataset' | 'Algorithm' | string
type: 'dataset' | 'algorithm'
name: string
description: string
author: string

View File

@ -1,4 +1,4 @@
import { generateDid } from '@oceanprotocol/lib'
import { DDO, generateDid, Metadata, Service } from '@oceanprotocol/lib'
import { mapTimeoutStringToSeconds } from '@utils/ddo'
import { getEncryptedFiles } from '@utils/provider'
import slugify from 'slugify'
@ -127,6 +127,7 @@ export async function transformPublishFormToDdo(
files[0].valid &&
(await getEncryptedFiles(file, providerUrl.url))
// TODO: fix id
const newService: Service = {
id: 'notAnId',
type: access,
@ -144,6 +145,7 @@ export async function transformPublishFormToDdo(
id: did,
version: '4.0.0',
chainId,
nftAddress,
metadata: newMetadata,
services: [newService]
// Only added for DDO preview, reflecting Asset response,