From cf7d003d569b9189dbfc0e7391ab958d96b20828 Mon Sep 17 00:00:00 2001 From: Alex Coseru Date: Tue, 10 Mar 2020 13:26:45 +0200 Subject: [PATCH] added create_compute_service_attributes --- src/ocean/OceanCompute.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/ocean/OceanCompute.ts b/src/ocean/OceanCompute.ts index 7a0f171..3bdb72a 100644 --- a/src/ocean/OceanCompute.ts +++ b/src/ocean/OceanCompute.ts @@ -261,4 +261,25 @@ export class OceanCompute extends Instantiable { return computeJobsList[0] as ComputeJob } + + public async create_compute_service_attributes(consumerAccount: Account,price: string,datePublished: string){ + const { templates } = this.ocean.keeper + const serviceAgreementTemplate = await templates.escrowComputeExecutionTemplate.getServiceAgreementTemplate() + const name = 'dataAssetComputingServiceAgreement' + const service = { + type: 'compute', + serviceEndpoint: this.ocean.brizo.getComputeEndpoint(), + templateId: templates.escrowComputeExecutionTemplate.getId(), + attributes: { + main: { + creator: consumerAccount.getId(), + datePublished, + price, + timeout: 3600, + name + }, + serviceAgreementTemplate + } + } + return(service) }