Skip to content

Commit

Permalink
Merge pull request #330 from RunOnFlux/development
Browse files Browse the repository at this point in the history
v2.0.3
  • Loading branch information
TheTrunk authored Sep 8, 2021
2 parents 3f42add + 70abb4d commit 62901d7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
13 changes: 10 additions & 3 deletions ZelBack/src/services/appsService.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const myCache = new LRU(LRUoptions);

let removalInProgress = false;
let installationInProgress = false;
let storedTier = '';

function getAppIdentifier(appName) {
// this id is used for volumes, docker names so we know it reall belongs to flux
Expand Down Expand Up @@ -357,6 +358,9 @@ async function listAppsImages(req, res) {
}

async function nodeTier() {
if (storedTier) {
return storedTier; // node tier is not changing. We can use globally cached value.
}
// get our collateral information to decide if app specifications are basic, super, bamf
// getzlenodestatus.collateral
const nodeStatus = await daemonService.getZelNodeStatus();
Expand All @@ -378,13 +382,16 @@ async function nodeTier() {
// get collateralInformation.txindex vout
const { value } = txInformation.data.vout[collateralInformation.txindex];
if (value === 10000) {
return 'basic';
storedTier = 'basic';
return storedTier;
}
if (value === 25000) {
return 'super';
storedTier = 'super';
return storedTier;
}
if (value === 100000) {
return 'bamf';
storedTier = 'bamf';
return storedTier;
}
throw new Error('Unrecognised Flux Node tier');
}
Expand Down
9 changes: 4 additions & 5 deletions ZelBack/src/services/idService.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ async function loginPhrase(req, res) {
// check docker availablility
await appsService.dockerListContainers(false);
// check Node Hardware Requirements are ok.
// const hwPassed = await confirmNodeTierHardware();
// if (hwPassed === false) {
// throw new Error('Node hardware requirements not met');
// }
const hwPassed = await confirmNodeTierHardware();
if (hwPassed === false) {
throw new Error('Node hardware requirements not met');
}
// check DOS state (contains daemon checks)
const dosState = await fluxCommunication.getDOSState();
if (dosState.status === 'error') {
Expand Down Expand Up @@ -712,5 +712,4 @@ module.exports = {
wsRespondLoginPhrase,
wsRespondSignature,
checkLoggedUser,
confirmNodeTierHardware,
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flux",
"version": "2.0.2",
"version": "2.0.3",
"description": "Flux, Your Gateway to a Decentralized World",
"repository": {
"type": "git",
Expand Down

0 comments on commit 62901d7

Please sign in to comment.