Skip to content

Commit

Permalink
Merge pull request #302 from RunOnFlux/development
Browse files Browse the repository at this point in the history
Flux V1.18.0
  • Loading branch information
TheTrunk authored Jun 13, 2021
2 parents a0845e6 + 94c4ab5 commit df5b87d
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 8 deletions.
3 changes: 3 additions & 0 deletions ZelBack/src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,9 @@ module.exports = (app, expressWs) => {
idService.emergencyPhrase(req, res);
});

app.get('/flux/nodetier', cache('30 seconds'), (req, res) => {
fluxService.getNodeTier(req, res);
});
app.get('/flux/info', cache('30 seconds'), (req, res) => {
fluxService.getFluxInfo(req, res);
});
Expand Down
9 changes: 5 additions & 4 deletions ZelBack/src/services/appsService.js
Original file line number Diff line number Diff line change
Expand Up @@ -2715,19 +2715,19 @@ async function availableApps(req, res) {
+ 'Chainweb is a braided, parallelized Proof Of Work consensus mechanism that improves throughput and scalability in executing transactions on the blockchain while maintaining the security and integrity found in Bitcoin. '
+ 'The healthy information tells you if your node is running and synced. If you just installed the docker it can say unhealthy for long time because on first run a bootstrap is downloaded and extracted to make your node sync faster before the node is started. '
+ 'Do not stop or restart the docker in the first hour after installation. You can also check if your kadena node is synced, by going to running apps and press visit button on kadena and compare your node height with Kadena explorer. Thank you.',
repotag: 'runonflux/kadena-chainweb-node:2.7',
repotag: 'runonflux/kadena-chainweb-node:2.8',
owner: '1hjy4bCYBJr4mny4zCE85J94RXa8W6q37',
ports: [30004, 30005],
containerPorts: [30004, 30005],
domains: ['', ''],
tiered: false,
cpu: 0.8, // true resource registered for app. If not tiered only this is available
ram: 1800, // true resource registered for app
cpu: 2, // true resource registered for app. If not tiered only this is available
ram: 4000, // true resource registered for app
hdd: 60, // true resource registered for app
enviromentParameters: ['CHAINWEB_P2P_PORT=30004', 'CHAINWEB_SERVICE_PORT=30005', 'LOGLEVEL=warn'],
commands: ['/bin/bash', '-c', '(test -d /data/chainweb-db/0 && ./run-chainweb-node.sh) || (/chainweb/initialize-db.sh && ./run-chainweb-node.sh)'],
containerData: '/data', // cannot be root todo in verification
hash: 'localSpecificationsVersion8', // hash of app message
hash: 'localSpecificationsVersion9', // hash of app message
height: 680000, // height of tx on which it was
},
{ // app specifications
Expand Down Expand Up @@ -6094,6 +6094,7 @@ async function fluxShareUpload(req, res) {
}

module.exports = {
nodeTier,
dockerListContainers,
appPull,
listRunningApps,
Expand Down
6 changes: 3 additions & 3 deletions ZelBack/src/services/fluxCommunication.js
Original file line number Diff line number Diff line change
Expand Up @@ -1094,9 +1094,9 @@ async function checkMyFluxAvailability(nodelist) {
}
await serviceHelper.delay(2 * 60 * 1000); // lets wait two minutes
setTimeout(() => {
// it will try to create a confirmation transaction after 6 minutes of ask bench to restart, should be enough to restart and finish the bench.
daemonService.createConfirmationTransaction(); // on my pi for reference, running bench on micro sd card took 3 minutes to finish
}, 4 * 60 * 1000);
// it will try to create a confirmation transaction after 10 minutes of ask bench to restart, should be enough to restart and finish the bench.
daemonService.createConfirmationTransaction(); // on my pi for reference, running restarnodebench on micro sd card takes 5 minutes to finish
}, 8 * 60 * 1000);
return;
}
} else {
Expand Down
23 changes: 23 additions & 0 deletions ZelBack/src/services/fluxService.js
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,28 @@ async function adjustKadenaAccount(req, res) {
}
}

async function getNodeTier(req, res) {
try {
let responseAux;
const tier = await appsService.nodeTier();
if (tier === 'basic') {
responseAux = 'cumulus';
} else if (tier === 'super') {
responseAux = 'nimbus';
} else if (tier === 'bamf') {
responseAux = 'stratus';
} else {
throw new Error('Unrecognised Flux node tier'); // shall not happen as nodeTier throws
}
const response = serviceHelper.createDataMessage(responseAux);
res.json(response);
} catch (error) {
log.error(error);
const errMessage = serviceHelper.createErrorMessage(error.message, error.name, error.code);
res.json(errMessage);
}
}

module.exports = {
startDaemon,
updateFlux,
Expand Down Expand Up @@ -714,4 +736,5 @@ module.exports = {
adjustCruxID,
adjustKadenaAccount,
fluxBackendFolder,
getNodeTier,
};
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": "1.17.0",
"version": "1.18.0",
"description": "Flux, Your Gateway to a Decentralized World",
"repository": {
"type": "git",
Expand Down

0 comments on commit df5b87d

Please sign in to comment.