From 3fcb3e95b3ec1635d2aef82d40d4596f33e2542b Mon Sep 17 00:00:00 2001 From: Tadeas Kmenta Date: Sat, 10 Apr 2021 08:28:12 +0800 Subject: [PATCH 1/8] update to new naming --- ZelFront/src/components/Dashboard.vue | 375 +++++++++----------------- 1 file changed, 132 insertions(+), 243 deletions(-) diff --git a/ZelFront/src/components/Dashboard.vue b/ZelFront/src/components/Dashboard.vue index 1975ef8a0..cc4402f9d 100644 --- a/ZelFront/src/components/Dashboard.vue +++ b/ZelFront/src/components/Dashboard.vue @@ -140,103 +140,27 @@ >


-

Rewards After April 10th(Miners 50%/50% Flux Nodes)

-

-
-
-

Cumulus Rewards

-

-

per day

-

{{ beautifyValue(basicWeek / 7 ) }} FLUX

-

{{ beautifyValue(basicUSDRewardWeek / 7) }} USD

-

No KDA available

-

-

per week

-

{{ beautifyValue(basicWeek) }} FLUX

-

{{ beautifyValue(basicUSDRewardWeek) }} USD

-

No KDA available

-

-

per month

-

{{ beautifyValue(basicWeek * 4.34812141) }} FLUX

-

{{ beautifyValue(basicUSDRewardWeek * 4.34812141) }} USD

-

No KDA available

-

-

Profitability per month - Node Cost 4.70 USD

-

Node only: {{ beautifyValue(basicUSDRewardWeek * 4.34812141 - 4.70) }} USD

-

No KDA available

-
-
-
-

Nimbus Rewards

-

-

per day

-

{{ beautifyValue(superWeek / 7) }} FLUX ~ {{ beautifyValue(superUSDRewardWeek / 7) }} USD

-

{{ beautifyValue(kdaNimbusWeek / 7) }} KDA ~ {{ beautifyValue(superUSDKDARewardWeek / 7) }} USD

-

{{ beautifyValue((superUSDRewardWeek / 7) + (superUSDKDARewardWeek / 7)) }} USD

-

-

per week

-

{{ beautifyValue(superWeek) }} FLUX ~ {{ beautifyValue(superUSDRewardWeek) }} USD

-

{{ beautifyValue(kdaNimbusWeek) }} KDA ~ {{ beautifyValue(superUSDKDARewardWeek) }} USD

-

{{ beautifyValue((superUSDRewardWeek) + (superUSDKDARewardWeek)) }} USD

-

-

per month

-

{{ beautifyValue(superWeek * 4.34812141) }} FLUX ~ {{ beautifyValue(superUSDRewardWeek * 4.34812141) }} USD

-

{{ beautifyValue(kdaNimbusWeek * 4.34812141) }} KDA ~ {{ beautifyValue(superUSDKDARewardWeek * 4.34812141) }} USD

-

{{ beautifyValue((superUSDRewardWeek * 4.34812141) + (superUSDKDARewardWeek * 4.34812141)) }} USD

-

-

Profitability per month - Node Cost 6 USD

-

Node only: {{ beautifyValue(superUSDRewardWeek * 4.34812141 - 6) }} USD

-

With KDA: {{ beautifyValue((superUSDRewardWeek * 4.34812141) + (superUSDKDARewardWeek * 4.34812141) - 6) }} USD

-
-
-
-

Stratus Rewards

-

-

per day

-

{{ beautifyValue(bamfWeek / 7 ) }} FLUX ~ {{ beautifyValue(bamfUSDRewardWeek / 7) }} USD

-

{{ beautifyValue(kdaStratusWeek / 7 ) }} KDA ~ {{ beautifyValue(bamfUSDKDARewardWeek / 7) }} USD

-

{{ beautifyValue((bamfUSDRewardWeek / 7) + (bamfUSDKDARewardWeek / 7)) }} USD

-

-

per week

-

{{ beautifyValue(bamfWeek) }} FLUX ~ {{ beautifyValue(bamfUSDRewardWeek) }} USD

-

{{ beautifyValue(kdaStratusWeek ) }} KDA ~ {{ beautifyValue(bamfUSDKDARewardWeek) }} USD

-

{{ beautifyValue((bamfUSDRewardWeek) + (bamfUSDKDARewardWeek)) }} USD

-

-

per month

-

{{ beautifyValue(bamfWeek * 4.34812141) }} FLUX ~ {{ beautifyValue(bamfUSDRewardWeek * 4.34812141) }} USD

-

{{ beautifyValue(kdaStratusWeek * 4.34812141) }} KDA ~ {{ beautifyValue(bamfUSDKDARewardWeek * 4.34812141) }} USD

-

{{ beautifyValue((bamfUSDRewardWeek * 4.34812141) + (bamfUSDKDARewardWeek * 4.34812141)) }} USD

-

-

Profitability per month - Node Cost 32 USD

-

Node only: {{ beautifyValue(bamfUSDRewardWeek * 4.34812141 - 32) }} USD

-

With KDA: {{ beautifyValue((bamfUSDRewardWeek * 4.34812141) + (bamfUSDKDARewardWeek * 4.34812141) - 18.1) }} USD

-
-
-
-

-

Rewards Until April 10th (Miners 75%/25% Flux Nodes)

-

Cumulus Rewards



per day

-

{{ beautifyValue(beforeForkbasicWeek / 7 ) }} FLUX

-

{{ beautifyValue(beforeForkbasicUSDRewardWeek / 7) }} USD

+

{{ beautifyValue(cumulusWeek / 7 ) }} FLUX

+

{{ beautifyValue(cumulusUSDRewardWeek / 7) }} USD

No KDA available



per week

-

{{ beautifyValue(beforeForkbasicWeek) }} FLUX

-

{{ beautifyValue(beforeForkbasicUSDRewardWeek) }} USD

+

{{ beautifyValue(cumulusWeek) }} FLUX

+

{{ beautifyValue(cumulusUSDRewardWeek) }} USD

No KDA available



per month

-

{{ beautifyValue(beforeForkbasicWeek * 4.34812141) }} FLUX

-

{{ beautifyValue(beforeForkbasicUSDRewardWeek * 4.34812141) }} USD

+

{{ beautifyValue(cumulusWeek * 4.34812141) }} FLUX

+

{{ beautifyValue(cumulusUSDRewardWeek * 4.34812141) }} USD

No KDA available



Profitability per month - Node Cost 4.70 USD

-

Node only: {{ beautifyValue(beforeForkbasicUSDRewardWeek * 4.34812141 - 4.70) }} USD

+

Node only: {{ beautifyValue(cumulusUSDRewardWeek * 4.34812141 - 4.70) }} USD

No KDA available


@@ -244,46 +168,46 @@

Nimbus Rewards



per day

-

