@dignetwork/dig-sdk 0.0.1-alpha.153 → 0.0.1-alpha.155
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -56,7 +56,7 @@ class Environment {
|
|
|
56
56
|
// Static getter for PUBLIC_IP (valid IP)
|
|
57
57
|
static get PUBLIC_IP() {
|
|
58
58
|
const value = process.env["PUBLIC_IP"];
|
|
59
|
-
return value
|
|
59
|
+
return value;
|
|
60
60
|
}
|
|
61
61
|
// Static getter for DISK_SPACE_LIMIT_BYTES (number, optional)
|
|
62
62
|
static get DISK_SPACE_LIMIT_BYTES() {
|
package/dist/utils/network.js
CHANGED
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.formatHost = exports.getPublicHost = void 0;
|
|
7
7
|
const superagent_1 = __importDefault(require("superagent"));
|
|
8
|
-
const Environment_1 = require("./Environment");
|
|
9
8
|
const MAX_RETRIES = 5;
|
|
10
9
|
const RETRY_DELAY = 2000; // in milliseconds
|
|
11
10
|
// Regular expression for validating both IPv4 and IPv6 addresses
|
|
@@ -18,7 +17,7 @@ const isValidHost = (host) => {
|
|
|
18
17
|
return ipv4Regex.test(host) || ipv6Regex.test(host) || hostnameRegex.test(host);
|
|
19
18
|
};
|
|
20
19
|
const getPublicHost = async () => {
|
|
21
|
-
const publicHost =
|
|
20
|
+
const publicHost = process.env.PUBLIC_IP;
|
|
22
21
|
if (publicHost) {
|
|
23
22
|
console.log("Public IP/Hostname from env:", publicHost);
|
|
24
23
|
if (isValidHost(publicHost)) {
|