Skip to content

Commit

Permalink
feat: bump golem-js to stable 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SewerynKras committed Jul 2, 2024
1 parent 712edaa commit 772a627
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
30 changes: 21 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 4 additions & 5 deletions src/market/market.command.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand Down Expand Up @@ -134,7 +134,7 @@ marketCommand
return;
}

const priceLimiter = ProposalFilterFactory.limitPriceFilter({
const priceLimiter = OfferProposalFilterFactory.limitPriceFilter({
start: maxStartPrice,
cpuPerSec: maxCpuPerHourPrice / 3600,
envPerSec: maxEnvPerHourPrice / 3600,
Expand All @@ -152,7 +152,6 @@ marketCommand
const order: MarketOrderSpec = {
demand: {
subnetTag,
expirationSec: scanTime,
workload: {
imageTag,
minCpuCores,
Expand All @@ -171,15 +170,15 @@ marketCommand
maxEnvPerHourPrice,
maxStartPrice,
},
proposalFilter: scanningFilter,
offerProposalFilter: scanningFilter,
},
};

const allocation = await glm.payment.createAllocation({
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)
Expand Down
1 change: 0 additions & 1 deletion src/run-on-golem/run-on-golem.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ async function createMarketOrder(options: RunOnGolemOptions): Promise<MarketOrde
console.log(`Publishing order using image ${options.image}`);
return {
demand: {
expirationSec: timeout,
workload: {
imageTag: options.image,
},
Expand Down

0 comments on commit 772a627

Please sign in to comment.