{{ beautifyValue(beforeForksuperWeek / 7) }} FLUX ~ {{ beautifyValue(beforeForksuperUSDRewardWeek / 7) }} USD

-

{{ beautifyValue(kdaNimbusWeek / 7) }} KDA ~ {{ beautifyValue(superUSDKDARewardWeek / 7) }} USD

-

{{ beautifyValue((beforeForksuperUSDRewardWeek / 7) + (superUSDKDARewardWeek / 7)) }} USD

+

{{ beautifyValue(nimbusWeek / 7) }} FLUX ~ {{ beautifyValue(nimbusUSDRewardWeek / 7) }} USD

+

{{ beautifyValue(kdaNimbusWeek / 7) }} KDA ~ {{ beautifyValue(nimbusUSDKDARewardWeek / 7) }} USD

+

{{ beautifyValue((nimbusUSDRewardWeek / 7) + (nimbusUSDKDARewardWeek / 7)) }} USD



per week

-

{{ beautifyValue(beforeForksuperWeek) }} FLUX ~ {{ beautifyValue(beforeForksuperUSDRewardWeek) }} USD

-

{{ beautifyValue(kdaNimbusWeek) }} KDA ~ {{ beautifyValue(superUSDKDARewardWeek) }} USD

-

{{ beautifyValue((beforeForksuperUSDRewardWeek) + (superUSDKDARewardWeek)) }} USD

+

{{ beautifyValue(nimbusWeek) }} FLUX ~ {{ beautifyValue(nimbusUSDRewardWeek) }} USD

+

{{ beautifyValue(kdaNimbusWeek) }} KDA ~ {{ beautifyValue(nimbusUSDKDARewardWeek) }} USD

+

{{ beautifyValue((nimbusUSDRewardWeek) + (nimbusUSDKDARewardWeek)) }} USD



per month

-

{{ beautifyValue(beforeForksuperWeek * 4.34812141) }} FLUX ~ {{ beautifyValue(beforeForksuperUSDRewardWeek * 4.34812141) }} USD

-

{{ beautifyValue(kdaNimbusWeek * 4.34812141) }} KDA ~ {{ beautifyValue(superUSDKDARewardWeek * 4.34812141) }} USD

-

{{ beautifyValue((beforeForksuperUSDRewardWeek * 4.34812141) + (superUSDKDARewardWeek * 4.34812141)) }} USD

+

{{ beautifyValue(nimbusWeek * 4.34812141) }} FLUX ~ {{ beautifyValue(nimbusUSDRewardWeek * 4.34812141) }} USD

+

{{ beautifyValue(kdaNimbusWeek * 4.34812141) }} KDA ~ {{ beautifyValue(nimbusUSDKDARewardWeek * 4.34812141) }} USD

+

{{ beautifyValue((nimbusUSDRewardWeek * 4.34812141) + (nimbusUSDKDARewardWeek * 4.34812141)) }} USD



Profitability per month - Node Cost 6 USD

-

Node only: {{ beautifyValue(beforeForksuperUSDRewardWeek * 4.34812141 - 6) }} USD

-

With KDA: {{ beautifyValue((beforeForksuperUSDRewardWeek * 4.34812141) + (superUSDKDARewardWeek * 4.34812141) - 6) }} USD

+

Node only: {{ beautifyValue(nimbusUSDRewardWeek * 4.34812141 - 6) }} USD

+

With KDA: {{ beautifyValue((nimbusUSDRewardWeek * 4.34812141) + (nimbusUSDKDARewardWeek * 4.34812141) - 6) }} USD


Stratus Rewards



per day

-

{{ beautifyValue(beforeForkbamfWeek / 7 ) }} FLUX ~ {{ beautifyValue(beforeForkbamfUSDRewardWeek / 7) }} USD

-

{{ beautifyValue(kdaStratusWeek / 7 ) }} KDA ~ {{ beautifyValue(bamfUSDKDARewardWeek / 7) }} USD

-

{{ beautifyValue((beforeForkbamfUSDRewardWeek / 7) + (bamfUSDKDARewardWeek / 7)) }} USD

+

{{ beautifyValue(stratusWeek / 7 ) }} FLUX ~ {{ beautifyValue(stratusUSDRewardWeek / 7) }} USD

+

{{ beautifyValue(kdaStratusWeek / 7 ) }} KDA ~ {{ beautifyValue(stratusUSDKDARewardWeek / 7) }} USD

+

{{ beautifyValue((stratusUSDRewardWeek / 7) + (stratusUSDKDARewardWeek / 7)) }} USD



per week

-

{{ beautifyValue(beforeForkbamfWeek) }} FLUX ~ {{ beautifyValue(beforeForkbamfUSDRewardWeek) }} USD

-

{{ beautifyValue(kdaStratusWeek ) }} KDA ~ {{ beautifyValue(bamfUSDKDARewardWeek) }} USD

-

{{ beautifyValue((beforeForkbamfUSDRewardWeek) + (bamfUSDKDARewardWeek)) }} USD

+

{{ beautifyValue(stratusWeek) }} FLUX ~ {{ beautifyValue(stratusUSDRewardWeek) }} USD

+

{{ beautifyValue(kdaStratusWeek ) }} KDA ~ {{ beautifyValue(stratusUSDKDARewardWeek) }} USD

+

{{ beautifyValue((stratusUSDRewardWeek) + (stratusUSDKDARewardWeek)) }} USD



per month

-

{{ beautifyValue(beforeForkbamfWeek * 4.34812141) }} FLUX ~ {{ beautifyValue(beforeForkbamfUSDRewardWeek * 4.34812141) }} USD

-

{{ beautifyValue(kdaStratusWeek * 4.34812141) }} KDA ~ {{ beautifyValue(bamfUSDKDARewardWeek * 4.34812141) }} USD

-

{{ beautifyValue((beforeForkbamfUSDRewardWeek * 4.34812141) + (bamfUSDKDARewardWeek * 4.34812141)) }} USD

+

{{ beautifyValue(stratusWeek * 4.34812141) }} FLUX ~ {{ beautifyValue(stratusUSDRewardWeek * 4.34812141) }} USD

+

{{ beautifyValue(kdaStratusWeek * 4.34812141) }} KDA ~ {{ beautifyValue(stratusUSDKDARewardWeek * 4.34812141) }} USD

+

{{ beautifyValue((stratusUSDRewardWeek * 4.34812141) + (stratusUSDKDARewardWeek * 4.34812141)) }} USD



Profitability per month - Node Cost 32 USD

-

Node only: {{ beautifyValue(beforeForkbamfUSDRewardWeek * 4.34812141 - 32) }} USD

-

With KDA: {{ beautifyValue((beforeForkbamfUSDRewardWeek * 4.34812141) + (bamfUSDKDARewardWeek * 4.34812141) - 18.1) }} USD

+

