Skip to content

Commit

Permalink
Merge pull request #947 from golemfactory/mgordel/env-vars
Browse files Browse the repository at this point in the history
fix: ability to load env variables for subnet tag and payment network
  • Loading branch information
mgordel authored May 31, 2024
2 parents 9425cda + 1a4cc90 commit 5627620
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/market/demand/directors/basic-demand-director-config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { BaseConfig } from "./base-config";
import { GolemConfigError } from "../../../shared/error/golem-error";
import * as EnvUtils from "../../../shared/utils/env";

export interface BasicDemandDirectorConfigOptions {
expirationSec: number;
Expand All @@ -8,7 +9,7 @@ export interface BasicDemandDirectorConfigOptions {

export class BasicDemandDirectorConfig extends BaseConfig implements BasicDemandDirectorConfigOptions {
public readonly expirationSec = 30 * 60; // 30 minutes
public readonly subnetTag: string = "public";
public readonly subnetTag: string = EnvUtils.getYagnaSubnet();

constructor(options?: Partial<BasicDemandDirectorConfigOptions>) {
super();
Expand Down
3 changes: 2 additions & 1 deletion src/payment/payment.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { PayerDetails } from "./PayerDetails";
import { CreateAllocationParams } from "./types";
import { AgreementPaymentProcess, PaymentProcessOptions } from "./agreement_payment_process";
import { Agreement } from "../market";
import * as EnvUtils from "../shared/utils/env";

export interface PaymentModuleOptions {
/**
Expand Down Expand Up @@ -81,7 +82,7 @@ export class PaymentModuleImpl implements PaymentModule {

private readonly options: Required<PaymentModuleOptions> = {
driver: "erc20",
network: "holesky",
network: EnvUtils.getPaymentNetwork(),
token: "tglm",
};

Expand Down

0 comments on commit 5627620

Please sign in to comment.