@hashgraph/solo
Version:
An opinionated CLI tool to deploy and manage private Hedera Networks.
48 lines • 1.79 kB
JavaScript
// SPDX-License-Identifier: Apache-2.0
export var ArchitectureType;
(function (ArchitectureType) {
ArchitectureType["AMD64"] = "amd64";
ArchitectureType["ARM64"] = "arm64";
})(ArchitectureType || (ArchitectureType = {}));
export class Architecture {
static NODE_ARCH_X64 = 'x64';
static NODE_ARCH_ARM64 = 'arm64';
static NODE_ARCH_AARCH64 = 'aarch64';
static LINUX_AMD64 = 'linux/amd64';
static LINUX_ARM64 = 'linux/arm64';
static getArchitecture(rawArchitecture = process.arch) {
switch (rawArchitecture) {
case Architecture.NODE_ARCH_X64: {
return ArchitectureType.AMD64;
}
case Architecture.NODE_ARCH_ARM64:
case Architecture.NODE_ARCH_AARCH64: {
return ArchitectureType.ARM64;
}
default: {
throw new Error(`Unsupported host architecture: ${rawArchitecture}`);
}
}
}
static getLinuxPlatform(rawArchitecture = process.arch) {
const architecture = Architecture.getArchitecture(rawArchitecture);
switch (architecture) {
case ArchitectureType.AMD64: {
return Architecture.LINUX_AMD64;
}
case ArchitectureType.ARM64: {
return Architecture.LINUX_ARM64;
}
}
}
static isAmd64(rawArchitecture = process.arch) {
return Architecture.getArchitecture(rawArchitecture) === ArchitectureType.AMD64;
}
static isArm64(rawArchitecture = process.arch) {
return Architecture.getArchitecture(rawArchitecture) === ArchitectureType.ARM64;
}
static getRawArchitecture(rawArchitecture = process.arch) {
return rawArchitecture;
}
}
//# sourceMappingURL=architecture.js.map