Node only: {{ beautifyValue(stratusUSDRewardWeek * 4.34812141 - 32) }} USD

+

With KDA: {{ beautifyValue((stratusUSDRewardWeek * 4.34812141) + (stratusUSDKDARewardWeek * 4.34812141) - 18.1) }} USD


@@ -453,24 +377,16 @@ export default { ramHistoryLoading: true, cpuHistoryLoading: true, historicalPrices: [], - basicWeek: 0, - superWeek: 0, - bamfWeek: 0, - basicUSDRewardWeek: 0, - superUSDRewardWeek: 0, - bamfUSDRewardWeek: 0, - superUSDKDARewardWeek: 0, - bamfUSDKDARewardWeek: 0, + cumulusWeek: 0, + nimbusWeek: 0, + stratusWeek: 0, + cumulusUSDRewardWeek: 0, + nimbusUSDRewardWeek: 0, + stratusUSDRewardWeek: 0, + nimbusUSDKDARewardWeek: 0, + stratusUSDKDARewardWeek: 0, kdaNimbusWeek: 0, kdaStratusWeek: 0, - beforeForkbasicWeek: 0, - beforeForksuperWeek: 0, - beforeForkbamfWeek: 0, - beforeForkbasicUSDRewardWeek: 0, - beforeForksuperUSDRewardWeek: 0, - beforeForkbamfUSDRewardWeek: 0, - beforForkkdaNimbusWeek: 0, - beforForkkdaStratusWeek: 0, }; }, computed: { @@ -542,11 +458,11 @@ export default { try { const resCount = await DashboardService.zelnodeCount(); const counts = resCount.data.data; - const bamfs = counts['bamf-enabled'] || counts['stratus-enabled']; - const supers = counts['super-enabled'] || counts['nimbus-enabled']; - const basics = counts['basic-enabled'] || counts['cumulus-enabled']; + const stratuses = counts['bamf-enabled'] || counts['stratus-enabled']; + const nimbuses = counts['super-enabled'] || counts['nimbus-enabled']; + const cumuluses = counts['basic-enabled'] || counts['cumulus-enabled']; console.log(resCount); - const supply = bamfs * 100000 + supers * 25000 + basics * 10000; + const supply = stratuses * 100000 + nimbuses * 25000 + cumuluses * 10000; this.lockedSupply = supply; this.lockedSupplyPerc = Number(((supply / this.circulatingSupply) * 100).toFixed(2)); this.generateEconomics(counts); @@ -557,16 +473,16 @@ export default { async generateEconomics(zelnodecounts) { try { console.log(this.rates); - const bamfs = zelnodecounts['bamf-enabled'] || zelnodecounts['stratus-enabled']; - const supers = zelnodecounts['super-enabled'] || zelnodecounts['nimbus-enabled']; - const basics = zelnodecounts['basic-enabled'] || zelnodecounts['cumulus-enabled']; + const stratuses = zelnodecounts['bamf-enabled'] || zelnodecounts['stratus-enabled']; + const nimbuses = zelnodecounts['super-enabled'] || zelnodecounts['nimbus-enabled']; + const cumuluses = zelnodecounts['basic-enabled'] || zelnodecounts['cumulus-enabled']; const resKDAEligible = await axios.get('https://stats.runonflux.io/kadena/eligible/7'); const kdaData = resKDAEligible.data.data; const kdaCoins = 5749.77; - const supersS = kdaData.filter((result) => (result.tier === 'SUPER' || result.tier === 'NIMBUS')); - const bamfsS = kdaData.filter((result) => (result.tier === 'BAMF' || result.tier === 'STRATUS')); - const totalNimbuss = supersS.length; - const totalStratuss = bamfsS.length; + const nimbusesS = kdaData.filter((result) => (result.tier === 'SUPER' || result.tier === 'NIMBUS')); + const stratusesS = kdaData.filter((result) => (result.tier === 'BAMF' || result.tier === 'STRATUS')); + const totalNimbuss = nimbusesS.length; + const totalStratuss = stratusesS.length; const overallTotal = totalNimbuss + (4 * totalStratuss); const perNimbusWeek = Number((kdaCoins / overallTotal).toFixed(4)); // KDA const perStratusWeek = Number(((kdaCoins / overallTotal) * 4).toFixed(4)); // KDA @@ -574,60 +490,33 @@ export default { const perNimbusNode = 9.375; const perStratusNode = 22.5; // eslint-disable-next-line no-mixed-operators - const basicWeek = perCumulusNode * 720 * 7 / basics; + const cumulusWeek = perCumulusNode * 720 * 7 / cumuluses; // eslint-disable-next-line no-mixed-operators - const superWeek = perNimbusNode * 720 * 7 / supers; + const nimbusWeek = perNimbusNode * 720 * 7 / nimbuses; // eslint-disable-next-line no-mixed-operators - const bamfWeek = perStratusNode * 720 * 7 / bamfs; - const basicUSDReward = this.getFiatRate('ZEL') * perCumulusNode; // per one go - const superUSDReward = this.getFiatRate('ZEL') * perNimbusNode; // per one go - const bamfUSDReward = this.getFiatRate('ZEL') * perStratusNode; // per one go - const superUSDKDARewardWeek = this.getFiatRate('KDA') * perNimbusWeek; // per week - const bamfUSDKDARewardWeek = this.getFiatRate('KDA') * perStratusWeek; // per week + const stratusWeek = perStratusNode * 720 * 7 / stratuses; + const cumulusUSDReward = this.getFiatRate('ZEL') * perCumulusNode; // per one go + const nimbusUSDReward = this.getFiatRate('ZEL') * perNimbusNode; // per one go + const stratusUSDReward = this.getFiatRate('ZEL') * perStratusNode; // per one go + const nimbusUSDKDARewardWeek = this.getFiatRate('KDA') * perNimbusWeek; // per week + const stratusUSDKDARewardWeek = this.getFiatRate('KDA') * perStratusWeek; // per week // 720 blocks per day. // eslint-disable-next-line no-mixed-operators - const basicUSDRewardWeek = 7 * 720 * basicUSDReward / basics; + const cumulusUSDRewardWeek = 7 * 720 * cumulusUSDReward / cumuluses; // eslint-disable-next-line no-mixed-operators - const superUSDRewardWeek = 7 * 720 * superUSDReward / supers; + const nimbusUSDRewardWeek = 7 * 720 * nimbusUSDReward / nimbuses; // eslint-disable-next-line no-mixed-operators - const bamfUSDRewardWeek = 7 * 720 * bamfUSDReward / bamfs; - this.basicWeek = basicWeek; - this.superWeek = superWeek; - this.bamfWeek = bamfWeek; - this.basicUSDRewardWeek = basicUSDRewardWeek; - this.superUSDRewardWeek = superUSDRewardWeek; - this.bamfUSDRewardWeek = bamfUSDRewardWeek; - this.superUSDKDARewardWeek = superUSDKDARewardWeek; - this.bamfUSDKDARewardWeek = bamfUSDKDARewardWeek; + const stratusUSDRewardWeek = 7 * 720 * stratusUSDReward / stratuses; + this.cumulusWeek = cumulusWeek; + this.nimbusWeek = nimbusWeek; + this.stratusWeek = stratusWeek; + this.cumulusUSDRewardWeek = cumulusUSDRewardWeek; + this.nimbusUSDRewardWeek = nimbusUSDRewardWeek; + this.stratusUSDRewardWeek = stratusUSDRewardWeek; + this.nimbusUSDKDARewardWeek = nimbusUSDKDARewardWeek; + this.stratusUSDKDARewardWeek = stratusUSDKDARewardWeek; this.kdaNimbusWeek = perNimbusWeek; this.kdaStratusWeek = perStratusWeek; - - const beforeForkperCumulusNode = 2.8125; - const beforeForkperNimbusNode = 4.6875; - const beforeForkperStratusNode = 11.25; - // eslint-disable-next-line no-mixed-operators - const beforeForkbasicWeek = beforeForkperCumulusNode * 720 * 7 / basics; - // eslint-disable-next-line no-mixed-operators - const beforeForksuperWeek = beforeForkperNimbusNode * 720 * 7 / supers; - // eslint-disable-next-line no-mixed-operators - const beforeForkbamfWeek = beforeForkperStratusNode * 720 * 7 / bamfs; - const beforeForkbasicUSDReward = this.getFiatRate('ZEL') * beforeForkperCumulusNode; // per one go - const beforeForksuperUSDReward = this.getFiatRate('ZEL') * beforeForkperNimbusNode; // per one go - const beforeForkbamfUSDReward = this.getFiatRate('ZEL') * beforeForkperStratusNode; // per one go - // 720 blocks per day. - // eslint-disable-next-line no-mixed-operators - const beforeForkbasicUSDRewardWeek = 7 * 720 * beforeForkbasicUSDReward / basics; - // eslint-disable-next-line no-mixed-operators - const beforeForksuperUSDRewardWeek = 7 * 720 * beforeForksuperUSDReward / supers; - // eslint-disable-next-line no-mixed-operators - const beforeForkbamfUSDRewardWeek = 7 * 720 * beforeForkbamfUSDReward / bamfs; - this.beforeForkbasicWeek = beforeForkbasicWeek; - this.beforeForksuperWeek = beforeForksuperWeek; - this.beforeForkbamfWeek = beforeForkbamfWeek; - this.beforeForkbasicUSDRewardWeek = beforeForkbasicUSDRewardWeek; - this.beforeForksuperUSDRewardWeek = beforeForksuperUSDRewardWeek; - this.beforeForkbamfUSDRewardWeek = beforeForkbamfUSDRewardWeek; - const self = this; axios.get('https://api.coingecko.com/api/v3/coins/zelcash/market_chart?vs_currency=USD&days=30').then((res2) => { self.historicalPrices = res2.data.prices.filter((a) => a[0] > 1483232400000); // min date from January 1, 2017 1:00:00 AM @@ -747,29 +636,29 @@ export default { // Create chart instance const chart = am4core.create('cpucurrent', am4charts.XYChart); - const basics = this.fluxList.filter((nodes) => (nodes.tier === 'BASIC' || nodes.tier === 'CUMULUS')); - const supers = this.fluxList.filter((nodes) => (nodes.tier === 'SUPER' || nodes.tier === 'NIMBUS')); - const bamfs = this.fluxList.filter((nodes) => (nodes.tier === 'BAMF' || nodes.tier === 'STRATUS')); + const cumuluses = this.fluxList.filter((nodes) => (nodes.tier === 'BASIC' || nodes.tier === 'CUMULUS')); + const nimbuses = this.fluxList.filter((nodes) => (nodes.tier === 'SUPER' || nodes.tier === 'NIMBUS')); + const stratuses = this.fluxList.filter((nodes) => (nodes.tier === 'BAMF' || nodes.tier === 'STRATUS')); - const basicValue = basics.length * 2; - const superValue = supers.length * 4; - const bamfValue = bamfs.length * 8; + const cumulusValue = cumuluses.length * 2; + const nimbusValue = nimbuses.length * 4; + const stratusValus = stratuses.length * 8; - const total = bamfValue + superValue + basicValue; + const total = stratusValus + nimbusValue + cumulusValue; // Add data chart.data = [ { category: 'Cumulus', - value: basicValue, + value: cumulusValue, }, { category: 'Nimbus', - value: superValue, + value: nimbusValue, }, { category: 'Stratus', - value: bamfValue, + value: stratusValus, }, ]; @@ -805,29 +694,29 @@ export default { // Create chart instance const chart = am4core.create('ramcurrent', am4charts.XYChart); - const basics = this.fluxList.filter((nodes) => (nodes.tier === 'BASIC' || nodes.tier === 'CUMULUS')); - const supers = this.fluxList.filter((nodes) => (nodes.tier === 'SUPER' || nodes.tier === 'NIMBUS')); - const bamfs = this.fluxList.filter((nodes) => (nodes.tier === 'BAMF' || nodes.tier === 'STRATUS')); + const cumuluses = this.fluxList.filter((nodes) => (nodes.tier === 'BASIC' || nodes.tier === 'CUMULUS')); + const nimbuses = this.fluxList.filter((nodes) => (nodes.tier === 'SUPER' || nodes.tier === 'NIMBUS')); + const stratuses = this.fluxList.filter((nodes) => (nodes.tier === 'BAMF' || nodes.tier === 'STRATUS')); - const basicValue = basics.length * 4; - const superValue = supers.length * 8; - const bamfValue = bamfs.length * 30; + const cumulusValue = cumuluses.length * 4; + const nimbusValue = nimbuses.length * 8; + const stratusValus = stratuses.length * 30; - const total = bamfValue + superValue + basicValue; + const total = stratusValus + nimbusValue + cumulusValue; // Add data chart.data = [ { category: 'Cumulus', - value: basicValue, + value: cumulusValue, }, { category: 'Nimbus', - value: superValue, + value: nimbusValue, }, { category: 'Stratus', - value: bamfValue, + value: stratusValus, }, ]; @@ -863,29 +752,29 @@ export default { // Create chart instance const chart = am4core.create('ssdcurrent', am4charts.XYChart); - const basics = this.fluxList.filter((nodes) => (nodes.tier === 'BASIC' || nodes.tier === 'CUMULUS')); - const supers = this.fluxList.filter((nodes) => (nodes.tier === 'SUPER' || nodes.tier === 'NIMBUS')); - const bamfs = this.fluxList.filter((nodes) => (nodes.tier === 'BAMF' || nodes.tier === 'STRATUS')); + const cumuluses = this.fluxList.filter((nodes) => (nodes.tier === 'BASIC' || nodes.tier === 'CUMULUS')); + const nimbuses = this.fluxList.filter((nodes) => (nodes.tier === 'SUPER' || nodes.tier === 'NIMBUS')); + const stratuses = this.fluxList.filter((nodes) => (nodes.tier === 'BAMF' || nodes.tier === 'STRATUS')); - const basicValue = basics.length * 40; - const superValue = supers.length * 150; - const bamfValue = bamfs.length * 600; + const cumulusValue = cumuluses.length * 40; + const nimbusValue = nimbuses.length * 150; + const stratusValus = stratuses.length * 600; - const total = bamfValue + superValue + basicValue; + const total = stratusValus + nimbusValue + cumulusValue; // Add data chart.data = [ { category: 'Cumulus', - value: basicValue, + value: cumulusValue, }, { category: 'Nimbus', - value: superValue, + value: nimbusValue, }, { category: 'Stratus', - value: bamfValue, + value: stratusValus, }, ]; @@ -926,9 +815,9 @@ export default { timePoints.forEach((time) => { cpuData.push({ time: new Date(Number(time)), - bamf: this.fluxHistoryStats[time].bamf * 8, - super: this.fluxHistoryStats[time].super * 4, - basic: this.fluxHistoryStats[time].basic * 2, + stratus: (this.fluxHistoryStats[time].stratus || this.fluxHistoryStats[time].bamf) * 8, + nimbus: (this.fluxHistoryStats[time].nimbus || this.fluxHistoryStats[time].super) * 4, + cumulus: (this.fluxHistoryStats[time].cumulus || this.fluxHistoryStats[time].basic) * 2, }); }); @@ -943,7 +832,7 @@ export default { const series = chart.series.push(new am4charts.LineSeries()); series.name = 'Stratus'; series.dataFields.dateX = 'time'; - series.dataFields.valueY = 'bamf'; + series.dataFields.valueY = 'stratus'; series.tooltipText = 'Stratus [bold]{valueY.value}[/]'; series.tooltip.background.fill = am4core.color('#000'); series.tooltip.getStrokeFromObject = true; @@ -956,7 +845,7 @@ export default { const series2 = chart.series.push(new am4charts.LineSeries()); series2.name = 'Nimbus'; series2.dataFields.dateX = 'time'; - series2.dataFields.valueY = 'super'; + series2.dataFields.valueY = 'nimbus'; series2.tooltipText = 'Nimbus [bold]{valueY.value}[/]'; series2.tooltip.background.fill = am4core.color('#000'); series2.tooltip.getFillFromObject = false; @@ -970,7 +859,7 @@ export default { const series3 = chart.series.push(new am4charts.LineSeries()); series3.name = 'Cumulus'; series3.dataFields.dateX = 'time'; - series3.dataFields.valueY = 'basic'; + series3.dataFields.valueY = 'cumulus'; series3.tooltipText = 'Cumulus [bold]{valueY.value}[/]'; series3.tooltip.background.fill = am4core.color('#000'); series3.tooltip.getFillFromObject = false; @@ -1008,9 +897,9 @@ export default { timePoints.forEach((time) => { ramData.push({ time: new Date(Number(time)), - bamf: this.fluxHistoryStats[time].bamf * 30, - super: this.fluxHistoryStats[time].super * 8, - basic: this.fluxHistoryStats[time].basic * 4, + stratus: (this.fluxHistoryStats[time].stratus || this.fluxHistoryStats[time].bamf) * 32, + nimbus: (this.fluxHistoryStats[time].nimbus || this.fluxHistoryStats[time].super) * 8, + cumulus: (this.fluxHistoryStats[time].cumulus || this.fluxHistoryStats[time].basic) * 4, }); }); @@ -1024,7 +913,7 @@ export default { const series = chart.series.push(new am4charts.LineSeries()); series.name = 'Stratus'; series.dataFields.dateX = 'time'; - series.dataFields.valueY = 'bamf'; + series.dataFields.valueY = 'stratus'; series.tooltipText = 'Stratus [bold]{valueY.value}[/]'; series.tooltip.background.fill = am4core.color('#000'); series.tooltip.getStrokeFromObject = true; @@ -1037,7 +926,7 @@ export default { const series2 = chart.series.push(new am4charts.LineSeries()); series2.name = 'Nimbus'; series2.dataFields.dateX = 'time'; - series2.dataFields.valueY = 'super'; + series2.dataFields.valueY = 'nimbus'; series2.tooltipText = 'Nimbus [bold]{valueY.value}[/]'; series2.tooltip.background.fill = am4core.color('#000'); series2.tooltip.getFillFromObject = false; @@ -1051,7 +940,7 @@ export default { const series3 = chart.series.push(new am4charts.LineSeries()); series3.name = 'Cumulus'; series3.dataFields.dateX = 'time'; - series3.dataFields.valueY = 'basic'; + series3.dataFields.valueY = 'cumulus'; series3.tooltipText = 'Cumulus [bold]{valueY.value}[/]'; series3.tooltip.background.fill = am4core.color('#000'); series3.tooltip.getFillFromObject = false; @@ -1089,9 +978,9 @@ export default { timePoints.forEach((time) => { ssdData.push({ time: new Date(Number(time)), - bamf: this.fluxHistoryStats[time].bamf * 600, - super: this.fluxHistoryStats[time].super * 150, - basic: this.fluxHistoryStats[time].basic * 40, + stratus: (this.fluxHistoryStats[time].stratus || this.fluxHistoryStats[time].bamf) * 600, + nimbus: (this.fluxHistoryStats[time].nimbus || this.fluxHistoryStats[time].super) * 150, + cumulus: (this.fluxHistoryStats[time].cumulus || this.fluxHistoryStats[time].basic) * 40, }); }); @@ -1105,7 +994,7 @@ export default { const series = chart.series.push(new am4charts.LineSeries()); series.name = 'Stratus'; series.dataFields.dateX = 'time'; - series.dataFields.valueY = 'bamf'; + series.dataFields.valueY = 'stratus'; series.tooltipText = 'Stratus [bold]{valueY.value}[/]'; series.tooltip.background.fill = am4core.color('#000'); series.tooltip.getStrokeFromObject = true; @@ -1118,7 +1007,7 @@ export default { const series2 = chart.series.push(new am4charts.LineSeries()); series2.name = 'Nimbus'; series2.dataFields.dateX = 'time'; - series2.dataFields.valueY = 'super'; + series2.dataFields.valueY = 'nimbus'; series2.tooltipText = 'Nimbus [bold]{valueY.value}[/]'; series2.tooltip.background.fill = am4core.color('#000'); series2.tooltip.getFillFromObject = false; @@ -1132,7 +1021,7 @@ export default { const series3 = chart.series.push(new am4charts.LineSeries()); series3.name = 'Cumulus'; series3.dataFields.dateX = 'time'; - series3.dataFields.valueY = 'basic'; + series3.dataFields.valueY = 'cumulus'; series3.tooltipText = 'Cumulus [bold]{valueY.value}[/]'; series3.tooltip.background.fill = am4core.color('#000'); series3.tooltip.getFillFromObject = false; @@ -1170,9 +1059,9 @@ export default { timePoints.forEach((time) => { fluxData.push({ time: new Date(Number(time)), - bamf: this.fluxHistoryStats[time].bamf, - super: this.fluxHistoryStats[time].super, - basic: this.fluxHistoryStats[time].basic, + stratus: this.fluxHistoryStats[time].stratus || this.fluxHistoryStats[time].bamf, + nimbus: this.fluxHistoryStats[time].nimbus || this.fluxHistoryStats[time].super, + cumulus: this.fluxHistoryStats[time].cumulus || this.fluxHistoryStats[time].basic, }); }); @@ -1186,7 +1075,7 @@ export default { const series = chart.series.push(new am4charts.LineSeries()); series.name = 'Stratus'; series.dataFields.dateX = 'time'; - series.dataFields.valueY = 'bamf'; + series.dataFields.valueY = 'stratus'; series.tooltipText = 'Stratus [bold]{valueY.value}[/]'; series.tooltip.background.fill = am4core.color('#000'); series.tooltip.getStrokeFromObject = true; @@ -1199,7 +1088,7 @@ export default { const series2 = chart.series.push(new am4charts.LineSeries()); series2.name = 'Nimbus'; series2.dataFields.dateX = 'time'; - series2.dataFields.valueY = 'super'; + series2.dataFields.valueY = 'nimbus'; series2.tooltipText = 'Nimbus [bold]{valueY.value}[/]'; series2.tooltip.background.fill = am4core.color('#000'); series2.tooltip.getFillFromObject = false; @@ -1213,7 +1102,7 @@ export default { const series3 = chart.series.push(new am4charts.LineSeries()); series3.name = 'Cumulus'; series3.dataFields.dateX = 'time'; - series3.dataFields.valueY = 'basic'; + series3.dataFields.valueY = 'cumulus'; series3.tooltipText = 'Cumulus [bold]{valueY.value}[/]'; series3.tooltip.background.fill = am4core.color('#000'); series3.tooltip.getFillFromObject = false; @@ -1245,21 +1134,21 @@ export default { const timePoints = Object.keys(this.fluxHistoryStats); const max = Math.max(...timePoints); - const total = this.fluxHistoryStats[max].bamf + this.fluxHistoryStats[max].super + this.fluxHistoryStats[max].basic; + const total = (this.fluxHistoryStats[max].stratus + this.fluxHistoryStats[max].nimbus + this.fluxHistoryStats[max].cumulus) || (this.fluxHistoryStats[max].bamf + this.fluxHistoryStats[max].super + this.fluxHistoryStats[max].basic); // Add data chart.data = [ { type: 'Stratus', - value: this.fluxHistoryStats[max].bamf, + value: this.fluxHistoryStats[max].stratus || this.fluxHistoryStats[max].bamf, }, { type: 'Nimbus', - value: this.fluxHistoryStats[max].super, + value: this.fluxHistoryStats[max].nimbus || this.fluxHistoryStats[max].super, }, { type: 'Cumulus', - value: this.fluxHistoryStats[max].basic, + value: this.fluxHistoryStats[max].cumulus || this.fluxHistoryStats[max].basic, }, ]; @@ -1321,25 +1210,25 @@ export default { const timePoints = Object.keys(this.fluxHistoryStats); const max = Math.max(...timePoints); - const basicS = this.fluxHistoryStats[max].basic * 10000; - const superS = this.fluxHistoryStats[max].super * 25000; - const bamfS = this.fluxHistoryStats[max].bamf * 100000; + const cumulusS = (this.fluxHistoryStats[max].cumulus || this.fluxHistoryStats[max].basic) * 10000; + const nimbusS = (this.fluxHistoryStats[max].nimbus || this.fluxHistoryStats[max].super) * 25000; + const stratusS = (this.fluxHistoryStats[max].stratus || this.fluxHistoryStats[max].bamf) * 100000; - const total = basicS + superS + bamfS; + const total = cumulusS + nimbusS + stratusS; // Add data chart.data = [ { type: 'Stratus ', - value: bamfS, + value: stratusS, }, { type: 'Nimbus', - value: superS, + value: nimbusS, }, { type: 'Cumulus', - value: basicS, + value: cumulusS, }, ]; From 4826d5157916ca985389d65f39307d93eccf910c Mon Sep 17 00:00:00 2001 From: Tadeas Kmenta Date: Sat, 10 Apr 2021 09:19:10 +0800 Subject: [PATCH 2/8] fix total supply --- ZelFront/src/components/Dashboard.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZelFront/src/components/Dashboard.vue b/ZelFront/src/components/Dashboard.vue index cc4402f9d..0212223c2 100644 --- a/ZelFront/src/components/Dashboard.vue +++ b/ZelFront/src/components/Dashboard.vue @@ -59,7 +59,7 @@ class="supplyStats" >

Total Supply

-

{{ beautifyValue(210000000) }} FLUX

+

{{ beautifyValue(440000000) }} FLUX


Circulating Supply

{{ beautifyValue(this.circulatingSupply) }} FLUX

From c95943d6203dc55ae8d516007621ae0c8f0e9cc8 Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Wed, 14 Apr 2021 19:44:01 +0100 Subject: [PATCH 3/8] Removed References to ZelNode(s) on Front End --- ZelFront/src/components/Daemon.vue | 14 +++++++------- ZelFront/src/components/shared/Header.vue | 16 ++++++++-------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ZelFront/src/components/Daemon.vue b/ZelFront/src/components/Daemon.vue index a0b31d402..b36209731 100644 --- a/ZelFront/src/components/Daemon.vue +++ b/ZelFront/src/components/Daemon.vue @@ -222,10 +222,10 @@ - +
-

Output from Get ZelNode Status command

+

Output from Get FluxNode Status command

@@ -383,7 +383,7 @@

-

Output from Get ZelNode Count command

+

Output from Get FluxNode Count command

@@ -414,7 +414,7 @@

@@ -455,7 +455,7 @@
@@ -496,7 +496,7 @@

- Current ZelNode winners that will be paid in next Flux block + Current FluxNode winners that will be paid in next Flux block

- - Get ZelNode Status - List ZelNodes - View Deterministic ZelNode List - Get ZelNode Count + + Get FluxNode Status + List FluxNodes + View Deterministic FluxNode List + Get FluxNode Count Get Start List Get DOS List - ZelNode Current Winner + FluxNode Current Winner - + Get Benchmarks Get Info @@ -200,7 +200,7 @@ index="2-3-3" v-if="privilage === 'admin'" > - Sign ZelNode Transaction + Sign FluxNode Transaction Date: Wed, 14 Apr 2021 19:53:32 +0100 Subject: [PATCH 4/8] Change min requirements to consider that has enough peer connections made on Flux Network --- ZelBack/src/services/appsService.js | 10 +++++----- ZelBack/src/services/fluxCommunication.js | 6 ++---- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/ZelBack/src/services/appsService.js b/ZelBack/src/services/appsService.js index 7bb83a8f4..5a8f49774 100644 --- a/ZelBack/src/services/appsService.js +++ b/ZelBack/src/services/appsService.js @@ -3144,8 +3144,8 @@ async function registerAppGlobalyApi(req, res) { const errMessage = serviceHelper.errUnauthorizedMessage(); return res.json(errMessage); } - // first check if this node is available for application registration - has at least 5 outgoing connections and 2 incoming connections (that is sufficient as it means it is confirmed and works correctly) - if (fluxCommunication.outgoingPeers.length < config.fluxapps.minOutgoing || fluxCommunication.incomingPeers.length < config.fluxapps.minIncoming) { + // first check if this node is available for application registration - has at least 7 connections (that is sufficient as it means it is confirmed and works correctly) + if (fluxCommunication.outgoingPeers.length + fluxCommunication.incomingPeers.length < config.fluxapps.minOutgoing + config.fluxapps.minIncoming) { throw new Error('Sorry, This Flux does not have enough peers for safe application registration'); } const processedBody = serviceHelper.ensureObject(body); @@ -3375,9 +3375,9 @@ async function updateAppGlobalyApi(req, res) { const errMessage = serviceHelper.errUnauthorizedMessage(); return res.json(errMessage); } - // first check if this node is available for application update - has at least 5 outgoing connections and 2 incoming connections (that is sufficient as it means it is confirmed and works correctly) - if (fluxCommunication.outgoingPeers.length < config.fluxapps.minOutgoing || fluxCommunication.incomingPeers.length < config.fluxapps.minIncoming) { - throw new Error('Sorry, This Flux does not have enough peers for safe application update'); + // first check if this node is available for application update - has at least 7 connections (that is sufficient as it means it is confirmed and works correctly) + if (fluxCommunication.outgoingPeers.length + fluxCommunication.incomingPeers.length < config.fluxapps.minOutgoing + config.fluxapps.minIncoming) { + throw new Error('Sorry, This Flux does not have enough peers for safe application registration'); } const processedBody = serviceHelper.ensureObject(body); // Note. Actually signature, timestamp is not needed. But we require it only to verify that user indeed has access to the private key of the owner zelid. diff --git a/ZelBack/src/services/fluxCommunication.js b/ZelBack/src/services/fluxCommunication.js index e2d150aff..3286e2cc0 100644 --- a/ZelBack/src/services/fluxCommunication.js +++ b/ZelBack/src/services/fluxCommunication.js @@ -1323,10 +1323,8 @@ async function adjustFirewall() { function isCommunicationEstablished(req, res) { let message; - if (outgoingPeers.length < config.fluxapps.minOutgoing) { - message = serviceHelper.createErrorMessage('Not enough outgoing connections'); - } else if (incomingPeers.length < config.fluxapps.minIncoming) { - message = serviceHelper.createErrorMessage('Not enough incoming connections'); + if (outgoingPeers.length + incomingPeers.length < config.fluxapps.minOutgoing + config.fluxapps.minIncoming) { + message = serviceHelper.createErrorMessage('Not enough connections established to Flux network'); } else { message = serviceHelper.createSuccessMessage('Communication to Flux network is properly established'); } From ed085937bb74f69ddf73e4f610842a7a25eccc9b Mon Sep 17 00:00:00 2001 From: Cabecinha84 <42519726+Cabecinha84@users.noreply.github.com> Date: Wed, 14 Apr 2021 20:42:42 +0100 Subject: [PATCH 5/8] Final Changes of No Static IP Required --- ZelBack/src/services/daemonService.js | 9 +++++++++ ZelBack/src/services/fluxCommunication.js | 4 ++++ lib/daemonrpc/index.js | 1 + lib/zelcashrpc/index.js | 1 + 4 files changed, 15 insertions(+) diff --git a/ZelBack/src/services/daemonService.js b/ZelBack/src/services/daemonService.js index 3ad6e7bb9..e95f99a2a 100644 --- a/ZelBack/src/services/daemonService.js +++ b/ZelBack/src/services/daemonService.js @@ -2769,6 +2769,14 @@ async function fluxDaemonBlockchainInfo() { } } +async function createConfirmationTransaction(req, res) { + const rpccall = 'createconfirmationtransaction'; + + response = await executeCall(rpccall); + + return res ? res.json(response) : response; +} + function daemonBlockchainInfoService() { fluxDaemonBlockchainInfo(); setInterval(() => { @@ -2950,6 +2958,7 @@ module.exports = { zcRawReceive, // == available but DEPRECATED == zcRawReceivePost, // == available but DEPRECATED == zcSampleJoinSplit, + createConfirmationTransaction, // == Benchmarks == getBenchmarks, diff --git a/ZelBack/src/services/fluxCommunication.js b/ZelBack/src/services/fluxCommunication.js index 3286e2cc0..52d670313 100644 --- a/ZelBack/src/services/fluxCommunication.js +++ b/ZelBack/src/services/fluxCommunication.js @@ -1093,6 +1093,10 @@ async function checkMyFluxAvailability(nodelist) { dosState += 10; } 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); return; } } else { diff --git a/lib/daemonrpc/index.js b/lib/daemonrpc/index.js index 6c1694d36..9416a21ac 100644 --- a/lib/daemonrpc/index.js +++ b/lib/daemonrpc/index.js @@ -66,6 +66,7 @@ let zelcashMethods = [ 'getbenchstatus', 'getdoslist', 'getstartlist', + 'createconfirmationtransaction', // zelbench 'getstatus', 'restartnodebenchmarks', diff --git a/lib/zelcashrpc/index.js b/lib/zelcashrpc/index.js index 6c1694d36..9416a21ac 100644 --- a/lib/zelcashrpc/index.js +++ b/lib/zelcashrpc/index.js @@ -66,6 +66,7 @@ let zelcashMethods = [ 'getbenchstatus', 'getdoslist', 'getstartlist', + 'createconfirmationtransaction', // zelbench 'getstatus', 'restartnodebenchmarks', From caff34d848bc650f9149e977a482eb46f492217a Mon Sep 17 00:00:00 2001 From: XK4MiLX <62837435+XK4MiLX@users.noreply.github.com> Date: Thu, 22 Apr 2021 04:03:56 +0200 Subject: [PATCH 6/8] added fallocate --- ZelBack/src/services/appsService.js | 68 +++-------------------------- 1 file changed, 5 insertions(+), 63 deletions(-) diff --git a/ZelBack/src/services/appsService.js b/ZelBack/src/services/appsService.js index 5a8f49774..4fd5e512d 100644 --- a/ZelBack/src/services/appsService.js +++ b/ZelBack/src/services/appsService.js @@ -1233,30 +1233,19 @@ async function createAppVolume(appSpecifications, res) { try { const allocateSpace = { - status: 'Allocating space, this may take a while...', + status: 'Allocating space...', }; log.info(allocateSpace); if (res) { res.write(serviceHelper.ensureString(allocateSpace)); } - // space hdd * 10, thats why 0 at the end. As we have 100mb bs. - let execDD = `sudo dd if=/dev/zero of=${useThisVolume.mount}/${appId}FLUXFSVOL bs=107374182 count=${appSpecifications.hdd}0 status=progress`; // eg /mnt/sthMounted/zelappTEMP + + let execDD = `sudo fallocate -l ${appSpecifications.hdd}G ${useThisVolume.mount}/${appId}FLUXFSVOL`; // eg /mnt/sthMounted/zelappTEMP if (useThisVolume.mount === '/') { - execDD = `sudo dd if=/dev/zero of=${fluxDirPath}appvolumes/${appId}FLUXFSVOL bs=107374182 count=${appSpecifications.hdd}0 status=progress`; // if root mount then temp file is /tmp/zelappTEMP + execDD = `sudo fallocate -l ${appSpecifications.hdd}G ${fluxDirPath}appvolumes/${appId}FLUXFSVOL`; // if root mount then temp file is /tmp/zelappTEMP } - let iterationAlloc = 0; - global.allocationInterval = setInterval(() => { - iterationAlloc += 1; - const allocateSpaceB = { - status: `Space allocation is running for ${20 * iterationAlloc}s. This may take quite some time...`, - }; - log.info(allocateSpaceB); - if (res) { - res.write(serviceHelper.ensureString(allocateSpaceB)); - } - }, 20 * 1000); + await cmdAsync(execDD); - clearInterval(global.allocationInterval); const allocateSpace2 = { status: 'Space allocated', }; @@ -1322,52 +1311,6 @@ async function createAppVolume(appSpecifications, res) { res.write(serviceHelper.ensureString(mountingStatus2)); } - const spaceVerification = { - status: 'Beginning space verification. This may take a while...', - }; - log.info(spaceVerification); - if (res) { - res.write(serviceHelper.ensureString(spaceVerification)); - } - const execVerif = `sudo dd if=/dev/zero of=${appsFolder + appId}/${appId}VERTEMP bs=96636763 count=${appSpecifications.hdd}0 status=progress`; // 90% - let interationVerif = 0; - global.verificationInterval = setInterval(() => { - interationVerif += 1; - const spaceVerifB = { - status: `Space verification is running for ${20 * interationVerif}s. This may take quite some time...`, - }; - log.info(spaceVerifB); - if (res) { - res.write(serviceHelper.ensureString(spaceVerifB)); - } - }, 20 * 1000); - await cmdAsync(execVerif); - clearInterval(global.verificationInterval); - const spaceVerification2 = { - status: 'Verification written...', - }; - log.info(spaceVerification2); - if (res) { - res.write(serviceHelper.ensureString(spaceVerification2)); - } - - const finaliseSpace = { - status: 'Finalising space assignment', - }; - log.info(finaliseSpace); - if (res) { - res.write(serviceHelper.ensureString(finaliseSpace)); - } - const execFinal = `sudo rm -rf ${appsFolder + appId}/${appId}VERTEMP`; - await cmdAsync(execFinal); - const finaliseSpace2 = { - status: `Space for Flux App ${appSpecifications.name} created and assigned.`, - }; - log.info(finaliseSpace2); - if (res) { - res.write(serviceHelper.ensureString(finaliseSpace2)); - } - const cronStatus = { status: 'Creating crontab...', }; @@ -1436,7 +1379,6 @@ async function createAppVolume(appSpecifications, res) { throw error; } } - // force determines if some a check for app not found is skipped async function removeAppLocally(app, res, force = false, endResponse = true) { try { From 9a19a1098bc50da9b7329131037117c9712968de Mon Sep 17 00:00:00 2001 From: Tadeas Kmenta Date: Sat, 1 May 2021 21:05:10 +0800 Subject: [PATCH 7/8] for kadena 2.7 tests bump version --- ZelBack/src/services/appsService.js | 4 ++-- ZelBack/src/services/fluxService.js | 1 + package.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ZelBack/src/services/appsService.js b/ZelBack/src/services/appsService.js index 4fd5e512d..4dd98543b 100644 --- a/ZelBack/src/services/appsService.js +++ b/ZelBack/src/services/appsService.js @@ -2638,7 +2638,7 @@ 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: 'zelcash/kadena-chainweb-node:2.6', + repotag: 'zelcash/kadena-chainweb-node:development', // TODO use 2.7 owner: '1hjy4bCYBJr4mny4zCE85J94RXa8W6q37', ports: [30004, 30005], containerPorts: [30004, 30005], @@ -2650,7 +2650,7 @@ async function availableApps(req, res) { 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: 'localSpecificationsVersion7', // hash of app message + hash: 'localSpecificationsVersion8', // hash of app message height: 680000, // height of tx on which it was }, ]; diff --git a/ZelBack/src/services/fluxService.js b/ZelBack/src/services/fluxService.js index 02e598c6b..1ceede7fe 100644 --- a/ZelBack/src/services/fluxService.js +++ b/ZelBack/src/services/fluxService.js @@ -3,6 +3,7 @@ const path = require('path'); const config = require('config'); const fullnode = require('fullnode'); const fs = require('fs'); + const fsPromises = fs.promises; const log = require('../lib/log'); diff --git a/package.json b/package.json index ba62699be..460ce007f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flux", - "version": "1.14.0", + "version": "1.15.0", "description": "Flux, Your Gateway to a Decentralized World", "repository": { "type": "git", From ac52472a3237e832cdb80f79b0675b77f3803d4e Mon Sep 17 00:00:00 2001 From: Tadeas Kmenta Date: Sun, 2 May 2021 15:27:24 +0800 Subject: [PATCH 8/8] official image --- ZelBack/src/services/appsService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZelBack/src/services/appsService.js b/ZelBack/src/services/appsService.js index 4dd98543b..cc617c226 100644 --- a/ZelBack/src/services/appsService.js +++ b/ZelBack/src/services/appsService.js @@ -2638,7 +2638,7 @@ 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: 'zelcash/kadena-chainweb-node:development', // TODO use 2.7 + repotag: 'zelcash/kadena-chainweb-node:2.7', owner: '1hjy4bCYBJr4mny4zCE85J94RXa8W6q37', ports: [30004, 30005], containerPorts: [30004, 30005],