Skip to content

Commit

Permalink
feat: min supported yagna version 0.13.2 and goerli default network
Browse files Browse the repository at this point in the history
  • Loading branch information
grisha87 committed Feb 6, 2024
1 parent 7d23529 commit e9bedff
Show file tree
Hide file tree
Showing 25 changed files with 48 additions and 48 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ on:
provider_version:
description: "Provider version (e.g., v0.13.2 or pre-rel-v0.13.1)"
required: false
default: "v0.14.0"
default: "v0.13.2"
requestor_version:
description: "Requestor version (e.g., v0.13.2 or pre-rel-v0.13.1)"
required: false
default: "v0.14.0"
default: "v0.13.2"
provider_wasi_version:
description: "Provider WASI version (e.g., v0.2.2)"
required: false
Expand All @@ -36,8 +36,8 @@ permissions:
contents: read # for checkout

env:
PROVIDER_VERSION: ${{ github.event.inputs.provider_version || 'v0.14.0' }}
REQUESTOR_VERSION: ${{ github.event.inputs.requestor_version || 'v0.14.0' }}
PROVIDER_VERSION: ${{ github.event.inputs.provider_version || 'v0.13.2' }}
REQUESTOR_VERSION: ${{ github.event.inputs.requestor_version || 'v0.13.2' }}
PROVIDER_WASI_VERSION: ${{ github.event.inputs.provider_wasi_version || 'v0.2.2' }}
PROVIDER_VM_VERSION: ${{ github.event.inputs.provider_vm_version || 'v0.3.0' }}

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ distributed, computational loads through Golem Network.

## System requirements

