From dea09c3c4709ebdb601e788db57b480bc763de31 Mon Sep 17 00:00:00 2001 From: Michael Taylor Date: Thu, 26 Sep 2024 11:04:02 -0400 Subject: [PATCH 1/2] chore: update dig-sdk --- package-lock.json | 8 ++++---- package.json | 2 +- src/tasks/payouts.ts | 3 ++- src/tasks/subscriber.ts | 6 +++--- src/utils/authUtils.ts | 5 +++-- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5cc5ccc..2f2e7bb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.1-alpha.23", "license": "ISC", "dependencies": { - "@dignetwork/dig-sdk": "^0.0.1-alpha.92", + "@dignetwork/dig-sdk": "^0.0.1-alpha.95", "async-mutex": "^0.5.0", "chia-server-coin": "^0.0.5", "datalayer-driver": "^0.1.21", @@ -242,9 +242,9 @@ } }, "node_modules/@dignetwork/dig-sdk": { - "version": "0.0.1-alpha.92", - "resolved": "https://registry.npmjs.org/@dignetwork/dig-sdk/-/dig-sdk-0.0.1-alpha.92.tgz", - "integrity": "sha512-0B7d2pj3UWKO8vpSOkRrKUkQIDsPXgeIDgeIOoGa+hIoEAVV6T2iOPVavFm8zpmEH5alPK4K3Lv8I5MFw+4/3w==", + "version": "0.0.1-alpha.95", + "resolved": "https://registry.npmjs.org/@dignetwork/dig-sdk/-/dig-sdk-0.0.1-alpha.95.tgz", + "integrity": "sha512-a/TBV64ZxerX47JEofvL9IhxtL/TWYJwNnNGNi3ubeVRfdyv0FDYc2VhLSeVVXYMmmL+XDm7g+PI57jcSTLCwQ==", "dependencies": { "@dignetwork/datalayer-driver": "^0.1.25", "archiver": "^7.0.1", diff --git a/package.json b/package.json index 29334f0..c9d3f44 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "LICENSE" ], "dependencies": { - "@dignetwork/dig-sdk": "^0.0.1-alpha.92", + "@dignetwork/dig-sdk": "^0.0.1-alpha.95", "async-mutex": "^0.5.0", "chia-server-coin": "^0.0.5", "datalayer-driver": "^0.1.21", diff --git a/src/tasks/payouts.ts b/src/tasks/payouts.ts index 49af527..02109c7 100644 --- a/src/tasks/payouts.ts +++ b/src/tasks/payouts.ts @@ -6,6 +6,7 @@ import { DigChallenge, DataStore, getStoresList, + Environment } from "@dignetwork/dig-sdk"; import { Mutex } from "async-mutex"; import { IncentiveProgram } from "../utils/IncentiveProgram"; @@ -36,7 +37,7 @@ const runIncentiveProgram = async ( currentEpoch: number ): Promise => { try { - if (!process.env.DIG_FOLDER_PATH) { + if (!Environment.DIG_FOLDER_PATH) { throw new Error("DIG_FOLDER_PATH environment variable not set."); } diff --git a/src/tasks/subscriber.ts b/src/tasks/subscriber.ts index 176fb59..01637cd 100644 --- a/src/tasks/subscriber.ts +++ b/src/tasks/subscriber.ts @@ -1,6 +1,6 @@ import _ from "lodash"; import { Task, SimpleIntervalJob } from "toad-scheduler"; -import { STORE_PATH, DataStore, NconfManager, DigNetwork } from "@dignetwork/dig-sdk"; +import { STORE_PATH, DataStore, NconfManager, DigNetwork, Environment } from "@dignetwork/dig-sdk"; import { Mutex } from "async-mutex"; import { IncentiveProgram } from "../utils/IncentiveProgram"; import fs from "fs"; @@ -29,8 +29,8 @@ const runSubscriber = async (): Promise => { let totalDiskSpace = await DataStore.getTotalDiskSpace(); // Cast DISK_SPACE_LIMIT to bigint - const diskSpaceLimit = process.env.DISK_SPACE_LIMIT - ? BigInt(process.env.DISK_SPACE_LIMIT) + const diskSpaceLimit = Environment.DISK_SPACE_LIMIT_BYTES + ? BigInt(Environment.DISK_SPACE_LIMIT_BYTES) : null; let subscriptionMade = false; diff --git a/src/utils/authUtils.ts b/src/utils/authUtils.ts index 98c82fe..4a65fca 100644 --- a/src/utils/authUtils.ts +++ b/src/utils/authUtils.ts @@ -1,8 +1,9 @@ import {HttpError } from "./HttpError"; +import { Environment } from "@dignetwork/dig-sdk"; export const getCredentials = async () => { - const username = process.env.DIG_USERNAME; - const password = process.env.DIG_PASSWORD; + const username = Environment.DIG_USERNAME; + const password = Environment.DIG_PASSWORD; if (!username || !password) { throw new HttpError(500, "Propagation Server does not have credentials set, please add them to the ENV to use this feature."); From 9f540f69415ec5a7f1fa0e6bf99b8da157db3b1c Mon Sep 17 00:00:00 2001 From: Michael Taylor Date: Thu, 26 Sep 2024 11:04:27 -0400 Subject: [PATCH 2/2] chore(release): 0.0.1-alpha.24 --- CHANGELOG.md | 2 ++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e5d52d..75172c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [0.0.1-alpha.24](https://github.com/DIG-Network/dig-incentive-server/compare/v0.0.1-alpha.23...v0.0.1-alpha.24) (2024-09-26) + ### [0.0.1-alpha.23](https://github.com/DIG-Network/dig-incentive-server/compare/v0.0.1-alpha.22...v0.0.1-alpha.23) (2024-09-26) ### [0.0.1-alpha.22](https://github.com/DIG-Network/dig-incentive-server/compare/v0.0.1-alpha.21...v0.0.1-alpha.22) (2024-09-26) diff --git a/package-lock.json b/package-lock.json index 2f2e7bb..c64f67b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "dig-incentive-server", - "version": "0.0.1-alpha.23", + "version": "0.0.1-alpha.24", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dig-incentive-server", - "version": "0.0.1-alpha.23", + "version": "0.0.1-alpha.24", "license": "ISC", "dependencies": { "@dignetwork/dig-sdk": "^0.0.1-alpha.95", diff --git a/package.json b/package.json index c9d3f44..0538daa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dig-incentive-server", - "version": "0.0.1-alpha.23", + "version": "0.0.1-alpha.24", "description": "", "type": "commonjs", "main": "./dist/index.js",