1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00

added create_compute_service_attributes

This commit is contained in:
Alex Coseru 2020-03-10 13:26:45 +02:00 committed by GitHub
parent d3c4407010
commit cf7d003d56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
}