To use `golem-js`, it is necessary to have yagna installed, with a **minimum version requirement of v0.14.0**. Yagna is a
To use `golem-js`, it is necessary to have yagna installed, with a **minimum version requirement of v0.13.2**. Yagna is a
service that communicates and performs operations on the Golem Network, upon your requests via the SDK. You
can [follow these instructions](https://docs.golem.network/docs/creators/javascript/quickstarts/quickstart#install-yagna-2)
to set it up.
Expand All @@ -66,13 +66,13 @@ yagna service run

# IN SEPARATE TERMINAL (if not daemonized)
# Initialize your requestor
yagna payment init --sender --network holesky
yagna payment init --sender --network goerli

# Request funds on the test network
yagna payment fund --network holesky
yagna payment fund --network goerli

# Check the status of the funds
yagna payment status --network holesky
yagna payment status --network goerli
```

#### Obtain your `app-key` to use with SDK
Expand Down
2 changes: 1 addition & 1 deletion examples/blender/blender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async function main(subnetTag: string, driver?: string, network?: string, maxPar
program
.option("--subnet-tag <subnet>", "set subnet name, for example 'public'")
.option("--payment-driver, --driver <driver>", "payment driver name, for example 'erc20'")
.option("--payment-network, --network <network>", "network name, for example 'holesky'")
.option("--payment-network, --network <network>", "network name, for example 'goerli'")
.option("-t, --max-parallel-tasks <maxParallelTasks>", "max parallel tasks");
program.parse();
const options = program.opts();
Expand Down
2 changes: 1 addition & 1 deletion examples/fibonacci/fibonacci.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ program
.option("-c, --tasks-count <c>", "tasks count", (val) => parseInt(val))
.option("--subnet-tag <subnet>", "set subnet name, for example 'public'")
.option("--payment-driver, --driver <driver>", "payment driver name, for example 'erc20'")
.option("--payment-network, --network <network>", "network name, for example 'holesky'");
.option("--payment-network, --network <network>", "network name, for example 'goerli'");
program.parse();
const options = program.opts();
main(options.fibonacciNumber, options.tasksCount, options.subnetTag, options.driver, options.network);
2 changes: 1 addition & 1 deletion examples/ssh/ssh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async function main(subnetTag, driver, network, count = 2, sessionTimeout = 100)
program
.option("--subnet-tag <subnet>", "set subnet name, for example 'public'")
.option("--payment-driver <paymentDriver>", "payment driver name, for example 'erc20'")
.option("--payment-network <paymentNetwork>", "network name, for example 'holesky'")
.option("--payment-network <paymentNetwork>", "network name, for example 'goerli'")
.option("--task-count, --count <count>", "task count", (val) => parseInt(val))
.option("-t, --timeout <timeout>", "ssh session timeout (in seconds)", (val) => parseInt(val));
program.parse();
Expand Down
2 changes: 1 addition & 1 deletion examples/web/hello.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h3>Options</h3>
</div>
<div>
<label for="PAYMENT_NETWORK">Payment Network: </label>
<input id="PAYMENT_NETWORK" type="text" value="holesky" />
<input id="PAYMENT_NETWORK" type="text" value="goerli" />
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion examples/web/image.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h3>Credentials</h3>
</div>
<div>
<label for="PAYMENT_NETWORK">Payment Network: </label>
<input id="PAYMENT_NETWORK" type="text" value="holesky" />
<input id="PAYMENT_NETWORK" type="text" value="goerli" />
</div>
<div>
<label for="MEME_TEXT">Meme Text: </label>
Expand Down
2 changes: 1 addition & 1 deletion examples/yacat/yacat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ async function main(args) {
program
.option("--subnet-tag <subnet>", "set subnet name, for example 'public'")
.option("--payment-driver, --driver <driver>", "payment driver name, for example 'erc20'")
.option("--payment-network, --network <network>", "network name, for example 'holesky'")
.option("--payment-network, --network <network>", "network name, for example 'goerli'")
.option("--number-of-providers <number_of_providers>", "number of providers", (value) => parseInt(value), 2)
.option("--mask <mask>")
.requiredOption("--hash <hash>");
Expand Down
2 changes: 1 addition & 1 deletion src/executor/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { GolemConfigError } from "../error/golem-error";
import { Logger, runtimeContextChecker, defaultLogger, nullLogger } from "../utils";

const DEFAULTS = Object.freeze({
payment: { driver: "erc20", network: "holesky" },
payment: { driver: "erc20", network: "goerli" },
budget: 1.0,
subnetTag: "public",
basePath: "http://127.0.0.1:7465",
Expand Down
2 changes: 1 addition & 1 deletion src/executor/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export class TaskExecutor {
* ```js
* const executor = await TaskExecutor.create({
* subnetTag: "public",
* payment: { driver: "erc-20", network: "holesky" },
* payment: { driver: "erc-20", network: "goerli" },
* package: "golem/alpine:3.18.2",
* });
* ```
Expand Down
2 changes: 1 addition & 1 deletion src/market/proposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export type ProposalProperties = Record<string, string | number | string[] | num
"golem.activity.caps.transfer.protocol": string[];
"golem.com.payment.debit-notes.accept-timeout?": number;
"golem.com.payment.platform.erc20-polygon-glm.address"?: string;
"golem.com.payment.platform.erc20-holesky-tglm.address"?: string;
"golem.com.payment.platform.erc20-goerli-tglm.address"?: string;
"golem.com.payment.platform.erc20-mumbai-tglm.address"?: string;
"golem.com.pricing.model": "linear";
"golem.com.pricing.model.linear.coeffs": number[];
Expand Down
2 changes: 1 addition & 1 deletion src/package/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { GolemConfigError } from "../error/golem-error";
* @internal
*/
export const DEFAULTS = Object.freeze({
payment: { driver: "erc20", network: "holesky" },
payment: { driver: "erc20", network: "goerli" },
engine: "vm",
minMemGib: 0.5,
minStorageGib: 2,
Expand Down
2 changes: 1 addition & 1 deletion src/payment/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { acceptAllDebitNotesFilter, acceptAllInvoicesFilter } from "./strategy";
import { GolemConfigError } from "../error/golem-error";

const DEFAULTS = Object.freeze({
payment: { network: "holesky", driver: "erc20" },
payment: { network: "goerli", driver: "erc20" },
budget: 1.0,
paymentTimeout: 1000 * 60, // 1 min
allocationExpires: 1000 * 60 * 60, // 60 min
Expand Down
6 changes: 3 additions & 3 deletions src/payment/invoice.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe("Invoice", () => {
payeeAddr: "0xPAYEE",
payerAddr: "0xPAYER",
recipientId: "recipient-id",
paymentPlatform: "holesky",
paymentPlatform: "goerli",
timestamp: "2023-01-01T00:00:00.000Z",
agreementId: "agreement-id",
status: InvoiceStatus.Received,
Expand Down Expand Up @@ -114,7 +114,7 @@ describe("Invoice", () => {
payeeAddr: "0xPAYEE",
payerAddr: "0xPAYER",
recipientId: "recipient-id",
paymentPlatform: "holesky",
paymentPlatform: "goerli",
timestamp: "2023-01-01T00:00:00.000Z",
agreementId: "agreement-id",
status: InvoiceStatus.Received,
Expand All @@ -135,7 +135,7 @@ describe("Invoice", () => {
payeeAddr: "0xPAYEE",
payerAddr: "0xPAYER",
recipientId: "recipient-id",
paymentPlatform: "holesky",
paymentPlatform: "goerli",
timestamp: "2023-01-01T00:00:00.000Z",
agreementId: "agreement-id",
status: InvoiceStatus.Received,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function getRepoUrl(): string {
}

export function getPaymentNetwork(): string {
return isNode ? process.env.PAYMENT_NETWORK ?? "holesky" : "holesky";
return isNode ? process.env.PAYMENT_NETWORK ?? "goerli" : "goerli";
}

export function isDevMode(): boolean {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/yagna/yagna.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const mockIdentityModel = imock<IdentityModel>();

describe("Yagna Utils", () => {
describe("Yagna version support checking", () => {
describe("Positive cases - given min supported version is 0.14.0", () => {
it.each(["0.14.0", "0.15.0-rc5", "pre-rel-v0.15.0-rc5"])(
describe("Positive cases - given min supported version is 0.13.2", () => {
it.each(["0.13.2", "0.15.0-rc5", "pre-rel-v0.15.0-rc5"])(
"should not throw when connect is called and the yagna version is %s",
async (version) => {
when(response.json()).thenResolve({
Expand Down
6 changes: 3 additions & 3 deletions src/utils/yagna/yagna.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ export type YagnaOptions = {
};

type YagnaVersionInfo = {
// @example 0.14.0
// @example 0.13.2
version: string;
// @example v0.14.0
// @example v0.13.2
name: string;
seen: boolean;
// @example "2023-12-07T14:23:48"
Expand All @@ -48,7 +48,7 @@ type YagnaVersionResponse = {

const CONNECTIONS_ERROR_CODES = ["ECONNREFUSED"];

export const MIN_SUPPORTED_YAGNA = "0.14.0";
export const MIN_SUPPORTED_YAGNA = "0.13.2";

export class Yagna {
private readonly httpAgent: Agent;
Expand Down
2 changes: 1 addition & 1 deletion tests/docker/fundRequestor.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

for i in {1..3}; do
yagna payment fund --network holesky && exit 0
yagna payment fund --network goerli && exit 0
done

echo "yagna payment fund failed" >&2
Expand Down
2 changes: 1 addition & 1 deletion tests/docker/startRequestor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

get_funds_from_faucet() {
echo "Sending request to the faucet"
yagna payment fund --network holesky
yagna payment fund --network goerli
}
echo "Starting Yagna"
yagna service run --api-allow-origin="*"
6 changes: 3 additions & 3 deletions tests/mock/entities/allocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { MarketDecoration } from "ya-ts-client/dist/ya-payment";
// @ts-ignore
export const allocationMock: Allocation = {
timeout: "",
paymentPlatform: "erc20-holesky-tglm",
paymentPlatform: "erc20-goerli-tglm",
address: "",
id: "test_id",
timestamp: "",
Expand All @@ -14,11 +14,11 @@ export const allocationMock: Allocation = {
return Promise.resolve({
properties: [
{
key: "golem.com.payment.platform.erc20-holesky-tglm.address",
key: "golem.com.payment.platform.erc20-goerli-tglm.address",
value: "0x19ee20338a4c4bf8f6aebc79d9d3af2a01434119",
},
],
constraints: ["(golem.com.payment.platform.erc20-holesky-tglm.address=*)"],
constraints: ["(golem.com.payment.platform.erc20-goerli-tglm.address=*)"],
});
},
async release(): Promise<void> {
Expand Down
2 changes: 1 addition & 1 deletion tests/mock/fixtures/agreements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const agreementsApproved = [
offer: {
properties: {
"golem.activity.caps.transfer.protocol": ["gftp", "http", "https"],
"golem.com.payment.platform.erc20-holesky-tglm.address": "0x6e7f25ca8ab5a043d91d102116cc97c2654403f0",
"golem.com.payment.platform.erc20-goerli-tglm.address": "0x6e7f25ca8ab5a043d91d102116cc97c2654403f0",
"golem.com.payment.platform.erc20-mumbai-tglm.address": "0x6e7f25ca8ab5a043d91d102116cc97c2654403f0",
"golem.com.payment.platform.erc20-rinkeby-tglm.address": "0x6e7f25ca8ab5a043d91d102116cc97c2654403f0",
"golem.com.payment.platform.zksync-rinkeby-tglm.address": "0x6e7f25ca8ab5a043d91d102116cc97c2654403f0",
Expand Down
2 changes: 1 addition & 1 deletion tests/mock/fixtures/allocations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export const allocations = [
{
allocationId: "70000034-020b-40a0-8adc-404be7440beb",
address: "0x19ee20338a4c4bf8f6aebc79d9d3af2a01434119",
paymentPlatform: "erc20-holesky-tglm",
paymentPlatform: "erc20-goerli-tglm",
totalAmount: "1",
spentAmount: "0",
remainingAmount: "1",
Expand Down
2 changes: 1 addition & 1 deletion tests/mock/fixtures/debit_notes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const debitNotes = [
recipientId: "0x19ee20338a4c4bf8f6aebc79d9d3af2a01434119",
payeeAddr: "0xd9a4a6ba9e1800e4f61cd88dc23f082527f4ee28",
payerAddr: "0x19ee20338a4c4bf8f6aebc79d9d3af2a01434119",
paymentPlatform: "erc20-holesky-tglm",
paymentPlatform: "erc20-goerli-tglm",
timestamp: "2022-12-05T08:54:31.831Z",
agreementId: "test_agreement_id",
activityId: "00f36a80a8544260acbf4b09dc46f4fc",
Expand Down
2 changes: 1 addition & 1 deletion tests/mock/fixtures/invoices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const invoices = [
recipientId: "0x19ee20338a4c4bf8f6aebc79d9d3af2a01434119",
payeeAddr: "0xd9a4a6ba9e1800e4f61cd88dc23f082527f4ee28",
payerAddr: "0x19ee20338a4c4bf8f6aebc79d9d3af2a01434119",
paymentPlatform: "erc20-holesky-tglm",
paymentPlatform: "erc20-goerli-tglm",
timestamp: "2022-12-05T08:54:31.927Z",
agreementId: "test_agreement_id",
activityIds: ["00f36a80a8544260acbf4b09dc46f4fc"],
Expand Down
Loading

0 comments on commit e9bedff

Please sign in to comment.