From 772a627a2e758c8eef78796ddb3f13502f70abd3 Mon Sep 17 00:00:00 2001 From: Seweryn Kras Date: Tue, 2 Jul 2024 09:49:03 +0200 Subject: [PATCH] feat: bump golem-js to stable 3.0 --- package-lock.json | 30 +++++++++++++++++-------- package.json | 2 +- src/market/market.command.ts | 9 ++++---- src/run-on-golem/run-on-golem.action.ts | 1 - 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2fbf07a..105e624 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "data/project-templates/*" ], "dependencies": { - "@golem-sdk/golem-js": "^3.0.0-beta.51", + "@golem-sdk/golem-js": "^3.0.0", "ajv": "^8.12.0", "ajv-formats": "^2.1.1", "chalk": "4.1.2", @@ -2096,9 +2096,9 @@ } }, "node_modules/@golem-sdk/golem-js": { - "version": "3.0.0-beta.51", - "resolved": "https://registry.npmjs.org/@golem-sdk/golem-js/-/golem-js-3.0.0-beta.51.tgz", - "integrity": "sha512-6VMeMbuU7JSQlvtqbvqtfhJFmXR6kYQ33O6ssvbMX3N4lPnnuD+i5Mx9OK0I1af4xGDJse82M8kL24J2fncwXg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@golem-sdk/golem-js/-/golem-js-3.0.0.tgz", + "integrity": "sha512-jqjV+egfTIgkNQL3aGh4gorj+K9yD4/BokZ4FdT8C8LX7gkRrPSwT5OJcWUrt/Qq03aDI5J4FuOeN8RLWOiWAw==", "dependencies": { "async-lock": "^1.4.1", "async-retry": "^1.3.3", @@ -2114,9 +2114,9 @@ "rxjs": "^7.8.1", "semver": "^7.5.4", "tmp": "^0.2.2", - "uuid": "^9.0.1", + "uuid": "^10.0.0", "ws": "^8.16.0", - "ya-ts-client": "^1.1.2" + "ya-ts-client": "^1.1.3" }, "engines": { "node": ">=18.0.0" @@ -2132,6 +2132,18 @@ "resolved": "https://registry.npmjs.org/flatbuffers/-/flatbuffers-24.3.25.tgz", "integrity": "sha512-3HDgPbgiwWMI9zVB7VYBHaMrbOO7Gm0v+yD2FV/sCKj+9NDeVL7BOBYUuhWAQGKWOzBo8S9WdMvV0eixO233XQ==" }, + "node_modules/@golem-sdk/golem-js/node_modules/uuid": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz", + "integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@golem-sdk/react": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@golem-sdk/react/-/react-3.0.1.tgz", @@ -14681,9 +14693,9 @@ } }, "node_modules/ya-ts-client": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/ya-ts-client/-/ya-ts-client-1.1.2.tgz", - "integrity": "sha512-rZ2YMs3ATOzkaRo7NXDuNZ9xhjxufD/FLFpEm88LqnrpNJcRa81ZXy7B0yKQ2PaOedaKWELPjwcF7RoaOp2N1A==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/ya-ts-client/-/ya-ts-client-1.1.3.tgz", + "integrity": "sha512-30l0EAz8E1G0JbhNj8aNQF1/g9SVXYUebdVJ248jQEA8oOwxotcw2STvAZZPX84KhbKRe1W5H+rY5cnwTLzCLQ==", "engines": { "node": ">=18.0.0" } diff --git a/package.json b/package.json index 5f17354..0ffde58 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "node": ">=18.0.0" }, "dependencies": { - "@golem-sdk/golem-js": "^3.0.0-beta.51", + "@golem-sdk/golem-js": "^3.0.0", "ajv": "^8.12.0", "ajv-formats": "^2.1.1", "chalk": "4.1.2", diff --git a/src/market/market.command.ts b/src/market/market.command.ts index ff644c2..9bccadd 100644 --- a/src/market/market.command.ts +++ b/src/market/market.command.ts @@ -1,5 +1,5 @@ import { Command, Option } from "commander"; -import { GolemNetwork, MarketOrderSpec, OfferProposal, ProposalFilterFactory } from "@golem-sdk/golem-js"; +import { GolemNetwork, MarketOrderSpec, OfferProposal, OfferProposalFilterFactory } from "@golem-sdk/golem-js"; import chalk from "chalk"; import { switchMap, filter, scan, takeUntil, timer, last } from "rxjs"; @@ -134,7 +134,7 @@ marketCommand return; } - const priceLimiter = ProposalFilterFactory.limitPriceFilter({ + const priceLimiter = OfferProposalFilterFactory.limitPriceFilter({ start: maxStartPrice, cpuPerSec: maxCpuPerHourPrice / 3600, envPerSec: maxEnvPerHourPrice / 3600, @@ -152,7 +152,6 @@ marketCommand const order: MarketOrderSpec = { demand: { subnetTag, - expirationSec: scanTime, workload: { imageTag, minCpuCores, @@ -171,7 +170,7 @@ marketCommand maxEnvPerHourPrice, maxStartPrice, }, - proposalFilter: scanningFilter, + offerProposalFilter: scanningFilter, }, }; @@ -179,7 +178,7 @@ marketCommand budget: 0, expirationSec: scanTime, }); - const demandSpec = await glm.market.buildDemandDetails(order.demand, allocation); + const demandSpec = await glm.market.buildDemandDetails(order.demand, order.market, allocation); glm.market .publishAndRefreshDemand(demandSpec) diff --git a/src/run-on-golem/run-on-golem.action.ts b/src/run-on-golem/run-on-golem.action.ts index 50ebab0..986776f 100644 --- a/src/run-on-golem/run-on-golem.action.ts +++ b/src/run-on-golem/run-on-golem.action.ts @@ -195,7 +195,6 @@ async function createMarketOrder(options: RunOnGolemOptions): Promise