mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
small ddo adoptions
This commit is contained in:
parent
f37a1cc1c6
commit
1b967896df
@ -64,10 +64,12 @@ export default class Ocean {
|
|||||||
|
|
||||||
const assetId: string = IdGenerator.generateId()
|
const assetId: string = IdGenerator.generateId()
|
||||||
const did: string = `did:op:${assetId}`
|
const did: string = `did:op:${assetId}`
|
||||||
const serviceDefinitionId: string = IdGenerator.generatePrefixedId()
|
const accessServiceDefinitionId: string = "0"
|
||||||
|
const computeServiceDefintionId: string = "1"
|
||||||
|
const metadataServiceDefinitionId: string = "2"
|
||||||
|
|
||||||
metadata.base.contentUrls =
|
metadata.base.contentUrls =
|
||||||
await SecretStoreProvider.getSecretStore().encryptDocument(assetId, metadata.base.contentUrls)
|
[await SecretStoreProvider.getSecretStore().encryptDocument(assetId, metadata.base.contentUrls)]
|
||||||
|
|
||||||
const template = new Access()
|
const template = new Access()
|
||||||
const serviceAgreementTemplate = new ServiceAgreementTemplate(template)
|
const serviceAgreementTemplate = new ServiceAgreementTemplate(template)
|
||||||
@ -159,9 +161,9 @@ export default class Ocean {
|
|||||||
type: template.templateName,
|
type: template.templateName,
|
||||||
purchaseEndpoint: brizo.getPurchaseEndpoint(),
|
purchaseEndpoint: brizo.getPurchaseEndpoint(),
|
||||||
serviceEndpoint: brizo.getConsumeEndpoint(publisher.getId(),
|
serviceEndpoint: brizo.getConsumeEndpoint(publisher.getId(),
|
||||||
serviceDefinitionId, metadata.base.contentUrls[0]),
|
accessServiceDefinitionId, metadata.base.contentUrls[0]),
|
||||||
// the id of the service agreement?
|
// the id of the service agreement?
|
||||||
serviceDefinitionId,
|
serviceDefinitionId: accessServiceDefinitionId,
|
||||||
// the id of the service agreement template
|
// the id of the service agreement template
|
||||||
templateId: serviceAgreementTemplate.getId(),
|
templateId: serviceAgreementTemplate.getId(),
|
||||||
conditions: ddoConditions,
|
conditions: ddoConditions,
|
||||||
@ -169,11 +171,13 @@ export default class Ocean {
|
|||||||
{
|
{
|
||||||
type: "Compute",
|
type: "Compute",
|
||||||
serviceEndpoint: brizo.getComputeEndpoint(publisher.getId(),
|
serviceEndpoint: brizo.getComputeEndpoint(publisher.getId(),
|
||||||
serviceDefinitionId, "xxx", "xxx"),
|
computeServiceDefintionId, "xxx", "xxx"),
|
||||||
|
serviceDefinitionId: computeServiceDefintionId,
|
||||||
} as Service,
|
} as Service,
|
||||||
{
|
{
|
||||||
type: "Metadata",
|
type: "Metadata",
|
||||||
serviceEndpoint,
|
serviceEndpoint,
|
||||||
|
serviceDefinitionId: metadataServiceDefinitionId,
|
||||||
metadata,
|
metadata,
|
||||||
} as Service,
|
} as Service,
|
||||||
],
|
],
|
||||||
|
Loading…
Reference in New Issue
Block a user