Merge branch 'master' of https://gitlab.com/epic-tech/explorer2.epic.tech-angular8
This commit is contained in:
commit
142b4ca714
@ -149,9 +149,9 @@ connection
|
|||||||
});
|
});
|
||||||
const io = require("socket.io").listen(server);
|
const io = require("socket.io").listen(server);
|
||||||
io.sockets.on("connection", socket => {
|
io.sockets.on("connection", socket => {
|
||||||
setInterval(function() {
|
// setInterval(function() {
|
||||||
universalGetLatestBlockDetails(socket);
|
// //universalGetLatestBlockDetails(socket);
|
||||||
},1000);
|
// },1000);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
@ -707,7 +707,7 @@ export class BlockchainBlockController {
|
|||||||
'SecondaryScaling',
|
'SecondaryScaling',
|
||||||
'Proof',
|
'Proof',
|
||||||
],
|
],
|
||||||
where: { Height: paramVal },
|
where: { Height: paramVal },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!BlockchainBlockFetchQuery) {
|
if (!BlockchainBlockFetchQuery) {
|
||||||
@ -741,27 +741,64 @@ export class BlockchainBlockController {
|
|||||||
// }
|
// }
|
||||||
BlockchainBlockFetchQuery['TotalCuckoo']=parseInt(BlockchainBlockFetchQuery.TotalDifficultyCuckaroo) +
|
BlockchainBlockFetchQuery['TotalCuckoo']=parseInt(BlockchainBlockFetchQuery.TotalDifficultyCuckaroo) +
|
||||||
parseInt(BlockchainBlockFetchQuery.TotalDifficultyCuckatoo);
|
parseInt(BlockchainBlockFetchQuery.TotalDifficultyCuckatoo);
|
||||||
if (BlockchainBlockFetchQuery.Height <= 1440) {
|
var coin_existence;
|
||||||
BlockchainBlockFetchQuery['BlockReward'] = 200;
|
let DAY_HEIGHT = 1440
|
||||||
} else if (BlockchainBlockFetchQuery.Height <= 2880) {
|
/// Height of the first epic block emission era
|
||||||
BlockchainBlockFetchQuery['BlockReward'] = 180;
|
const BLOCK_ERA_1 = DAY_HEIGHT * 334;
|
||||||
} else if (BlockchainBlockFetchQuery.Height <= 4320) {
|
/// Height of the second epic block emission era
|
||||||
BlockchainBlockFetchQuery['BlockReward'] = 160;
|
const BLOCK_ERA_2 = BLOCK_ERA_1 + (DAY_HEIGHT * 470);
|
||||||
} else if (BlockchainBlockFetchQuery.Height <= 5760) {
|
/// Height of the third epic block emission era
|
||||||
BlockchainBlockFetchQuery['BlockReward'] = 140;
|
const BLOCK_ERA_3 = BLOCK_ERA_2 + (DAY_HEIGHT * 601);
|
||||||
} else if (BlockchainBlockFetchQuery.Height <= 7200) {
|
/// Height of the fourth epic block emission era
|
||||||
BlockchainBlockFetchQuery['BlockReward'] = 120;
|
const BLOCK_ERA_4 = BLOCK_ERA_3 + (DAY_HEIGHT * 800);
|
||||||
} else if (BlockchainBlockFetchQuery.Height <= 8640) {
|
/// Height of the fifth epic block emission era
|
||||||
BlockchainBlockFetchQuery['BlockReward'] = 100;
|
const BLOCK_ERA_5 = BLOCK_ERA_4 + (DAY_HEIGHT * 1019);
|
||||||
} else if (BlockchainBlockFetchQuery.Height <= 10080) {
|
/// After the epic block emission era 6, each era will last 4 years (approximately 1460 days)
|
||||||
BlockchainBlockFetchQuery['BlockReward'] = 80;
|
const BLOCK_ERA_6_ONWARDS = DAY_HEIGHT * 1460;
|
||||||
} else if (BlockchainBlockFetchQuery.Height <= 11520) {
|
/// Block Reward that will be assigned after we change from era 5 to era 6.
|
||||||
BlockchainBlockFetchQuery['BlockReward'] = 60;
|
const BASE_REWARD_ERA_6_ONWARDS = 0.15625;
|
||||||
} else if (BlockchainBlockFetchQuery.Height <= 12960) {
|
/// Compute the total reward generated by each block in a given height.
|
||||||
BlockchainBlockFetchQuery['BlockReward'] = 50;
|
if(BlockchainBlockFetchQuery.Height == 0) {
|
||||||
} else {
|
BlockchainBlockFetchQuery['BlockReward'] = 0;
|
||||||
BlockchainBlockFetchQuery['BlockReward'] = 25;
|
}else if (BlockchainBlockFetchQuery.Height <= BLOCK_ERA_1) {
|
||||||
}
|
BlockchainBlockFetchQuery['BlockReward'] = 16;
|
||||||
|
} else if (BlockchainBlockFetchQuery.Height <= BLOCK_ERA_2) {
|
||||||
|
BlockchainBlockFetchQuery['BlockReward'] = 8;
|
||||||
|
} else if (BlockchainBlockFetchQuery.Height <= BLOCK_ERA_3) {
|
||||||
|
BlockchainBlockFetchQuery['BlockReward'] = 4;
|
||||||
|
} else if (BlockchainBlockFetchQuery.Height <= BLOCK_ERA_4) {
|
||||||
|
BlockchainBlockFetchQuery['BlockReward'] = 2;
|
||||||
|
} else if (BlockchainBlockFetchQuery.Height <= BLOCK_ERA_5) {
|
||||||
|
BlockchainBlockFetchQuery['BlockReward'] = 1;
|
||||||
|
} else {
|
||||||
|
// After the era 6, we reduce the block rewards by half each 1460 days.
|
||||||
|
// Minus 1 to include multiples in the same index
|
||||||
|
// (i.e changes greater than to greater or equals to)
|
||||||
|
let height_with_offset = BlockchainBlockFetchQuery.Height - (BLOCK_ERA_5 - 1);
|
||||||
|
let exp = height_with_offset / BLOCK_ERA_6_ONWARDS;
|
||||||
|
BlockchainBlockFetchQuery['BlockReward'] = BASE_REWARD_ERA_6_ONWARDS / (1 << exp);
|
||||||
|
}
|
||||||
|
// if (BlockchainBlockFetchQuery.Height <= 1440) {
|
||||||
|
// BlockchainBlockFetchQuery['BlockReward'] = 200;
|
||||||
|
// } else if (BlockchainBlockFetchQuery.Height <= 2880) {
|
||||||
|
// BlockchainBlockFetchQuery['BlockReward'] = 180;
|
||||||
|
// } else if (BlockchainBlockFetchQuery.Height <= 4320) {
|
||||||
|
// BlockchainBlockFetchQuery['BlockReward'] = 160;
|
||||||
|
// } else if (BlockchainBlockFetchQuery.Height <= 5760) {
|
||||||
|
// BlockchainBlockFetchQuery['BlockReward'] = 140;
|
||||||
|
// } else if (BlockchainBlockFetchQuery.Height <= 7200) {
|
||||||
|
// BlockchainBlockFetchQuery['BlockReward'] = 120;
|
||||||
|
// } else if (BlockchainBlockFetchQuery.Height <= 8640) {
|
||||||
|
// BlockchainBlockFetchQuery['BlockReward'] = 100;
|
||||||
|
// } else if (BlockchainBlockFetchQuery.Height <= 10080) {
|
||||||
|
// BlockchainBlockFetchQuery['BlockReward'] = 80;
|
||||||
|
// } else if (BlockchainBlockFetchQuery.Height <= 11520) {
|
||||||
|
// BlockchainBlockFetchQuery['BlockReward'] = 60;
|
||||||
|
// } else if (BlockchainBlockFetchQuery.Height <= 12960) {
|
||||||
|
// BlockchainBlockFetchQuery['BlockReward'] = 50;
|
||||||
|
// } else {
|
||||||
|
// BlockchainBlockFetchQuery['BlockReward'] = 25;
|
||||||
|
// }
|
||||||
|
|
||||||
if (BlockchainBlockFetchQuery.PreviousId) {
|
if (BlockchainBlockFetchQuery.PreviousId) {
|
||||||
const BlockchainPreviousBlockFetchQuery = await getRepository(
|
const BlockchainPreviousBlockFetchQuery = await getRepository(
|
||||||
@ -828,7 +865,7 @@ export class BlockchainBlockController {
|
|||||||
console.log('error', error);
|
console.log('error', error);
|
||||||
next(new InternalServerErrorException(error));
|
next(new InternalServerErrorException(error));
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
private BlockchainBlockUpdate = async (
|
private BlockchainBlockUpdate = async (
|
||||||
@ -1167,30 +1204,18 @@ export class BlockchainBlockController {
|
|||||||
var dateFormat = 'YYYY-MM-DD HH:mm:ss';
|
var dateFormat = 'YYYY-MM-DD HH:mm:ss';
|
||||||
var tickFormat = '%H-%M';
|
var tickFormat = '%H-%M';
|
||||||
}
|
}
|
||||||
if(Difftype == "target"){
|
if(Difftype == "target"){
|
||||||
var TotalDifficultyNBlockQuery = await getConnection()
|
|
||||||
.query(
|
|
||||||
"SELECT a.hash, a.tarket_difficulty, a.date FROM(select 1 as hash, (total_difficulty_"+alog_type+" - LAG(total_difficulty_"+alog_type+") OVER (ORDER BY total_difficulty_"+alog_type+")) AS tarket_difficulty, \
|
|
||||||
DATE_TRUNC('minute', timestamp at time zone '" +
|
|
||||||
process.env.TIME_ZONE +
|
|
||||||
"') as date \
|
|
||||||
from blockchain_block where " +
|
|
||||||
timeIntervalQry +
|
|
||||||
" order by height) as a WHERE a.tarket_difficulty IS NOT NULL",
|
|
||||||
)
|
|
||||||
.catch(err_msg => {
|
|
||||||
next(err_msg);
|
|
||||||
});
|
|
||||||
}else if(Difftype == "solution"){
|
|
||||||
var TotalDifficultyNBlockQuery = await getConnection()
|
var TotalDifficultyNBlockQuery = await getConnection()
|
||||||
.query(
|
.query(
|
||||||
"SELECT a.hash, a.tarket_difficulty, a.date FROM(select 1 as hash, (total_difficulty_"+alog_type+" - LAG(total_difficulty_"+alog_type+") OVER (ORDER BY total_difficulty_"+alog_type+")) AS tarket_difficulty, \
|
"SELECT a.hash, a.total_difficulty_randomx, a.total_difficulty_cuckatoo,a.total_difficulty_progpow, a.date FROM(select 1 as hash, (total_difficulty_cuckatoo - LAG(total_difficulty_cuckatoo) OVER (ORDER BY total_difficulty_cuckatoo)) AS total_difficulty_cuckatoo, \
|
||||||
|
(total_difficulty_progpow - LAG(total_difficulty_progpow) OVER (ORDER BY total_difficulty_progpow)) AS total_difficulty_progpow , \
|
||||||
|
(total_difficulty_randomx - LAG(total_difficulty_randomx) OVER (ORDER BY total_difficulty_randomx)) AS total_difficulty_randomx, \
|
||||||
DATE_TRUNC('minute', timestamp at time zone '" +
|
DATE_TRUNC('minute', timestamp at time zone '" +
|
||||||
process.env.TIME_ZONE +
|
process.env.TIME_ZONE +
|
||||||
"') as date \
|
"') as date \
|
||||||
from blockchain_block where " +
|
from blockchain_block where " +
|
||||||
timeIntervalQry +
|
timeIntervalQry +
|
||||||
" order by height) as a WHERE a.tarket_difficulty IS NOT NULL",
|
" order by height) as a WHERE a.total_difficulty_randomx IS NOT NULL AND a.total_difficulty_progpow IS NOT NULL AND a.total_difficulty_cuckatoo IS NOT NULL AND a.total_difficulty_cuckatoo != '0' AND a.total_difficulty_randomx != '0' AND a.total_difficulty_progpow != '0'",
|
||||||
)
|
)
|
||||||
.catch(err_msg => {
|
.catch(err_msg => {
|
||||||
next(err_msg);
|
next(err_msg);
|
||||||
@ -1198,7 +1223,7 @@ export class BlockchainBlockController {
|
|||||||
}else if(Difftype == "total"){
|
}else if(Difftype == "total"){
|
||||||
var TotalDifficultyNBlockQuery = await getConnection()
|
var TotalDifficultyNBlockQuery = await getConnection()
|
||||||
.query(
|
.query(
|
||||||
"select 1 as hash, total_difficulty_"+alog_type+" as tarket_difficulty, \
|
"select 1 as hash, total_difficulty_cuckatoo,total_difficulty_progpow,total_difficulty_randomx, \
|
||||||
DATE_TRUNC('minute', timestamp at time zone '" +
|
DATE_TRUNC('minute', timestamp at time zone '" +
|
||||||
process.env.TIME_ZONE +
|
process.env.TIME_ZONE +
|
||||||
"') as date \
|
"') as date \
|
||||||
@ -1209,45 +1234,71 @@ export class BlockchainBlockController {
|
|||||||
.catch(err_msg => {
|
.catch(err_msg => {
|
||||||
next(err_msg);
|
next(err_msg);
|
||||||
});
|
});
|
||||||
}else{
|
|
||||||
var TotalDifficultyNBlockQuery = await getConnection()
|
|
||||||
.query(
|
|
||||||
"SELECT a.hash, a.tarket_difficulty, a.date FROM(select 1 as hash, (total_difficulty_"+alog_type+" - LAG(total_difficulty_"+alog_type+") OVER (ORDER BY total_difficulty_"+alog_type+")) AS tarket_difficulty, \
|
|
||||||
DATE_TRUNC('minute', timestamp at time zone '" +
|
|
||||||
process.env.TIME_ZONE +
|
|
||||||
"') as date \
|
|
||||||
from blockchain_block where " +
|
|
||||||
timeIntervalQry +
|
|
||||||
" order by height) as a WHERE a.tarket_difficulty IS NOT NULL",
|
|
||||||
)
|
|
||||||
.catch(err_msg => {
|
|
||||||
next(err_msg);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
let date = [],
|
// let date = [],
|
||||||
//DifficultyCuckaroo = [],
|
// DifficultyCuckatoo = [],
|
||||||
//DifficultyCuckatoo = [],
|
// DifficultyProgpow = [],
|
||||||
//DifficultyProgpow = [],
|
// DifficultyRandomx = [];
|
||||||
//DifficultyRandomx = [];
|
|
||||||
|
|
||||||
TargetDifficulty = [];
|
var DifficultyCuckatoo = TotalDifficultyNBlockQuery.map(function (e) {
|
||||||
|
return parseInt(e.total_difficulty_cuckatoo);
|
||||||
TotalDifficultyNBlockQuery.forEach(e => {
|
|
||||||
//date.indexOf(moment(e.date).format('YYYY-MM-DD')) < 0 ?
|
|
||||||
date.push(moment(e.date).format(dateFormat));
|
|
||||||
// DifficultyCuckaroo.push(parseInt(e.total_difficulty_cuckaroo));
|
|
||||||
// DifficultyCuckatoo.push(parseInt(e.total_difficulty_cuckatoo));
|
|
||||||
// DifficultyProgpow.push(parseInt(e.total_difficulty_progpow));
|
|
||||||
// DifficultyRandomx.push(parseInt(e.total_difficulty_randomx));
|
|
||||||
TargetDifficulty.push(parseInt(e.tarket_difficulty));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var Maxrange = Math.max.apply(Math, TotalDifficultyNBlockQuery.map(function(o) { return o.tarket_difficulty; }));
|
var DifficultyProgpow = TotalDifficultyNBlockQuery.map(function (e) {
|
||||||
var Minrange = Math.min.apply(Math, TotalDifficultyNBlockQuery.map(function(o) { return o.tarket_difficulty; }));
|
return parseInt(e.total_difficulty_progpow);
|
||||||
if(Minrange != 0){
|
});
|
||||||
Minrange = (Minrange - (Minrange * 0.2));
|
|
||||||
}
|
var DifficultyRandomx = TotalDifficultyNBlockQuery.map(function (e) {
|
||||||
Maxrange = (Maxrange + (Maxrange * 0.2));
|
return parseInt(e.total_difficulty_randomx);
|
||||||
|
});
|
||||||
|
|
||||||
|
var date = TotalDifficultyNBlockQuery.map(function (e) {
|
||||||
|
return moment(e.date).format(dateFormat);
|
||||||
|
});
|
||||||
|
|
||||||
|
// TotalDifficultyNBlockQuery.forEach(e => {
|
||||||
|
// date.push(moment(e.date).format(dateFormat));
|
||||||
|
// DifficultyCuckatoo.push(parseInt(e.total_difficulty_cuckatoo));
|
||||||
|
// DifficultyProgpow.push(parseInt(e.total_difficulty_progpow));
|
||||||
|
// DifficultyRandomx.push(parseInt(e.total_difficulty_randomx));
|
||||||
|
// });
|
||||||
|
// var Maxrange;
|
||||||
|
// var Minrange;
|
||||||
|
// if(alog_type == "cuckatoo"){
|
||||||
|
// Maxrange = Math.max.apply(Math, DifficultyCuckatoo);
|
||||||
|
// Minrange = Math.min.apply(Math, DifficultyCuckatoo);
|
||||||
|
// if(Minrange != 0){
|
||||||
|
// Minrange = (Minrange - (Minrange * 0.2));
|
||||||
|
// }
|
||||||
|
// Maxrange = (Maxrange + (Maxrange * 0.2));
|
||||||
|
// }else if(alog_type == "progpow"){
|
||||||
|
// Maxrange = Math.max.apply(Math, DifficultyProgpow);
|
||||||
|
// Minrange = Math.min.apply(Math, DifficultyProgpow);
|
||||||
|
// if(Minrange != 0){
|
||||||
|
// Minrange = (Minrange - (Minrange * 0.2));
|
||||||
|
// }
|
||||||
|
// Maxrange = (Maxrange + (Maxrange * 0.2));
|
||||||
|
// }else if(alog_type == "randomx"){
|
||||||
|
// Maxrange = Math.max.apply(Math, DifficultyRandomx);
|
||||||
|
// Minrange = Math.min.apply(Math, DifficultyRandomx);
|
||||||
|
// if(Minrange != 0){
|
||||||
|
// Minrange = (Minrange - (Minrange * 0.2));
|
||||||
|
// }
|
||||||
|
// Maxrange = (Maxrange + (Maxrange * 0.2));
|
||||||
|
// }else{
|
||||||
|
// var Maxrange1 = Math.max.apply(Math, TotalDifficultyNBlockQuery.map(function(o) { return o.total_difficulty_cuckatoo; }));
|
||||||
|
// var Minrange1 = Math.min.apply(Math, TotalDifficultyNBlockQuery.map(function(o) { return o.total_difficulty_cuckatoo; }));
|
||||||
|
// var Maxrange2 = Math.max.apply(Math, TotalDifficultyNBlockQuery.map(function(o) { return o.total_difficulty_progpow; }));
|
||||||
|
// var Minrange2 = Math.min.apply(Math, TotalDifficultyNBlockQuery.map(function(o) { return o.total_difficulty_progpow; }));
|
||||||
|
// var Maxrange3 = Math.max.apply(Math, TotalDifficultyNBlockQuery.map(function(o) { return o.total_difficulty_randomx; }));
|
||||||
|
// var Minrange3 = Math.min.apply(Math, TotalDifficultyNBlockQuery.map(function(o) { return o.total_difficulty_randomx; }));
|
||||||
|
// Maxrange = Math.max(Maxrange1, Maxrange2, Maxrange3);
|
||||||
|
// Minrange = Math.min(Minrange1, Minrange2, Minrange3);
|
||||||
|
// if(Minrange != 0){
|
||||||
|
// Minrange = (Minrange - (Minrange * 0.2));
|
||||||
|
// }
|
||||||
|
// Maxrange = (Maxrange + (Maxrange * 0.2));
|
||||||
|
// }
|
||||||
|
|
||||||
// Minrange = parseInt(Minrange);
|
// Minrange = parseInt(Minrange);
|
||||||
// var Minrange2 = parseInt(Minrange * 0.3);
|
// var Minrange2 = parseInt(Minrange * 0.3);
|
||||||
@ -1257,12 +1308,11 @@ export class BlockchainBlockController {
|
|||||||
message: 'Difficulty and Blocks Data fetched Successfully',
|
message: 'Difficulty and Blocks Data fetched Successfully',
|
||||||
response: {
|
response: {
|
||||||
Date: date,
|
Date: date,
|
||||||
// DifficultyCuckaroo: DifficultyCuckaroo,
|
DifficultyCuckatoo: DifficultyCuckatoo,
|
||||||
// DifficultyCuckatoo: DifficultyCuckatoo,
|
DifficultyRandomx: DifficultyRandomx,
|
||||||
// DifficultyProgpow: DifficultyProgpow,
|
DifficultyProgpow: DifficultyProgpow,
|
||||||
Maxrange: Maxrange,
|
//Maxrange: Maxrange,
|
||||||
Minrange: Minrange,
|
//Minrange: Minrange,
|
||||||
TargetDifficulty: TargetDifficulty,
|
|
||||||
tickFormat: tickFormat
|
tickFormat: tickFormat
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -1552,83 +1602,128 @@ export class BlockchainBlockController {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let height = BlockchainLatestBlockQuery[0].height;
|
let height = BlockchainLatestBlockQuery[0].height;
|
||||||
|
var coin_existence;
|
||||||
|
// if (height > 12960) {
|
||||||
|
// var remain_block = height - 12960;
|
||||||
|
// var coin_existence =
|
||||||
|
// 1440 * 200 +
|
||||||
|
// 1440 * 180 +
|
||||||
|
// 1440 * 160 +
|
||||||
|
// 1440 * 140 +
|
||||||
|
// 1440 * 120 +
|
||||||
|
// 1440 * 100 +
|
||||||
|
// 1440 * 80 +
|
||||||
|
// 1440 * 60 +
|
||||||
|
// 1440 * 50 +
|
||||||
|
// 25 * remain_block;
|
||||||
|
// } else if (height > 11520) {
|
||||||
|
// var remain_block = height - 11520;
|
||||||
|
// var coin_existence =
|
||||||
|
// 1440 * 200 +
|
||||||
|
// 1440 * 180 +
|
||||||
|
// 1440 * 160 +
|
||||||
|
// 1440 * 140 +
|
||||||
|
// 1440 * 120 +
|
||||||
|
// 1440 * 100 +
|
||||||
|
// 1440 * 80 +
|
||||||
|
// 1440 * 60 +
|
||||||
|
// remain_block * 50;
|
||||||
|
// } else if (height > 10080) {
|
||||||
|
// var remain_block = height - 10080;
|
||||||
|
// var coin_existence =
|
||||||
|
// 1440 * 200 +
|
||||||
|
// 1440 * 180 +
|
||||||
|
// 1440 * 160 +
|
||||||
|
// 1440 * 140 +
|
||||||
|
// 1440 * 120 +
|
||||||
|
// 1440 * 100 +
|
||||||
|
// 1440 * 80 +
|
||||||
|
// remain_block * 60;
|
||||||
|
// } else if (height > 8640) {
|
||||||
|
// var remain_block = height - 8640;
|
||||||
|
// var coin_existence =
|
||||||
|
// 1440 * 200 +
|
||||||
|
// 1440 * 180 +
|
||||||
|
// 1440 * 160 +
|
||||||
|
// 1440 * 140 +
|
||||||
|
// 1440 * 120 +
|
||||||
|
// 1440 * 100 +
|
||||||
|
// remain_block * 80;
|
||||||
|
// } else if (height > 7200) {
|
||||||
|
// var remain_block = height - 7200;
|
||||||
|
// var coin_existence =
|
||||||
|
// 1440 * 200 +
|
||||||
|
// 1440 * 180 +
|
||||||
|
// 1440 * 160 +
|
||||||
|
// 1440 * 140 +
|
||||||
|
// 1440 * 120 +
|
||||||
|
// remain_block * 100;
|
||||||
|
// } else if (height > 5760) {
|
||||||
|
// var remain_block = height - 5760;
|
||||||
|
// var coin_existence =
|
||||||
|
// 1440 * 200 +
|
||||||
|
// 1440 * 180 +
|
||||||
|
// 1440 * 160 +
|
||||||
|
// 1440 * 140 +
|
||||||
|
// remain_block * 120;
|
||||||
|
// } else if (height > 4320) {
|
||||||
|
// var remain_block = height - 4320;
|
||||||
|
// var coin_existence =
|
||||||
|
// 1440 * 200 + 1440 * 180 + 1440 * 160 + remain_block * 140;
|
||||||
|
// } else if (height > 2880) {
|
||||||
|
// var remain_block = height - 2880;
|
||||||
|
// var coin_existence = 1440 * 200 + 1440 * 180 + remain_block * 160;
|
||||||
|
// } else if (height > 1440) {
|
||||||
|
// var remain_block = height - 1440;
|
||||||
|
// var coin_existence = 1440 * 200 + remain_block * 180;
|
||||||
|
// } else {
|
||||||
|
// var coin_existence = height * 200;
|
||||||
|
// }
|
||||||
|
|
||||||
|
let DAY_HEIGHT = 1440
|
||||||
|
/// Height of the first epic block emission era
|
||||||
|
const BLOCK_ERA_1 = DAY_HEIGHT * 334;
|
||||||
|
/// Height of the second epic block emission era
|
||||||
|
const BLOCK_ERA_2 = BLOCK_ERA_1 + (DAY_HEIGHT * 470);
|
||||||
|
/// Height of the third epic block emission era
|
||||||
|
const BLOCK_ERA_3 = BLOCK_ERA_2 + (DAY_HEIGHT * 601);
|
||||||
|
/// Height of the fourth epic block emission era
|
||||||
|
const BLOCK_ERA_4 = BLOCK_ERA_3 + (DAY_HEIGHT * 800);
|
||||||
|
/// Height of the fifth epic block emission era
|
||||||
|
const BLOCK_ERA_5 = BLOCK_ERA_4 + (DAY_HEIGHT * 1019);
|
||||||
|
/// After the epic block emission era 6, each era will last 4 years (approximately 1460 days)
|
||||||
|
const BLOCK_ERA_6_ONWARDS = DAY_HEIGHT * 1460;
|
||||||
|
/// Block Reward that will be assigned after we change from era 5 to era 6.
|
||||||
|
const BASE_REWARD_ERA_6_ONWARDS = 0.15625;
|
||||||
|
|
||||||
if (height > 12960) {
|
let remaining_height = 0;
|
||||||
var remain_block = height - 12960;
|
/// Compute the total reward generated by each block in a given height.
|
||||||
var coin_existence =
|
if (height <= BLOCK_ERA_1) {
|
||||||
1440 * 200 +
|
coin_existence = height * 16;
|
||||||
1440 * 180 +
|
} else if (height <= BLOCK_ERA_2) {
|
||||||
1440 * 160 +
|
remaining_height = height - BLOCK_ERA_1;
|
||||||
1440 * 140 +
|
coin_existence = (16 * BLOCK_ERA_1) + 8 * remaining_height;
|
||||||
1440 * 120 +
|
} else if (height <= BLOCK_ERA_3) {
|
||||||
1440 * 100 +
|
remaining_height = height - BLOCK_ERA_2;
|
||||||
1440 * 80 +
|
coin_existence = (16 * BLOCK_ERA_1) + (8 * BLOCK_ERA_2) + 4 * remaining_height;
|
||||||
1440 * 60 +
|
} else if (height <= BLOCK_ERA_4) {
|
||||||
1440 * 50 +
|
remaining_height = height - BLOCK_ERA_3;
|
||||||
25 * remain_block;
|
coin_existence = (16 * BLOCK_ERA_1) + (8 * BLOCK_ERA_2) + (4 * BLOCK_ERA_3) + 2 * remaining_height;
|
||||||
} else if (height > 11520) {
|
} else if (height <= BLOCK_ERA_5) {
|
||||||
var remain_block = height - 11520;
|
remaining_height = height - BLOCK_ERA_4;
|
||||||
var coin_existence =
|
coin_existence = (16 * BLOCK_ERA_1) + (8 * BLOCK_ERA_2) + (4 * BLOCK_ERA_3) + (2 * BLOCK_ERA_4) +1 * remaining_height;
|
||||||
1440 * 200 +
|
} else {
|
||||||
1440 * 180 +
|
// After the era 6, we reduce the block rewards by half each 1460 days.
|
||||||
1440 * 160 +
|
// Minus 1 to include multiples in the same index
|
||||||
1440 * 140 +
|
// (i.e changes greater than to greater or equals to)
|
||||||
1440 * 120 +
|
|
||||||
1440 * 100 +
|
let preious_circulation = (16 * BLOCK_ERA_1) + (8 * BLOCK_ERA_2) + (4 * BLOCK_ERA_3) + (2 * BLOCK_ERA_4) + (1 * BLOCK_ERA_5);
|
||||||
1440 * 80 +
|
|
||||||
1440 * 60 +
|
let height_with_offset = height - (BLOCK_ERA_5 - 1);
|
||||||
remain_block * 50;
|
let exp = height_with_offset / BLOCK_ERA_6_ONWARDS;
|
||||||
} else if (height > 10080) {
|
let reward_emission = BASE_REWARD_ERA_6_ONWARDS / (1 << exp);
|
||||||
var remain_block = height - 10080;
|
coin_existence = preious_circulation + reward_emission ;
|
||||||
var coin_existence =
|
}
|
||||||
1440 * 200 +
|
|
||||||
1440 * 180 +
|
|
||||||
1440 * 160 +
|
|
||||||
1440 * 140 +
|
|
||||||
1440 * 120 +
|
|
||||||
1440 * 100 +
|
|
||||||
1440 * 80 +
|
|
||||||
remain_block * 60;
|
|
||||||
} else if (height > 8640) {
|
|
||||||
var remain_block = height - 8640;
|
|
||||||
var coin_existence =
|
|
||||||
1440 * 200 +
|
|
||||||
1440 * 180 +
|
|
||||||
1440 * 160 +
|
|
||||||
1440 * 140 +
|
|
||||||
1440 * 120 +
|
|
||||||
1440 * 100 +
|
|
||||||
remain_block * 80;
|
|
||||||
} else if (height > 7200) {
|
|
||||||
var remain_block = height - 7200;
|
|
||||||
var coin_existence =
|
|
||||||
1440 * 200 +
|
|
||||||
1440 * 180 +
|
|
||||||
1440 * 160 +
|
|
||||||
1440 * 140 +
|
|
||||||
1440 * 120 +
|
|
||||||
remain_block * 100;
|
|
||||||
} else if (height > 5760) {
|
|
||||||
var remain_block = height - 5760;
|
|
||||||
var coin_existence =
|
|
||||||
1440 * 200 +
|
|
||||||
1440 * 180 +
|
|
||||||
1440 * 160 +
|
|
||||||
1440 * 140 +
|
|
||||||
remain_block * 120;
|
|
||||||
} else if (height > 4320) {
|
|
||||||
var remain_block = height - 4320;
|
|
||||||
var coin_existence =
|
|
||||||
1440 * 200 + 1440 * 180 + 1440 * 160 + remain_block * 140;
|
|
||||||
} else if (height > 2880) {
|
|
||||||
var remain_block = height - 2880;
|
|
||||||
var coin_existence = 1440 * 200 + 1440 * 180 + remain_block * 160;
|
|
||||||
} else if (height > 1440) {
|
|
||||||
var remain_block = height - 1440;
|
|
||||||
var coin_existence = 1440 * 200 + remain_block * 180;
|
|
||||||
} else {
|
|
||||||
var coin_existence = height * 200;
|
|
||||||
}
|
|
||||||
|
|
||||||
letest_block = this.dateDiff(BlockchainLatestBlockQuery[0].timestamp,true);
|
letest_block = this.dateDiff(BlockchainLatestBlockQuery[0].timestamp,true);
|
||||||
letest_block_num = letest_block; // "72"
|
letest_block_num = letest_block; // "72"
|
||||||
@ -1790,23 +1885,34 @@ export class BlockchainBlockController {
|
|||||||
} else {
|
} else {
|
||||||
var timeIntervalQry = "timestamp > current_date - interval '30 days'";
|
var timeIntervalQry = "timestamp > current_date - interval '30 days'";
|
||||||
}
|
}
|
||||||
|
let DAY_HEIGHT = 1440
|
||||||
|
/// Height of the first epic block emission era
|
||||||
|
const BLOCK_ERA_1 = DAY_HEIGHT * 334;
|
||||||
|
/// Height of the second epic block emission era
|
||||||
|
const BLOCK_ERA_2 = BLOCK_ERA_1 + (DAY_HEIGHT * 470);
|
||||||
|
/// Height of the third epic block emission era
|
||||||
|
const BLOCK_ERA_3 = BLOCK_ERA_2 + (DAY_HEIGHT * 601);
|
||||||
|
/// Height of the fourth epic block emission era
|
||||||
|
const BLOCK_ERA_4 = BLOCK_ERA_3 + (DAY_HEIGHT * 800);
|
||||||
|
/// Height of the fifth epic block emission era
|
||||||
|
const BLOCK_ERA_5 = BLOCK_ERA_4 + (DAY_HEIGHT * 1019);
|
||||||
|
/// After the epic block emission era 6, each era will last 4 years (approximately 1460 days)
|
||||||
|
const BLOCK_ERA_6_ONWARDS = DAY_HEIGHT * 1460;
|
||||||
|
/// Block Reward that will be assigned after we change from era 5 to era 6.
|
||||||
|
const BASE_REWARD_ERA_6_ONWARDS = 0.15625;
|
||||||
const BlockchainBlockPerSecondQuery = await getConnection()
|
const BlockchainBlockPerSecondQuery = await getConnection()
|
||||||
.query(
|
.query(
|
||||||
'select x.timestamp, SUM(x.reward) as total_reward_per_day \
|
'select x.timestamp, SUM(x.reward) as total_reward_per_day \
|
||||||
from (SELECT hash, height, CAST(timestamp AS DATE), \
|
from (SELECT DISTINCT height, hash, CAST(timestamp AS DATE), \
|
||||||
CASE \
|
CASE \
|
||||||
WHEN height <= 1440 THEN 200 \
|
WHEN height <= '+BLOCK_ERA_1+' THEN 16 \
|
||||||
WHEN height <= 2880 THEN 180 \
|
WHEN height <= '+BLOCK_ERA_2+' THEN 8 \
|
||||||
WHEN height <= 4320 THEN 160 \
|
WHEN height <= '+BLOCK_ERA_3+' THEN 4 \
|
||||||
WHEN height <= 5760 THEN 140 \
|
WHEN height <= '+BLOCK_ERA_4+' THEN 2 \
|
||||||
WHEN height <= 7200 THEN 120 \
|
WHEN height <= '+BLOCK_ERA_5+' THEN 1 \
|
||||||
WHEN height <= 8640 THEN 100 \
|
ELSE '+BASE_REWARD_ERA_6_ONWARDS+' / (1 << ((height - ('+BLOCK_ERA_5+'- 1))/'+BLOCK_ERA_6_ONWARDS+'))\
|
||||||
WHEN height <= 10080 THEN 80 \
|
|
||||||
WHEN height <= 11520 THEN 60 \
|
|
||||||
WHEN height <= 12960 THEN 50 \
|
|
||||||
ELSE 25 \
|
|
||||||
END AS reward \
|
END AS reward \
|
||||||
FROM blockchain_block where ' +
|
FROM blockchain_block where height > 0 AND ' +
|
||||||
timeIntervalQry +
|
timeIntervalQry +
|
||||||
') as x group by x.timestamp Order by x.timestamp ASC',
|
') as x group by x.timestamp Order by x.timestamp ASC',
|
||||||
)
|
)
|
||||||
@ -1814,6 +1920,28 @@ export class BlockchainBlockController {
|
|||||||
next(err_msg);
|
next(err_msg);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// Compute the total reward generated by each block in a given height.
|
||||||
|
// if (BlockchainBlockFetchQuery.Height <= BLOCK_ERA_1) {
|
||||||
|
// BlockchainBlockFetchQuery['BlockReward'] = 16;
|
||||||
|
// } else if (BlockchainBlockFetchQuery.Height <= BLOCK_ERA_2) {
|
||||||
|
// BlockchainBlockFetchQuery['BlockReward'] = 8;
|
||||||
|
// } else if (BlockchainBlockFetchQuery.Height <= BLOCK_ERA_3) {
|
||||||
|
// BlockchainBlockFetchQuery['BlockReward'] = 4;
|
||||||
|
// } else if (BlockchainBlockFetchQuery.Height <= BLOCK_ERA_4) {
|
||||||
|
// BlockchainBlockFetchQuery['BlockReward'] = 2;
|
||||||
|
// } else if (BlockchainBlockFetchQuery.Height <= BLOCK_ERA_5) {
|
||||||
|
// BlockchainBlockFetchQuery['BlockReward'] = 1;
|
||||||
|
// } else {
|
||||||
|
// // After the era 6, we reduce the block rewards by half each 1460 days.
|
||||||
|
// // Minus 1 to include multiples in the same index
|
||||||
|
// // (i.e changes greater than to greater or equals to)
|
||||||
|
// let height_with_offset = BlockchainBlockFetchQuery.Height - (BLOCK_ERA_5 - 1);
|
||||||
|
// let exp = height_with_offset / BLOCK_ERA_6_ONWARDS;
|
||||||
|
// BlockchainBlockFetchQuery['BlockReward'] = BASE_REWARD_ERA_6_ONWARDS / (1 << exp);
|
||||||
|
// }
|
||||||
|
|
||||||
let date = [],
|
let date = [],
|
||||||
total_reward_per_day = [],
|
total_reward_per_day = [],
|
||||||
addedreward = [],
|
addedreward = [],
|
||||||
|
@ -516,7 +516,7 @@ export class BlockchainKernelController {
|
|||||||
) => {
|
) => {
|
||||||
var self = this;
|
var self = this;
|
||||||
try {
|
try {
|
||||||
http.get('http://116.203.152.58:3413/v1/peers/connected',
|
http.get('http://116.203.152.58:13413/v1/peers/connected',
|
||||||
async (resp) => {
|
async (resp) => {
|
||||||
// console.log('resp resp respresp',resp);
|
// console.log('resp resp respresp',resp);
|
||||||
let data = '';
|
let data = '';
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
"EXPLORE_IT": "Entdecke",
|
"EXPLORE_IT": "Entdecke",
|
||||||
"VIEWALL": "Alle Diagramme anzeigen",
|
"VIEWALL": "Alle Diagramme anzeigen",
|
||||||
"BLOCKCHAIN_HEIGHT": "Blockchain Höhe",
|
"BLOCKCHAIN_HEIGHT": "Blockchain Höhe",
|
||||||
|
"LATEST_BLOCKS" : "Letzter Blocks",
|
||||||
"LATEST_BLOCK": "Letzter Block",
|
"LATEST_BLOCK": "Letzter Block",
|
||||||
"LATEST_BLOCK1": "Aktuelle Zielschwierigkeit",
|
"LATEST_BLOCK1": "Aktuelle Zielschwierigkeit",
|
||||||
"LATEST_BLOCK2": "Aktuelle Gesamtschwierigkeit",
|
"LATEST_BLOCK2": "Aktuelle Gesamtschwierigkeit",
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
"EXPLORE_IT": "Explore",
|
"EXPLORE_IT": "Explore",
|
||||||
"VIEWALL": "View All Charts",
|
"VIEWALL": "View All Charts",
|
||||||
"BLOCKCHAIN_HEIGHT": "Blockchain Height",
|
"BLOCKCHAIN_HEIGHT": "Blockchain Height",
|
||||||
|
"LATEST_BLOCKS" : "Latest Blocks",
|
||||||
"LATEST_BLOCK": "Latest Block",
|
"LATEST_BLOCK": "Latest Block",
|
||||||
"LATEST_BLOCK1": "Current Target Difficulty",
|
"LATEST_BLOCK1": "Current Target Difficulty",
|
||||||
"LATEST_BLOCK2": "Current Total Difficulty",
|
"LATEST_BLOCK2": "Current Total Difficulty",
|
||||||
|
@ -3,20 +3,20 @@ import { getConnection } from "typeorm";
|
|||||||
var moment = require("moment");
|
var moment = require("moment");
|
||||||
moment.updateLocale('en', {
|
moment.updateLocale('en', {
|
||||||
relativeTime: {
|
relativeTime: {
|
||||||
future: "in %s",
|
future: "in %s",
|
||||||
past: "%s ago",
|
past: "%s ago",
|
||||||
s: "seconds",
|
s: "seconds",
|
||||||
m: "1 minute",
|
m: "1 minute",
|
||||||
mm: "%d minutes",
|
mm: "%d minutes",
|
||||||
h: "1 hour",
|
h: "1 hour",
|
||||||
hh: "%d hours",
|
hh: "%d hours",
|
||||||
d: "1 day",
|
d: "1 day",
|
||||||
dd: "%d days",
|
dd: "%d days",
|
||||||
M: "1 month",
|
M: "1 month",
|
||||||
MM: "%d months",
|
MM: "%d months",
|
||||||
y: "1 year",
|
y: "1 year",
|
||||||
yy: "%d years"
|
yy: "%d years"
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function dateDiff(date2, insec = false) {
|
function dateDiff(date2, insec = false) {
|
||||||
@ -29,7 +29,7 @@ function dateDiff(date2, insec = false) {
|
|||||||
var enddayrnd = Math.round(enddaydif);
|
var enddayrnd = Math.round(enddaydif);
|
||||||
// if(enddayrnd < 1) {
|
// if(enddayrnd < 1) {
|
||||||
var time = convertMinsToHrmin(
|
var time = convertMinsToHrmin(
|
||||||
Math.abs(date2.getTime() - current_date.getTime()),insec
|
Math.abs(date2.getTime() - current_date.getTime()), insec
|
||||||
);
|
);
|
||||||
return time;
|
return time;
|
||||||
// } else if(enddayrnd == 1) {
|
// } else if(enddayrnd == 1) {
|
||||||
@ -40,9 +40,9 @@ function dateDiff(date2, insec = false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function convertMinsToHrmin(millseconds,insec) {
|
function convertMinsToHrmin(millseconds, insec) {
|
||||||
var seconds = Math.floor(millseconds / 1000);
|
var seconds = Math.floor(millseconds / 1000);
|
||||||
if(insec){
|
if (insec) {
|
||||||
let sec = Math.floor(millseconds / 1000);
|
let sec = Math.floor(millseconds / 1000);
|
||||||
return sec;
|
return sec;
|
||||||
}
|
}
|
||||||
@ -81,84 +81,129 @@ export async function universalGetLatestBlockDetails(socket) {
|
|||||||
"SELECT bb.timestamp,bb.proof,bb.height,bb.edge_bits,bb.hash,bb.secondary_scaling, bb.previous_id, bb.total_difficulty_cuckaroo, bb.total_difficulty_cuckatoo, bb.total_difficulty_progpow, bb.total_difficulty_randomx, COUNT(DISTINCT(bi.block_id)) AS input_count, COUNT(DISTINCT(bk.block_id)) AS kernel_count, COUNT(DISTINCT(bo.block_id)) AS output_count FROM blockchain_block bb LEFT JOIN blockchain_input bi ON bi.block_id = bb.hash LEFT JOIN blockchain_kernel bk ON bk.block_id = bb.hash LEFT JOIN blockchain_output bo ON bo.block_id = bb.hash group by bb.hash, bb.timestamp ORDER BY bb.timestamp DESC LIMIT 1");
|
"SELECT bb.timestamp,bb.proof,bb.height,bb.edge_bits,bb.hash,bb.secondary_scaling, bb.previous_id, bb.total_difficulty_cuckaroo, bb.total_difficulty_cuckatoo, bb.total_difficulty_progpow, bb.total_difficulty_randomx, COUNT(DISTINCT(bi.block_id)) AS input_count, COUNT(DISTINCT(bk.block_id)) AS kernel_count, COUNT(DISTINCT(bo.block_id)) AS output_count FROM blockchain_block bb LEFT JOIN blockchain_input bi ON bi.block_id = bb.hash LEFT JOIN blockchain_kernel bk ON bk.block_id = bb.hash LEFT JOIN blockchain_output bo ON bo.block_id = bb.hash group by bb.hash, bb.timestamp ORDER BY bb.timestamp DESC LIMIT 1");
|
||||||
const BlockchainPreviousBlockQuery = await getConnection().query(
|
const BlockchainPreviousBlockQuery = await getConnection().query(
|
||||||
"SELECT total_difficulty_cuckaroo, total_difficulty_cuckatoo, total_difficulty_progpow, total_difficulty_randomx FROM blockchain_block WHERE hash=" +
|
"SELECT total_difficulty_cuckaroo, total_difficulty_cuckatoo, total_difficulty_progpow, total_difficulty_randomx FROM blockchain_block WHERE hash=" +
|
||||||
"'" +
|
"'" +
|
||||||
BlockchainLatestBlockQuery[0].previous_id +
|
BlockchainLatestBlockQuery[0].previous_id +
|
||||||
"'"
|
"'"
|
||||||
);
|
);
|
||||||
let height = BlockchainLatestBlockQuery[0].height;
|
let height = BlockchainLatestBlockQuery[0].height;
|
||||||
|
|
||||||
if (height > 12960) {
|
// if (height > 12960) {
|
||||||
var remain_block = height - 12960;
|
// var remain_block = height - 12960;
|
||||||
var coin_existence =
|
// var coin_existence =
|
||||||
1440 * 200 +
|
// 1440 * 200 +
|
||||||
1440 * 180 +
|
// 1440 * 180 +
|
||||||
1440 * 160 +
|
// 1440 * 160 +
|
||||||
1440 * 140 +
|
// 1440 * 140 +
|
||||||
1440 * 120 +
|
// 1440 * 120 +
|
||||||
1440 * 100 +
|
// 1440 * 100 +
|
||||||
1440 * 80 +
|
// 1440 * 80 +
|
||||||
1440 * 60 +
|
// 1440 * 60 +
|
||||||
1440 * 50 +
|
// 1440 * 50 +
|
||||||
25 * remain_block;
|
// 25 * remain_block;
|
||||||
} else if (height > 11520) {
|
// } else if (height > 11520) {
|
||||||
var remain_block = height - 11520;
|
// var remain_block = height - 11520;
|
||||||
var coin_existence =
|
// var coin_existence =
|
||||||
1440 * 200 +
|
// 1440 * 200 +
|
||||||
1440 * 180 +
|
// 1440 * 180 +
|
||||||
1440 * 160 +
|
// 1440 * 160 +
|
||||||
1440 * 140 +
|
// 1440 * 140 +
|
||||||
1440 * 120 +
|
// 1440 * 120 +
|
||||||
1440 * 100 +
|
// 1440 * 100 +
|
||||||
1440 * 80 +
|
// 1440 * 80 +
|
||||||
1440 * 60 +
|
// 1440 * 60 +
|
||||||
remain_block * 50;
|
// remain_block * 50;
|
||||||
} else if (height > 10080) {
|
// } else if (height > 10080) {
|
||||||
var remain_block = height - 10080;
|
// var remain_block = height - 10080;
|
||||||
var coin_existence =
|
// var coin_existence =
|
||||||
1440 * 200 +
|
// 1440 * 200 +
|
||||||
1440 * 180 +
|
// 1440 * 180 +
|
||||||
1440 * 160 +
|
// 1440 * 160 +
|
||||||
1440 * 140 +
|
// 1440 * 140 +
|
||||||
1440 * 120 +
|
// 1440 * 120 +
|
||||||
1440 * 100 +
|
// 1440 * 100 +
|
||||||
1440 * 80 +
|
// 1440 * 80 +
|
||||||
remain_block * 60;
|
// remain_block * 60;
|
||||||
} else if (height > 8640) {
|
// } else if (height > 8640) {
|
||||||
var remain_block = height - 8640;
|
// var remain_block = height - 8640;
|
||||||
var coin_existence =
|
// var coin_existence =
|
||||||
1440 * 200 +
|
// 1440 * 200 +
|
||||||
1440 * 180 +
|
// 1440 * 180 +
|
||||||
1440 * 160 +
|
// 1440 * 160 +
|
||||||
1440 * 140 +
|
// 1440 * 140 +
|
||||||
1440 * 120 +
|
// 1440 * 120 +
|
||||||
1440 * 100 +
|
// 1440 * 100 +
|
||||||
remain_block * 80;
|
// remain_block * 80;
|
||||||
} else if (height > 7200) {
|
// } else if (height > 7200) {
|
||||||
var remain_block = height - 7200;
|
// var remain_block = height - 7200;
|
||||||
var coin_existence =
|
// var coin_existence =
|
||||||
1440 * 200 +
|
// 1440 * 200 +
|
||||||
1440 * 180 +
|
// 1440 * 180 +
|
||||||
1440 * 160 +
|
// 1440 * 160 +
|
||||||
1440 * 140 +
|
// 1440 * 140 +
|
||||||
1440 * 120 +
|
// 1440 * 120 +
|
||||||
remain_block * 100;
|
// remain_block * 100;
|
||||||
} else if (height > 5760) {
|
// } else if (height > 5760) {
|
||||||
var remain_block = height - 5760;
|
// var remain_block = height - 5760;
|
||||||
var coin_existence =
|
// var coin_existence =
|
||||||
1440 * 200 + 1440 * 180 + 1440 * 160 + 1440 * 140 + remain_block * 120;
|
// 1440 * 200 + 1440 * 180 + 1440 * 160 + 1440 * 140 + remain_block * 120;
|
||||||
} else if (height > 4320) {
|
// } else if (height > 4320) {
|
||||||
var remain_block = height - 4320;
|
// var remain_block = height - 4320;
|
||||||
var coin_existence =
|
// var coin_existence =
|
||||||
1440 * 200 + 1440 * 180 + 1440 * 160 + remain_block * 140;
|
// 1440 * 200 + 1440 * 180 + 1440 * 160 + remain_block * 140;
|
||||||
} else if (height > 2880) {
|
// } else if (height > 2880) {
|
||||||
var remain_block = height - 2880;
|
// var remain_block = height - 2880;
|
||||||
var coin_existence = 1440 * 200 + 1440 * 180 + remain_block * 160;
|
// var coin_existence = 1440 * 200 + 1440 * 180 + remain_block * 160;
|
||||||
} else if (height > 1440) {
|
// } else if (height > 1440) {
|
||||||
var remain_block = height - 1440;
|
// var remain_block = height - 1440;
|
||||||
var coin_existence = 1440 * 200 + remain_block * 180;
|
// var coin_existence = 1440 * 200 + remain_block * 180;
|
||||||
} else {
|
// } else {
|
||||||
var coin_existence = height * 200;
|
// var coin_existence = height * 200;
|
||||||
}
|
// }
|
||||||
|
var coin_existence;
|
||||||
|
let DAY_HEIGHT = 1440
|
||||||
|
/// Height of the first epic block emission era
|
||||||
|
const BLOCK_ERA_1 = DAY_HEIGHT * 334;
|
||||||
|
/// Height of the second epic block emission era
|
||||||
|
const BLOCK_ERA_2 = BLOCK_ERA_1 + (DAY_HEIGHT * 470);
|
||||||
|
/// Height of the third epic block emission era
|
||||||
|
const BLOCK_ERA_3 = BLOCK_ERA_2 + (DAY_HEIGHT * 601);
|
||||||
|
/// Height of the fourth epic block emission era
|
||||||
|
const BLOCK_ERA_4 = BLOCK_ERA_3 + (DAY_HEIGHT * 800);
|
||||||
|
/// Height of the fifth epic block emission era
|
||||||
|
const BLOCK_ERA_5 = BLOCK_ERA_4 + (DAY_HEIGHT * 1019);
|
||||||
|
/// After the epic block emission era 6, each era will last 4 years (approximately 1460 days)
|
||||||
|
const BLOCK_ERA_6_ONWARDS = DAY_HEIGHT * 1460;
|
||||||
|
/// Block Reward that will be assigned after we change from era 5 to era 6.
|
||||||
|
const BASE_REWARD_ERA_6_ONWARDS = 0.15625;
|
||||||
|
|
||||||
|
let remaining_height = 0;
|
||||||
|
/// Compute the total reward generated by each block in a given height.
|
||||||
|
if (height <= BLOCK_ERA_1) {
|
||||||
|
coin_existence = height * 16;
|
||||||
|
} else if (height <= BLOCK_ERA_2) {
|
||||||
|
remaining_height = height - BLOCK_ERA_1;
|
||||||
|
coin_existence = (16 * BLOCK_ERA_1) + 8 * remaining_height;
|
||||||
|
} else if (height <= BLOCK_ERA_3) {
|
||||||
|
remaining_height = height - BLOCK_ERA_2;
|
||||||
|
coin_existence = (16 * BLOCK_ERA_1) + (8 * BLOCK_ERA_2) + 4 * remaining_height;
|
||||||
|
} else if (height <= BLOCK_ERA_4) {
|
||||||
|
remaining_height = height - BLOCK_ERA_3;
|
||||||
|
coin_existence = (16 * BLOCK_ERA_1) + (8 * BLOCK_ERA_2) + (4 * BLOCK_ERA_3) + 2 * remaining_height;
|
||||||
|
} else if (height <= BLOCK_ERA_5) {
|
||||||
|
remaining_height = height - BLOCK_ERA_4;
|
||||||
|
coin_existence = (16 * BLOCK_ERA_1) + (8 * BLOCK_ERA_2) + (4 * BLOCK_ERA_3) + (2 * BLOCK_ERA_4) +1 * remaining_height;
|
||||||
|
} else {
|
||||||
|
// After the era 6, we reduce the block rewards by half each 1460 days.
|
||||||
|
// Minus 1 to include multiples in the same index
|
||||||
|
// (i.e changes greater than to greater or equals to)
|
||||||
|
|
||||||
|
let preious_circulation = (16 * BLOCK_ERA_1) + (8 * BLOCK_ERA_2) + (4 * BLOCK_ERA_3) + (2 * BLOCK_ERA_4) + (1 * BLOCK_ERA_5);
|
||||||
|
|
||||||
|
let height_with_offset = height - (BLOCK_ERA_5 - 1);
|
||||||
|
let exp = height_with_offset / BLOCK_ERA_6_ONWARDS;
|
||||||
|
let reward_emission = BASE_REWARD_ERA_6_ONWARDS / (1 << exp);
|
||||||
|
coin_existence = preious_circulation + reward_emission ;
|
||||||
|
}
|
||||||
|
|
||||||
letest_block = dateDiff(BlockchainLatestBlockQuery[0].timestamp, true);
|
letest_block = dateDiff(BlockchainLatestBlockQuery[0].timestamp, true);
|
||||||
letest_block_num = letest_block // "72"
|
letest_block_num = letest_block // "72"
|
||||||
@ -200,11 +245,11 @@ export async function universalGetLatestBlockDetails(socket) {
|
|||||||
BlockchainPreviousBlockQuery[0].total_difficulty_randomx;
|
BlockchainPreviousBlockQuery[0].total_difficulty_randomx;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(BlockchainLatestBlockQuery[0].proof == "RandomX"){
|
if (BlockchainLatestBlockQuery[0].proof == "RandomX") {
|
||||||
var Difficulty = targetdifficultyrandomx;
|
var Difficulty = targetdifficultyrandomx;
|
||||||
}else if(BlockchainLatestBlockQuery[0].proof == "ProgPow"){
|
} else if (BlockchainLatestBlockQuery[0].proof == "ProgPow") {
|
||||||
var Difficulty = targetdifficultyprogpow;
|
var Difficulty = targetdifficultyprogpow;
|
||||||
}else if(BlockchainLatestBlockQuery[0].proof == "Cuckoo" ){
|
} else if (BlockchainLatestBlockQuery[0].proof == "Cuckoo") {
|
||||||
var Difficulty = targetdifficultycuckatoo;
|
var Difficulty = targetdifficultycuckatoo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,9 +259,9 @@ export async function universalGetLatestBlockDetails(socket) {
|
|||||||
var TotalCuckoo =
|
var TotalCuckoo =
|
||||||
parseInt(BlockchainLatestBlockQuery[0].total_difficulty_cuckatoo) +
|
parseInt(BlockchainLatestBlockQuery[0].total_difficulty_cuckatoo) +
|
||||||
parseInt(BlockchainLatestBlockQuery[0].total_difficulty_cuckaroo);
|
parseInt(BlockchainLatestBlockQuery[0].total_difficulty_cuckaroo);
|
||||||
let balance = BlockchainLatestBlockQuery[0].hash.substring(2, 62);
|
let balance = BlockchainLatestBlockQuery[0].hash.substring(2, 62);
|
||||||
let arr = balance.match(/.{1,6}/g);
|
let arr = balance.match(/.{1,6}/g);
|
||||||
var hasharray = arr.map(i => '#' + i);
|
var hasharray = arr.map(i => '#' + i);
|
||||||
|
|
||||||
socket.emit("latestblockdetail", {
|
socket.emit("latestblockdetail", {
|
||||||
block_height,
|
block_height,
|
||||||
@ -230,7 +275,7 @@ export async function universalGetLatestBlockDetails(socket) {
|
|||||||
targetdifficultyprogpow,
|
targetdifficultyprogpow,
|
||||||
targetdifficultyrandomx,
|
targetdifficultyrandomx,
|
||||||
TotalCuckoo,
|
TotalCuckoo,
|
||||||
age : dateTimeDurationString,
|
age: dateTimeDurationString,
|
||||||
input_count: BlockchainLatestBlockQuery[0].input_count,
|
input_count: BlockchainLatestBlockQuery[0].input_count,
|
||||||
kernel_count: BlockchainLatestBlockQuery[0].kernel_count,
|
kernel_count: BlockchainLatestBlockQuery[0].kernel_count,
|
||||||
output_count: BlockchainLatestBlockQuery[0].output_count,
|
output_count: BlockchainLatestBlockQuery[0].output_count,
|
||||||
@ -238,8 +283,8 @@ export async function universalGetLatestBlockDetails(socket) {
|
|||||||
proof: BlockchainLatestBlockQuery[0].proof,
|
proof: BlockchainLatestBlockQuery[0].proof,
|
||||||
hasharray: hasharray,
|
hasharray: hasharray,
|
||||||
Difficulty: Difficulty,
|
Difficulty: Difficulty,
|
||||||
hashstart:BlockchainLatestBlockQuery[0].hash.slice(0, 2),
|
hashstart: BlockchainLatestBlockQuery[0].hash.slice(0, 2),
|
||||||
hashend:BlockchainLatestBlockQuery[0].hash.slice(62,64),
|
hashend: BlockchainLatestBlockQuery[0].hash.slice(62, 64),
|
||||||
TotalDifficultyCuckaroo:
|
TotalDifficultyCuckaroo:
|
||||||
BlockchainLatestBlockQuery[0].total_difficulty_cuckaroo,
|
BlockchainLatestBlockQuery[0].total_difficulty_cuckaroo,
|
||||||
TotalDifficultyCuckatoo:
|
TotalDifficultyCuckatoo:
|
||||||
|
@ -44,19 +44,20 @@
|
|||||||
<ul class="list-unstyled d-inline-block mb-0">
|
<ul class="list-unstyled d-inline-block mb-0">
|
||||||
<li class="nav-item dropdown">
|
<li class="nav-item dropdown">
|
||||||
<a
|
<a
|
||||||
class="nav-link dropdown-toggle bg-white"
|
class="nav-link dropdown-toggle bg-white"
|
||||||
id="navbarDropdown"
|
id="navbarDropdown"
|
||||||
role="button"
|
role="button"
|
||||||
data-toggle="dropdown"
|
data-toggle="dropdown"
|
||||||
aria-haspopup="true"
|
aria-haspopup="true"
|
||||||
aria-expanded="false"
|
aria-expanded="false"
|
||||||
>
|
>
|
||||||
TestNet
|
FlooNet
|
||||||
</a>
|
</a>
|
||||||
<div class="dropdown-menu net_dropdwn" aria-labelledby="navbarDropdown">
|
<div class="dropdown-menu net_dropdwn" aria-labelledby="navbarDropdown">
|
||||||
<a class="dropdown-item p-2 disabled" style="background-color: #00000024;" target = '_blank' href="#">MainNet</a
|
<a class="dropdown-item p-2 disabled" style="background-color: #00000024;" target = '_blank' href="#">MainNet</a
|
||||||
>
|
>
|
||||||
|
<a class="dropdown-item p-2 disabled" style="background-color: #00000024;" target = '_blank' href="#">TestNet</a
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -13,10 +13,12 @@
|
|||||||
|
|
||||||
<a class="nav-link dropdown-toggle bg-white" href="#" id="navbarDropdown" role="button"
|
<a class="nav-link dropdown-toggle bg-white" href="#" id="navbarDropdown" role="button"
|
||||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
TestNet
|
FlooNet
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div class="dropdown-menu net_dropdwn" aria-labelledby="navbarDropdown">
|
<div class="dropdown-menu net_dropdwn" aria-labelledby="navbarDropdown">
|
||||||
<a class="dropdown-item p-2 disabled" href="https://explorer2.epic.tech">MainNet</a>
|
<a class="dropdown-item p-2 disabled" href="#">TestNet</a>
|
||||||
|
<a class="dropdown-item p-2 disabled" href="#">MainNet</a>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -64,10 +66,12 @@
|
|||||||
|
|
||||||
<a class="nav-link dropdown-toggle bg-white" href="#" id="navbarDropdown" role="button"
|
<a class="nav-link dropdown-toggle bg-white" href="#" id="navbarDropdown" role="button"
|
||||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
TestNet
|
FlooNet
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div class="dropdown-menu net_dropdwn" aria-labelledby="navbarDropdown">
|
<div class="dropdown-menu net_dropdwn" aria-labelledby="navbarDropdown">
|
||||||
<a class="dropdown-item p-2 disabled" href="https://explorer2.epic.tech">MainNet</a>
|
<a class="dropdown-item p-2 disabled" href="#">TestNet</a>
|
||||||
|
<a class="dropdown-item p-2 disabled" href="#">MainNet</a>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -68,8 +68,8 @@
|
|||||||
<img src="assets/img/difficulty.png" height="60" />
|
<img src="assets/img/difficulty.png" height="60" />
|
||||||
</div>
|
</div>
|
||||||
<div class="d-inline-block align-middle ml-2">
|
<div class="d-inline-block align-middle ml-2">
|
||||||
<h6 class="">Target Difficulty<span class="view_txt">
|
<!-- <h6 class="">Target Difficulty<span class="view_txt">
|
||||||
{{(hashdata.BlockchainBlockFetchQuery.Proof == 'Cuckoo') ? (hashdata.BlockchainBlockFetchQuery.TargetDifficultyCuckatoo | number) : (hashdata.BlockchainBlockFetchQuery.Proof == 'RandomX') ? (hashdata.BlockchainBlockFetchQuery.TargetDifficultyRandomx | number) : (hashdata.BlockchainBlockFetchQuery.Proof == 'ProgPow') ? (hashdata.BlockchainBlockFetchQuery.TargetDifficultyProgpow | number) : 0}}</span></h6>
|
{{(hashdata.BlockchainBlockFetchQuery.Proof == 'Cuckoo') ? (hashdata.BlockchainBlockFetchQuery.TargetDifficultyCuckatoo | number) : (hashdata.BlockchainBlockFetchQuery.Proof == 'RandomX') ? (hashdata.BlockchainBlockFetchQuery.TargetDifficultyRandomx | number) : (hashdata.BlockchainBlockFetchQuery.Proof == 'ProgPow') ? (hashdata.BlockchainBlockFetchQuery.TargetDifficultyProgpow | number) : 0}}</span></h6> -->
|
||||||
<h6 class="">Total Difficulty<span class="view_txt">
|
<h6 class="">Total Difficulty<span class="view_txt">
|
||||||
{{(hashdata.BlockchainBlockFetchQuery.Proof == 'Cuckoo') ? (hashdata.BlockchainBlockFetchQuery.TotalDifficultyCuckatoo | number) : (hashdata.BlockchainBlockFetchQuery.Proof == 'RandomX') ? (hashdata.BlockchainBlockFetchQuery.TotalDifficultyRandomx | number) : (hashdata.BlockchainBlockFetchQuery.Proof == 'ProgPow') ? (hashdata.BlockchainBlockFetchQuery.TotalDifficultyProgpow | number) : 0}}</span></h6>
|
{{(hashdata.BlockchainBlockFetchQuery.Proof == 'Cuckoo') ? (hashdata.BlockchainBlockFetchQuery.TotalDifficultyCuckatoo | number) : (hashdata.BlockchainBlockFetchQuery.Proof == 'RandomX') ? (hashdata.BlockchainBlockFetchQuery.TotalDifficultyRandomx | number) : (hashdata.BlockchainBlockFetchQuery.Proof == 'ProgPow') ? (hashdata.BlockchainBlockFetchQuery.TotalDifficultyProgpow | number) : 0}}</span></h6>
|
||||||
</div>
|
</div>
|
||||||
|
@ -67,7 +67,10 @@
|
|||||||
|
|
||||||
<h2 class="chart_heading text-uppercase d-inline-block">
|
<h2 class="chart_heading text-uppercase d-inline-block">
|
||||||
{{chartType | translate}}</h2>
|
{{chartType | translate}}</h2>
|
||||||
<div class="day_filter" *ngIf="this.title=='Target Difficulty'">
|
<!-- <div class="day_filter" *ngIf="this.title=='Target Difficulty'">
|
||||||
|
<a href="JavaScript:void(0);" (click)="
|
||||||
|
ChartFromView('', '', comp.difficultyRange,'all'); selectedItem12 = 4
|
||||||
|
" id="4" #item124 [ngClass]="{ active: selectedItem12 == item124.id, txt_primay: true }">All</a>
|
||||||
<a href="JavaScript:void(0);" (click)="
|
<a href="JavaScript:void(0);" (click)="
|
||||||
ChartFromView('', '', comp.difficultyRange,'cuckatoo'); selectedItem12 = 1
|
ChartFromView('', '', comp.difficultyRange,'cuckatoo'); selectedItem12 = 1
|
||||||
" id="1" #item121 [ngClass]="{ active: selectedItem12 == item121.id, txt_primay: true }">Cuckoo</a>
|
" id="1" #item121 [ngClass]="{ active: selectedItem12 == item121.id, txt_primay: true }">Cuckoo</a>
|
||||||
@ -79,7 +82,9 @@
|
|||||||
" id="3" #item123 [ngClass]="{ active: selectedItem12 == item123.id, txt_primay: true }">RandomX</a>
|
" id="3" #item123 [ngClass]="{ active: selectedItem12 == item123.id, txt_primay: true }">RandomX</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="day_filter" *ngIf="this.title=='Total Difficulty'">
|
<div class="day_filter" *ngIf="this.title=='Total Difficulty'">
|
||||||
<a href="JavaScript:void(0);" (click)="
|
<a href="JavaScript:void(0);" (click)="
|
||||||
|
ChartFromView('', '', comp.TdifficultyRange,'cuckatoo'); selectedItem12 = 4
|
||||||
|
" id="4" #item124 [ngClass]="{ active: selectedItem12 == item124.id, txt_primay: true }">All</a> <a href="JavaScript:void(0);" (click)="
|
||||||
ChartFromView('', '', comp.TdifficultyRange,'cuckatoo'); selectedItem12 = 1
|
ChartFromView('', '', comp.TdifficultyRange,'cuckatoo'); selectedItem12 = 1
|
||||||
" id="1" #item121 [ngClass]="{ active: selectedItem12 == item121.id, txt_primay: true }">Cuckoo</a>
|
" id="1" #item121 [ngClass]="{ active: selectedItem12 == item121.id, txt_primay: true }">Cuckoo</a>
|
||||||
<a href="JavaScript:void(0);" (click)="
|
<a href="JavaScript:void(0);" (click)="
|
||||||
@ -88,32 +93,32 @@
|
|||||||
<a href="JavaScript:void(0);" (click)="
|
<a href="JavaScript:void(0);" (click)="
|
||||||
ChartFromView('', '', comp.TdifficultyRange,'randomx'); selectedItem12 = 3
|
ChartFromView('', '', comp.TdifficultyRange,'randomx'); selectedItem12 = 3
|
||||||
" id="3" #item123 [ngClass]="{ active: selectedItem12 == item123.id, txt_primay: true }">RandomX</a>
|
" id="3" #item123 [ngClass]="{ active: selectedItem12 == item123.id, txt_primay: true }">RandomX</a>
|
||||||
</div>
|
</div> -->
|
||||||
<epic-explorer-plotly *ngIf="hashdata.data" [data]="hashdata.data" [layout]="hashdata.layout">
|
<epic-explorer-plotly *ngIf="hashdata.data" [data]="hashdata.data" [layout]="hashdata.layout">
|
||||||
</epic-explorer-plotly>
|
</epic-explorer-plotly>
|
||||||
<div class="day_filter" *ngIf="this.title!='Transactions over time'">
|
<div class="day_filter" *ngIf="this.title!='Transactions over time'">
|
||||||
|
|
||||||
<a href="JavaScript:void(0);" *ngIf="this.title=='Total Difficulty' || this.title=='Target Difficulty' || this.title == 'Blocks'" (click)="
|
<a href="JavaScript:void(0);" *ngIf="this.title=='Total Difficulty' || this.title=='Target Difficulty' || this.title == 'Blocks'" (click)="
|
||||||
ChartFromView('', '', '1 day', comp.Type); selectedItem = 6; comp.difficultyRange = '1 day'
|
ChartFromView('', '', '1 day', comp.Type); selectedItem = 6; comp.difficultyRange = '1 day';comp.TdifficultyRange = '1 day'
|
||||||
" id="6" #item6 [ngClass]="{ active: selectedItem == item6.id, txt_primay: true }">1 Day</a>
|
" id="6" #item6 [ngClass]="{ active: selectedItem == item6.id, txt_primay: true }">1 Day</a>
|
||||||
<a href="JavaScript:void(0);" (click)="
|
<a href="JavaScript:void(0);" (click)="
|
||||||
ChartFromView('', '', '1 week', comp.Type); selectedItem = 1; comp.difficultyRange = '1 week'
|
ChartFromView('', '', '1 week', comp.Type); selectedItem = 1; comp.difficultyRange = '1 week';comp.TdifficultyRange = '1 week'
|
||||||
" id="1" #item1 [ngClass]="{ active: selectedItem == item1.id, txt_primay: true }">1
|
" id="1" #item1 [ngClass]="{ active: selectedItem == item1.id, txt_primay: true }">1
|
||||||
{{'home.WEEK' | translate}}</a>
|
{{'home.WEEK' | translate}}</a>
|
||||||
<a href="JavaScript:void(0);" (click)="
|
<a href="JavaScript:void(0);" (click)="
|
||||||
ChartFromView('', '', '15 days', comp.Type); selectedItem = 2; comp.difficultyRange = '15 days'
|
ChartFromView('', '', '15 days', comp.Type); selectedItem = 2; comp.difficultyRange = '15 days';comp.TdifficultyRange = '15 days'
|
||||||
" id="2" #item2 [ngClass]="{ active: selectedItem == item2.id, day15_txt: true }">15
|
" id="2" #item2 [ngClass]="{ active: selectedItem == item2.id, day15_txt: true }">15
|
||||||
{{'home.DAYS' | translate}}</a>
|
{{'home.DAYS' | translate}}</a>
|
||||||
<a href="JavaScript:void(0);" (click)="
|
<a href="JavaScript:void(0);" (click)="
|
||||||
ChartFromView('', '', '30 days', comp.Type); selectedItem = 3; comp.difficultyRange = '30 days'
|
ChartFromView('', '', '30 days', comp.Type); selectedItem = 3; comp.difficultyRange = '30 days';comp.TdifficultyRange = '30 days'
|
||||||
" id="3" #item3 [ngClass]="{ active: selectedItem == item3.id, day30_txt: true }">30
|
" id="3" #item3 [ngClass]="{ active: selectedItem == item3.id, day30_txt: true }">30
|
||||||
{{'home.DAYS' | translate}}</a>
|
{{'home.DAYS' | translate}}</a>
|
||||||
<a href="JavaScript:void(0);" (click)="
|
<a href="JavaScript:void(0);" (click)="
|
||||||
ChartFromView('', '', '60 days', comp.Type); selectedItem = 4; comp.difficultyRange = '60 days'
|
ChartFromView('', '', '60 days', comp.Type); selectedItem = 4; comp.difficultyRange = '30 days';comp.TdifficultyRange = '30 days'
|
||||||
" id="4" #item4 [ngClass]="{ active: selectedItem == item4.id, day60_txt: true }">60
|
" id="4" #item4 [ngClass]="{ active: selectedItem == item4.id, day60_txt: true }">60
|
||||||
{{'home.DAYS' | translate}}</a>
|
{{'home.DAYS' | translate}}</a>
|
||||||
<a href="JavaScript:void(0);" (click)="
|
<a href="JavaScript:void(0);" (click)="
|
||||||
ChartFromView('', '', '3 months', comp.Type); selectedItem = 5; comp.difficultyRange = '3 months'
|
ChartFromView('', '', '3 months', comp.Type); selectedItem = 5; comp.difficultyRange = '3 months';comp.TdifficultyRange = '3 months'
|
||||||
" id="5" #item5 [ngClass]="{ active: selectedItem == item5.id, day3m_txt: true }">3
|
" id="5" #item5 [ngClass]="{ active: selectedItem == item5.id, day3m_txt: true }">3
|
||||||
{{'home.MONTHS' | translate}}</a>
|
{{'home.MONTHS' | translate}}</a>
|
||||||
</div>
|
</div>
|
||||||
@ -153,9 +158,7 @@
|
|||||||
<h2 class="chart_heading mb-2 d-inline-block">{{'home.EXPLORE' | translate}}</h2>
|
<h2 class="chart_heading mb-2 d-inline-block">{{'home.EXPLORE' | translate}}</h2>
|
||||||
<ul class="list-unstyled pl-3">
|
<ul class="list-unstyled pl-3">
|
||||||
<li class="mb-1" *ngIf="this.title!='Target Difficulty'"><a
|
<li class="mb-1" *ngIf="this.title!='Target Difficulty'"><a
|
||||||
routerLink="/chart/target-difficulty">{{'target-difficulty' | translate}}</a></li>
|
routerLink="/chart/target-difficulty">{{'target-difficulty' | translate}}</a></li>
|
||||||
<li class="mb-1" *ngIf="this.title!='Total Difficulty'"><a
|
|
||||||
routerLink="/chart/total-difficulty">{{'total-difficulty' | translate}}</a></li>
|
|
||||||
<li class="mb-1" *ngIf="this.title!='Transactions over time'"><a
|
<li class="mb-1" *ngIf="this.title!='Transactions over time'"><a
|
||||||
routerLink="/chart/transactions-over-time">{{'home.TRANSACTIONS_BY_TIME' | translate}}</a></li>
|
routerLink="/chart/transactions-over-time">{{'home.TRANSACTIONS_BY_TIME' | translate}}</a></li>
|
||||||
<li class="mb-1" *ngIf="this.title!='Blocks'"><a
|
<li class="mb-1" *ngIf="this.title!='Blocks'"><a
|
||||||
@ -173,6 +176,8 @@
|
|||||||
routerLink="/chart/transactions-by-date">{{'home.TRANSACTIONS_VS_DATE' | translate}}</a></li>
|
routerLink="/chart/transactions-by-date">{{'home.TRANSACTIONS_VS_DATE' | translate}}</a></li>
|
||||||
<li class="mb-1" *ngIf="this.title!='Stackbar Chart'"><a routerLink="/chart/blocks-by-algorithm">Blocks by Algorithm</a>
|
<li class="mb-1" *ngIf="this.title!='Stackbar Chart'"><a routerLink="/chart/blocks-by-algorithm">Blocks by Algorithm</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="mb-1" *ngIf="this.title!='Total Difficulty'"><a
|
||||||
|
routerLink="/chart/total-difficulty">{{'total-difficulty' | translate}}</a></li>
|
||||||
<!-- <li class="mb-1" *ngIf="this.title!='Pie Chart'"><a routerLink="/chart/piechart">Pie Chart</a></li> -->
|
<!-- <li class="mb-1" *ngIf="this.title!='Pie Chart'"><a routerLink="/chart/piechart">Pie Chart</a></li> -->
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -23,7 +23,7 @@ export class GraphDetailComponent implements OnInit {
|
|||||||
public chartType : any = [];
|
public chartType : any = [];
|
||||||
public selectedItem: Number = 3;
|
public selectedItem: Number = 3;
|
||||||
public selectedItem8: Number = 2;
|
public selectedItem8: Number = 2;
|
||||||
public selectedItem12: Number = 1;
|
public selectedItem12: Number = 4;
|
||||||
public Type: any = '';
|
public Type: any = '';
|
||||||
public selectedTarget: Number = 3;
|
public selectedTarget: Number = 3;
|
||||||
public selectedTarget12: Number = 1;
|
public selectedTarget12: Number = 1;
|
||||||
@ -34,7 +34,6 @@ export class GraphDetailComponent implements OnInit {
|
|||||||
public GraphtDate: any;
|
public GraphtDate: any;
|
||||||
public GraphtHour: any;
|
public GraphtHour: any;
|
||||||
public linearTotalGraphData: any = [];
|
public linearTotalGraphData: any = [];
|
||||||
public TdifficultyRange: any = '1 day';
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
@ -61,6 +60,8 @@ export class GraphDetailComponent implements OnInit {
|
|||||||
this.hashdata = this.comp.linearTotalGraphData;
|
this.hashdata = this.comp.linearTotalGraphData;
|
||||||
console.log('this.comp.linearTotalGraphData',this.comp.linearTotalGraphData);
|
console.log('this.comp.linearTotalGraphData',this.comp.linearTotalGraphData);
|
||||||
this.hashdata.layout.height = 300;
|
this.hashdata.layout.height = 300;
|
||||||
|
this.hashdata.layout.xaxis.domain = [0.1,0.9];
|
||||||
|
this.hashdata.layout.yaxis2.position = 2.25;
|
||||||
this.title = 'Total Difficulty';
|
this.title = 'Total Difficulty';
|
||||||
this.selectedItem = 6;
|
this.selectedItem = 6;
|
||||||
this.titleService.setTitle(
|
this.titleService.setTitle(
|
||||||
@ -75,6 +76,8 @@ export class GraphDetailComponent implements OnInit {
|
|||||||
this.hashdata = this.comp.linearGraphData;
|
this.hashdata = this.comp.linearGraphData;
|
||||||
console.log('this.comp.linearGraphData',this.comp.linearGraphData);
|
console.log('this.comp.linearGraphData',this.comp.linearGraphData);
|
||||||
this.hashdata.layout.height = 300;
|
this.hashdata.layout.height = 300;
|
||||||
|
this.hashdata.layout.xaxis.domain = [0.1,0.9];
|
||||||
|
this.hashdata.layout.yaxis2.position = 2.25;
|
||||||
this.title = 'Target Difficulty';
|
this.title = 'Target Difficulty';
|
||||||
this.selectedItem = 6;
|
this.selectedItem = 6;
|
||||||
this.titleService.setTitle(
|
this.titleService.setTitle(
|
||||||
@ -223,6 +226,8 @@ export class GraphDetailComponent implements OnInit {
|
|||||||
this.comp.Difficultyreq('target',p1, p2, p3, p4).then(res => {
|
this.comp.Difficultyreq('target',p1, p2, p3, p4).then(res => {
|
||||||
this.hashdata = this.comp.linearGraphData;
|
this.hashdata = this.comp.linearGraphData;
|
||||||
this.hashdata.layout.height = 300;
|
this.hashdata.layout.height = 300;
|
||||||
|
this.hashdata.layout.xaxis.domain = [0.1,0.9];
|
||||||
|
this.hashdata.layout.yaxis2.position = 2.25;
|
||||||
this.title = 'Target Difficulty';
|
this.title = 'Target Difficulty';
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
@ -230,6 +235,8 @@ export class GraphDetailComponent implements OnInit {
|
|||||||
this.comp.Difficultyreq('total',p1, p2, p3, p4).then(res => {
|
this.comp.Difficultyreq('total',p1, p2, p3, p4).then(res => {
|
||||||
this.hashdata = this.comp.linearTotalGraphData;
|
this.hashdata = this.comp.linearTotalGraphData;
|
||||||
this.hashdata.layout.height = 300;
|
this.hashdata.layout.height = 300;
|
||||||
|
this.hashdata.layout.xaxis.domain = [0.1,0.9];
|
||||||
|
this.hashdata.layout.yaxis2.position = 2.25;
|
||||||
this.title = 'Total Difficulty';
|
this.title = 'Total Difficulty';
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
@ -8,7 +8,10 @@
|
|||||||
}}</span> -->
|
}}</span> -->
|
||||||
|
|
||||||
<div class="chart_show">
|
<div class="chart_show">
|
||||||
<div class="difficulty_filter day_filter p-0 bg-transparent mt-2">
|
<!-- <div class="difficulty_filter day_filter p-0 bg-transparent mt-2">
|
||||||
|
<a href="JavaScript:void(0);" (click)="
|
||||||
|
Difficultyreq('target', '', '', difficultyRange,'all'); selectedItem12 = 4
|
||||||
|
" id="4" #item124 [ngClass]="{ active: selectedItem12 == item124.id, txt_primay: true }">All</a>
|
||||||
<a href="JavaScript:void(0);" (click)="
|
<a href="JavaScript:void(0);" (click)="
|
||||||
Difficultyreq('target', '', '', difficultyRange,'cuckatoo'); selectedItem12 = 1
|
Difficultyreq('target', '', '', difficultyRange,'cuckatoo'); selectedItem12 = 1
|
||||||
" id="1" #item121 [ngClass]="{ active: selectedItem12 == item121.id, txt_primay: true }">Cuckoo</a>
|
" id="1" #item121 [ngClass]="{ active: selectedItem12 == item121.id, txt_primay: true }">Cuckoo</a>
|
||||||
@ -18,7 +21,7 @@
|
|||||||
<a href="JavaScript:void(0);" (click)="
|
<a href="JavaScript:void(0);" (click)="
|
||||||
Difficultyreq('target', '', '', difficultyRange,'randomx'); selectedItem12 = 3
|
Difficultyreq('target', '', '', difficultyRange,'randomx'); selectedItem12 = 3
|
||||||
" id="3" #item123 [ngClass]="{ active: selectedItem12 == item123.id, txt_primay: true }">RandomX</a>
|
" id="3" #item123 [ngClass]="{ active: selectedItem12 == item123.id, txt_primay: true }">RandomX</a>
|
||||||
</div>
|
</div> -->
|
||||||
<epic-explorer-plotly *ngIf="linearGraphData.data" [data]="linearGraphData.data" [layout]="linearGraphData.layout">
|
<epic-explorer-plotly *ngIf="linearGraphData.data" [data]="linearGraphData.data" [layout]="linearGraphData.layout">
|
||||||
</epic-explorer-plotly>
|
</epic-explorer-plotly>
|
||||||
<div *ngIf="!linearGraphData.data" class="feedback_div news_desc text-center">
|
<div *ngIf="!linearGraphData.data" class="feedback_div news_desc text-center">
|
||||||
@ -35,7 +38,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="day_filter diff_margin">
|
<div class="day_filter">
|
||||||
<a href="JavaScript:void(0);" (click)="
|
<a href="JavaScript:void(0);" (click)="
|
||||||
Difficultyreq('target', '', '', '1 day',''); selectedItem = 6; difficultyRange = '1 day'
|
Difficultyreq('target', '', '', '1 day',''); selectedItem = 6; difficultyRange = '1 day'
|
||||||
" id="6" #item6 [ngClass]="{ active: selectedItem == item6.id, txt_primay: true }">1 day</a>
|
" id="6" #item6 [ngClass]="{ active: selectedItem == item6.id, txt_primay: true }">1 day</a>
|
||||||
@ -63,79 +66,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6 col-lg-4 mb-4">
|
|
||||||
<div class="box_shadow">
|
|
||||||
<div class="blocks">
|
|
||||||
<h2 class="chart_heading d-inline-block">{{'home.TOTAL_DIFFICULTY' | translate}}</h2>
|
|
||||||
<!-- <span class="txn_count" *ngIf="this.lg_last.length > 0"><span *ngFor="let l of lg_last">{{
|
|
||||||
this.l | number</span>
|
|
||||||
}}</span> -->
|
|
||||||
|
|
||||||
<div class="chart_show">
|
|
||||||
<div class="difficulty_filter day_filter p-0 bg-transparent mt-2">
|
|
||||||
<a href="JavaScript:void(0);" (click)="
|
|
||||||
Difficultyreq('total', '', '', TdifficultyRange,'cuckatoo'); selectedTarget12 = 1
|
|
||||||
" id="1" #itemtarget121
|
|
||||||
[ngClass]="{ active: selectedTarget12 == itemtarget121.id, txt_primay: true }">Cuckoo</a>
|
|
||||||
<a href="JavaScript:void(0);" (click)="
|
|
||||||
Difficultyreq('total', '', '', TdifficultyRange,'progpow'); selectedTarget12 = 2
|
|
||||||
" id="2" #itemtarget122
|
|
||||||
[ngClass]="{ active: selectedTarget12 == itemtarget122.id, txt_primay: true }">ProgPow</a>
|
|
||||||
<a href="JavaScript:void(0);" (click)="
|
|
||||||
Difficultyreq('total', '', '', TdifficultyRange,'randomx'); selectedTarget12 = 3
|
|
||||||
" id="3" #itemtarget123
|
|
||||||
[ngClass]="{ active: selectedTarget12 == itemtarget123.id, txt_primay: true }">RandomX</a>
|
|
||||||
</div>
|
|
||||||
<epic-explorer-plotly *ngIf="linearTotalGraphData.data" [data]="linearTotalGraphData.data"
|
|
||||||
[layout]="linearTotalGraphData.layout">
|
|
||||||
</epic-explorer-plotly>
|
|
||||||
<div *ngIf="!linearTotalGraphData.data" class="feedback_div news_desc text-center">
|
|
||||||
<div class="graph_img background_loading mx-auto mb-3"></div>
|
|
||||||
<div class=" p-3 bg-white">
|
|
||||||
<p class="mb-2 background_loading para_load"></p>
|
|
||||||
<p class="mb-2 background_loading para_load"></p>
|
|
||||||
<p class="mb-2 background_loading para_load"></p>
|
|
||||||
<p class="mb-2 background_loading para_load"></p>
|
|
||||||
<p class="mb-2 background_loading para_load"></p>
|
|
||||||
<p class="mb-2 background_loading para_load"></p>
|
|
||||||
<p class="mb-2 background_loading para_load"></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="day_filter diff_margin">
|
|
||||||
<a href="JavaScript:void(0);" (click)="
|
|
||||||
Difficultyreq('total', '', '', '1 day',''); selectedTarget = 6; TdifficultyRange = '1 day'
|
|
||||||
" id="6" #itemtarget6 [ngClass]="{ active: selectedTarget == itemtarget6.id, txt_primay: true }">1 day</a>
|
|
||||||
<a href="JavaScript:void(0);" (click)="
|
|
||||||
Difficultyreq('total', '', '', '1 week',''); selectedTarget = 1; TdifficultyRange = '1 week'
|
|
||||||
" id="1" #itemtarget1 [ngClass]="{ active: selectedTarget == itemtarget1.id, txt_primay: true }">1
|
|
||||||
{{'home.WEEK' | translate}}</a>
|
|
||||||
<!-- <a href="JavaScript:void(0);" (click)="
|
|
||||||
Difficultyreq('total', '', '', '15 days',''); selectedTarget = 2; TdifficultyRange = '15 days'
|
|
||||||
" id="2" #itemtarget2 [ngClass]="{ active: selectedTarget == itemtarget2.id, day15_txt: true }">15
|
|
||||||
{{'home.DAYS' | translate}}</a> -->
|
|
||||||
<a href="JavaScript:void(0);" (click)="
|
|
||||||
Difficultyreq('total', '', '', '30 days',''); selectedTarget = 3; TdifficultyRange = '30 days'
|
|
||||||
" id="3" #itemtarget3 [ngClass]="{ active: selectedTarget == itemtarget3.id, day30_txt: true }">30
|
|
||||||
{{'home.DAYS' | translate}}</a>
|
|
||||||
<a href="JavaScript:void(0);" (click)="
|
|
||||||
Difficultyreq('total', '', '', '60 days',''); selectedTarget = 4; TdifficultyRange = '60 days'
|
|
||||||
" id="4" #itemtarget4 [ngClass]="{ active: selectedTarget == itemtarget4.id, day60_txt: true }">60
|
|
||||||
{{'home.DAYS' | translate}}</a>
|
|
||||||
<a href="JavaScript:void(0);" (click)="
|
|
||||||
Difficultyreq('total', '', '', '3 months',''); selectedTarget = 5; TdifficultyRange = '3 months'
|
|
||||||
" id="5" #itemtarget5 [ngClass]="{ active: selectedTarget == itemtarget5.id, day3m_txt: true }">3
|
|
||||||
{{'home.MONTHS' | translate}}</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="explore_all text-right">
|
|
||||||
|
|
||||||
<a routerLink="/chart/total-difficulty"><span class="text-uppercase">{{'home.EXPLORE_IT' | translate}} <i
|
|
||||||
class="fa fa-long-arrow-right"></i></span></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6 col-lg-4 mb-4">
|
<div class="col-md-6 col-lg-4 mb-4">
|
||||||
<div class="box_shadow">
|
<div class="box_shadow">
|
||||||
<div class="blocks">
|
<div class="blocks">
|
||||||
@ -308,7 +238,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="viewchartvar" class="col-md-6 col-lg-4 mb-4">
|
<div class="col-md-6 col-lg-4 mb-4">
|
||||||
<div class="box_shadow">
|
<div class="box_shadow">
|
||||||
<div class="blocks">
|
<div class="blocks">
|
||||||
<h2 class="chart_heading d-inline-block">{{'home.BLOCKS_MINED' | translate}}</h2>
|
<h2 class="chart_heading d-inline-block">{{'home.BLOCKS_MINED' | translate}}</h2>
|
||||||
@ -581,5 +511,81 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div> -->
|
</div> -->
|
||||||
|
<div *ngIf="viewchartvar" class="col-md-6 col-lg-4 mb-4">
|
||||||
|
<div class="box_shadow">
|
||||||
|
<div class="blocks">
|
||||||
|
<h2 class="chart_heading d-inline-block">{{'home.TOTAL_DIFFICULTY' | translate}}</h2>
|
||||||
|
<!-- <span class="txn_count" *ngIf="this.lg_last.length > 0"><span *ngFor="let l of lg_last">{{
|
||||||
|
this.l | number</span>
|
||||||
|
}}</span> -->
|
||||||
|
|
||||||
|
<div class="chart_show">
|
||||||
|
<!-- <div class="difficulty_filter day_filter p-0 bg-transparent mt-2">
|
||||||
|
<a href="JavaScript:void(0);" (click)="
|
||||||
|
Difficultyreq('total', '', '', TdifficultyRange,'all'); selectedTarget12 = 4
|
||||||
|
" id="4" #itemtarget124
|
||||||
|
[ngClass]="{ active: selectedTarget12 == itemtarget124.id, txt_primay: true }">All</a>
|
||||||
|
<a href="JavaScript:void(0);" (click)="
|
||||||
|
Difficultyreq('total', '', '', TdifficultyRange,'cuckatoo'); selectedTarget12 = 1
|
||||||
|
" id="1" #itemtarget121
|
||||||
|
[ngClass]="{ active: selectedTarget12 == itemtarget121.id, txt_primay: true }">Cuckoo</a>
|
||||||
|
<a href="JavaScript:void(0);" (click)="
|
||||||
|
Difficultyreq('total', '', '', TdifficultyRange,'progpow'); selectedTarget12 = 2
|
||||||
|
" id="2" #itemtarget122
|
||||||
|
[ngClass]="{ active: selectedTarget12 == itemtarget122.id, txt_primay: true }">ProgPow</a>
|
||||||
|
<a href="JavaScript:void(0);" (click)="
|
||||||
|
Difficultyreq('total', '', '', TdifficultyRange,'randomx'); selectedTarget12 = 3
|
||||||
|
" id="3" #itemtarget123
|
||||||
|
[ngClass]="{ active: selectedTarget12 == itemtarget123.id, txt_primay: true }">RandomX</a>
|
||||||
|
</div> -->
|
||||||
|
<epic-explorer-plotly *ngIf="linearTotalGraphData.data" [data]="linearTotalGraphData.data"
|
||||||
|
[layout]="linearTotalGraphData.layout">
|
||||||
|
</epic-explorer-plotly>
|
||||||
|
<div *ngIf="!linearTotalGraphData.data" class="feedback_div news_desc text-center">
|
||||||
|
<div class="graph_img background_loading mx-auto mb-3"></div>
|
||||||
|
<div class=" p-3 bg-white">
|
||||||
|
<p class="mb-2 background_loading para_load"></p>
|
||||||
|
<p class="mb-2 background_loading para_load"></p>
|
||||||
|
<p class="mb-2 background_loading para_load"></p>
|
||||||
|
<p class="mb-2 background_loading para_load"></p>
|
||||||
|
<p class="mb-2 background_loading para_load"></p>
|
||||||
|
<p class="mb-2 background_loading para_load"></p>
|
||||||
|
<p class="mb-2 background_loading para_load"></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="day_filter">
|
||||||
|
<a href="JavaScript:void(0);" (click)="
|
||||||
|
Difficultyreq('total', '', '', '1 day',''); selectedTarget = 6; TdifficultyRange = '1 day'
|
||||||
|
" id="6" #itemtarget6 [ngClass]="{ active: selectedTarget == itemtarget6.id, txt_primay: true }">1 day</a>
|
||||||
|
<a href="JavaScript:void(0);" (click)="
|
||||||
|
Difficultyreq('total', '', '', '1 week',''); selectedTarget = 1; TdifficultyRange = '1 week'
|
||||||
|
" id="1" #itemtarget1 [ngClass]="{ active: selectedTarget == itemtarget1.id, txt_primay: true }">1
|
||||||
|
{{'home.WEEK' | translate}}</a>
|
||||||
|
<!-- <a href="JavaScript:void(0);" (click)="
|
||||||
|
Difficultyreq('total', '', '', '15 days',''); selectedTarget = 2; TdifficultyRange = '15 days'
|
||||||
|
" id="2" #itemtarget2 [ngClass]="{ active: selectedTarget == itemtarget2.id, day15_txt: true }">15
|
||||||
|
{{'home.DAYS' | translate}}</a> -->
|
||||||
|
<a href="JavaScript:void(0);" (click)="
|
||||||
|
Difficultyreq('total', '', '', '30 days',''); selectedTarget = 3; TdifficultyRange = '30 days'
|
||||||
|
" id="3" #itemtarget3 [ngClass]="{ active: selectedTarget == itemtarget3.id, day30_txt: true }">30
|
||||||
|
{{'home.DAYS' | translate}}</a>
|
||||||
|
<a href="JavaScript:void(0);" (click)="
|
||||||
|
Difficultyreq('total', '', '', '60 days',''); selectedTarget = 4; TdifficultyRange = '60 days'
|
||||||
|
" id="4" #itemtarget4 [ngClass]="{ active: selectedTarget == itemtarget4.id, day60_txt: true }">60
|
||||||
|
{{'home.DAYS' | translate}}</a>
|
||||||
|
<a href="JavaScript:void(0);" (click)="
|
||||||
|
Difficultyreq('total', '', '', '3 months',''); selectedTarget = 5; TdifficultyRange = '3 months'
|
||||||
|
" id="5" #itemtarget5 [ngClass]="{ active: selectedTarget == itemtarget5.id, day3m_txt: true }">3
|
||||||
|
{{'home.MONTHS' | translate}}</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="explore_all text-right">
|
||||||
|
|
||||||
|
<a routerLink="/chart/total-difficulty"><span class="text-uppercase">{{'home.EXPLORE_IT' | translate}} <i
|
||||||
|
class="fa fa-long-arrow-right"></i></span></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -50,23 +50,23 @@ export class GraphListComponent implements OnInit {
|
|||||||
public selectedItem9: Number = 3;
|
public selectedItem9: Number = 3;
|
||||||
public selectedItem10: Number = 3;
|
public selectedItem10: Number = 3;
|
||||||
public selectedItem11: Number = 3;
|
public selectedItem11: Number = 3;
|
||||||
public selectedItem12: Number = 1;
|
public selectedItem12: Number = 4;
|
||||||
public selectedTarget: Number = 6;
|
public selectedTarget: Number = 6;
|
||||||
public selectedTarget12: Number = 1;
|
public selectedTarget12: Number = 4;
|
||||||
|
|
||||||
public tInput: any;
|
public tInput: any;
|
||||||
public tOutput: any;
|
public tOutput: any;
|
||||||
public tKernal: any;
|
public tKernal: any;
|
||||||
public tDate: any;
|
public tDate: any;
|
||||||
public tHour: any;
|
public tHour: any;
|
||||||
public Type: any = '';
|
public Type: any = 'all';
|
||||||
public difficultyRange: any = '1 day';
|
public difficultyRange: any = '1 day';
|
||||||
public TdifficultyRange: any = '1 day';
|
public TdifficultyRange: any = '1 day';
|
||||||
|
|
||||||
viewchartvar: boolean;
|
viewchartvar: boolean;
|
||||||
|
|
||||||
constructor(private chartService: ChartService, private http: HttpClient,public translate: TransServiceService, private router: Router,
|
constructor(private chartService: ChartService, private http: HttpClient, public translate: TransServiceService, private router: Router,
|
||||||
) {
|
) {
|
||||||
if (this.router.url == '/all') {
|
if (this.router.url == '/all') {
|
||||||
this.viewchartvar = true;
|
this.viewchartvar = true;
|
||||||
} else {
|
} else {
|
||||||
@ -126,16 +126,16 @@ export class GraphListComponent implements OnInit {
|
|||||||
if (res['status'] == 200) {
|
if (res['status'] == 200) {
|
||||||
let plabel = res.response.label;
|
let plabel = res.response.label;
|
||||||
let pvalues = res.response.value;
|
let pvalues = res.response.value;
|
||||||
this.pg_last =
|
this.pg_last =
|
||||||
pvalues[pvalues.length - 1];
|
pvalues[pvalues.length - 1];
|
||||||
this.piechartFunc(
|
this.piechartFunc(
|
||||||
plabel,
|
plabel,
|
||||||
pvalues,
|
pvalues,
|
||||||
);
|
);
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error => {},
|
error => { },
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -159,18 +159,18 @@ export class GraphListComponent implements OnInit {
|
|||||||
let Cuckoo = res.response.Cuckoo;
|
let Cuckoo = res.response.Cuckoo;
|
||||||
let ProgPow = res.response.ProgPow;
|
let ProgPow = res.response.ProgPow;
|
||||||
let RandomX = res.response.RandomX;
|
let RandomX = res.response.RandomX;
|
||||||
this.sg_last =
|
this.sg_last =
|
||||||
RandomX[RandomX.length - 1];
|
RandomX[RandomX.length - 1];
|
||||||
this.stackchartFunc(
|
this.stackchartFunc(
|
||||||
sDate,
|
sDate,
|
||||||
Cuckoo,
|
Cuckoo,
|
||||||
ProgPow,
|
ProgPow,
|
||||||
RandomX
|
RandomX
|
||||||
);
|
);
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error => {},
|
error => { },
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -224,7 +224,7 @@ export class GraphListComponent implements OnInit {
|
|||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error => {},
|
error => { },
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -266,7 +266,7 @@ export class GraphListComponent implements OnInit {
|
|||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error => {},
|
error => { },
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -304,7 +304,7 @@ export class GraphListComponent implements OnInit {
|
|||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error => {},
|
error => { },
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -327,7 +327,7 @@ export class GraphListComponent implements OnInit {
|
|||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error => {},
|
error => { },
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -351,7 +351,7 @@ export class GraphListComponent implements OnInit {
|
|||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error => {},
|
error => { },
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -374,7 +374,7 @@ export class GraphListComponent implements OnInit {
|
|||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error => {},
|
error => { },
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -386,7 +386,7 @@ export class GraphListComponent implements OnInit {
|
|||||||
interval = '',
|
interval = '',
|
||||||
type = ''
|
type = ''
|
||||||
) {
|
) {
|
||||||
this.Type = type != '' ? type : this.Type == '' ? 'cuckatoo' : this.Type;
|
this.Type = type != '' ? type : this.Type == '' ? 'all' : this.Type;
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
params = params.append('FromDate', fromDate);
|
params = params.append('FromDate', fromDate);
|
||||||
@ -400,37 +400,94 @@ export class GraphListComponent implements OnInit {
|
|||||||
res => {
|
res => {
|
||||||
if (res['status'] == 200) {
|
if (res['status'] == 200) {
|
||||||
let DifficultychartDate = res.response.Date;
|
let DifficultychartDate = res.response.Date;
|
||||||
let BlocksChartDate = res.response.blockDate;
|
let DifficultyCuckatoo = res.response.DifficultyCuckatoo;
|
||||||
let TargetDifficulty = res.response.TargetDifficulty;
|
let DifficultyRandomx = res.response.DifficultyRandomx;
|
||||||
let range = [res.response.Minrange, res.response.Maxrange]
|
let DifficultyProgpow = res.response.DifficultyProgpow;
|
||||||
let tickformat = res.response.tickFormat;
|
let data;
|
||||||
this.lg_last =
|
switch (this.Type) {
|
||||||
TargetDifficulty[TargetDifficulty.length - 1];
|
case 'all':
|
||||||
|
data =
|
||||||
|
[
|
||||||
|
{
|
||||||
|
x: DifficultychartDate,
|
||||||
|
y: DifficultyCuckatoo,
|
||||||
|
text: DifficultychartDate,
|
||||||
|
// mode: 'lines+markers',
|
||||||
|
type: 'scatter',
|
||||||
|
name: '',
|
||||||
|
// line: { color: '#ac3333' },
|
||||||
|
hovertemplate: '%{text}<br> Cuckoo : %{y:,}',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
x: DifficultychartDate,
|
||||||
|
y: DifficultyProgpow,
|
||||||
|
text: DifficultychartDate,
|
||||||
|
// mode: 'lines+markers',
|
||||||
|
type: 'scatter',
|
||||||
|
name: '',
|
||||||
|
yaxis: 'y2',
|
||||||
|
// line: { color: '#ac3333' },
|
||||||
|
hovertemplate: '%{text}<br> Progpow : %{y:,}',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
x: DifficultychartDate,
|
||||||
|
y: DifficultyRandomx,
|
||||||
|
text: DifficultychartDate,
|
||||||
|
// mode: 'lines+markers',
|
||||||
|
type: 'scatter',
|
||||||
|
name: '',
|
||||||
|
yaxis: 'y3',
|
||||||
|
// line: { color: '#ac3333' },
|
||||||
|
hovertemplate: '%{text}<br> RandomX : %{y:,}',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
let yvalue = this.Type == 'cuckatoo' ? DifficultyCuckatoo : this.Type == 'progpow' ? DifficultyProgpow : this.Type == 'randomx' ? DifficultyRandomx : []
|
||||||
|
data =
|
||||||
|
[
|
||||||
|
{
|
||||||
|
x: DifficultychartDate,
|
||||||
|
y: yvalue,
|
||||||
|
text: DifficultychartDate,
|
||||||
|
mode: 'lines+markers',
|
||||||
|
type: 'scatter',
|
||||||
|
name: '',
|
||||||
|
line: { color: '#ac3333' },
|
||||||
|
hovertemplate: '%{text}<br> Difficulty : %{y:,}',
|
||||||
|
}];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// res.response.Minrange, res.response.Maxrange
|
||||||
|
let range = [];
|
||||||
|
let tickformat = res.response.tickFormat;
|
||||||
|
// this.lg_last =
|
||||||
|
// TargetDifficulty[TargetDifficulty.length - 1];
|
||||||
|
|
||||||
switch(difftype){
|
switch (difftype) {
|
||||||
case 'total':
|
case 'total':
|
||||||
this.totaldifficultyChartFunc(
|
this.totaldifficultyChartFunc(
|
||||||
DifficultychartDate,
|
DifficultychartDate,
|
||||||
TargetDifficulty,
|
data,
|
||||||
this.Type,
|
this.Type,
|
||||||
range,
|
range,
|
||||||
tickformat
|
tickformat
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case 'target':
|
case 'target':
|
||||||
this.difficultyChartFunc(
|
this.difficultyChartFunc(
|
||||||
DifficultychartDate,
|
DifficultychartDate,
|
||||||
TargetDifficulty,
|
data,
|
||||||
this.Type,
|
this.Type,
|
||||||
range,
|
range,
|
||||||
tickformat
|
tickformat
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error => {},
|
error => { },
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -452,78 +509,57 @@ export class GraphListComponent implements OnInit {
|
|||||||
if (res['status'] == 200) {
|
if (res['status'] == 200) {
|
||||||
let DifficultychartDate = res.response.Date;
|
let DifficultychartDate = res.response.Date;
|
||||||
let BlocksChartDate = res.response.blockDate;
|
let BlocksChartDate = res.response.blockDate;
|
||||||
let Blockval = res.response.Blocks;
|
let Blockval = res.response.Blocks;
|
||||||
this.brg_last = Blockval[Blockval.length - 1];
|
this.brg_last = Blockval[Blockval.length - 1];
|
||||||
this.totalBlocksFunc(BlocksChartDate, Blockval);
|
this.totalBlocksFunc(BlocksChartDate, Blockval);
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error => {},
|
error => { },
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
difficultyChartFunc(DifficultychartDate, TargetDifficulty, Type, range, tickformat) {
|
difficultyChartFunc(DifficultychartDate, data, Type, range, tickformat) {
|
||||||
// console.log('range rangerangerange',range);
|
// console.log('range rangerangerange',range);
|
||||||
this.linearGraphData = {
|
this.linearGraphData = {
|
||||||
data: [
|
data: data,
|
||||||
{
|
|
||||||
x: DifficultychartDate,
|
|
||||||
y: TargetDifficulty,
|
|
||||||
text: DifficultychartDate,
|
|
||||||
mode: 'lines+markers',
|
|
||||||
type: 'scatter',
|
|
||||||
name: '',
|
|
||||||
line: { color: '#ac3333' },
|
|
||||||
hovertemplate: '%{text}<br> Difficulty : %{y:,}',
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// x: DifficultychartDate,
|
|
||||||
// y: DifficultyCuckatoo,
|
|
||||||
// text: DifficultyCuckatoo,
|
|
||||||
// mode: 'lines+markers',
|
|
||||||
// type: 'scatter',
|
|
||||||
// name: '',
|
|
||||||
// line: { color: '#A876C6' },
|
|
||||||
// hovertemplate: '%{x}<br> Cuckatoo : %{text:,}',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// x: DifficultychartDate,
|
|
||||||
// y: DifficultyProgpow,
|
|
||||||
// text: DifficultyProgpow,
|
|
||||||
// mode: 'lines+markers',
|
|
||||||
// type: 'scatter',
|
|
||||||
// name: '',
|
|
||||||
// line: { color: '#54CFDC' },
|
|
||||||
// hovertemplate: '%{x}<br> Progpow : %{text:,}',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// x: DifficultychartDate,
|
|
||||||
// y: DifficultyRandomx,
|
|
||||||
// text: DifficultyRandomx,
|
|
||||||
// mode: 'lines+markers',
|
|
||||||
// type: 'scatter',
|
|
||||||
// name: '',
|
|
||||||
// line: { color: '#77817C' },
|
|
||||||
// hovertemplate: '%{x}<br> Randomx : %{text:,}',
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
layout: {
|
layout: {
|
||||||
hovermode: 'closest',
|
// hovermode: 'closest',
|
||||||
height: 250,
|
height: 250,
|
||||||
autosize: true,
|
autosize: true,
|
||||||
showlegend: false,
|
showlegend: false,
|
||||||
xaxis: {
|
xaxis: {
|
||||||
tickangle: -45,
|
tickangle: -45,
|
||||||
tickformat: tickformat,
|
tickformat: tickformat,
|
||||||
showgrid: true,
|
fixedrange: true,
|
||||||
fixedrange: true
|
domain: [0.2, 0.8]
|
||||||
|
// showgrid: true
|
||||||
},
|
},
|
||||||
yaxis: {
|
yaxis: {
|
||||||
title: 'Diff',
|
title: 'Cuckoo',
|
||||||
showgrid: true,
|
|
||||||
fixedrange: true,
|
fixedrange: true,
|
||||||
range: range
|
// showgrid: true,
|
||||||
|
// range: range
|
||||||
|
},
|
||||||
|
yaxis2: {
|
||||||
|
title: 'Progpow',
|
||||||
|
fixedrange: true,
|
||||||
|
// showgrid: true,
|
||||||
|
// range: range,
|
||||||
|
overlaying: 'y',
|
||||||
|
side: 'left',
|
||||||
|
position: 1.25
|
||||||
|
},
|
||||||
|
yaxis3: {
|
||||||
|
title: 'RandomX',
|
||||||
|
fixedrange: true,
|
||||||
|
// showgrid: true,
|
||||||
|
// range: range,
|
||||||
|
anchor: 'x',
|
||||||
|
overlaying: 'y',
|
||||||
|
side: 'right'
|
||||||
|
|
||||||
},
|
},
|
||||||
margin: {
|
margin: {
|
||||||
l: 50,
|
l: 50,
|
||||||
@ -619,7 +655,7 @@ export class GraphListComponent implements OnInit {
|
|||||||
|
|
||||||
|
|
||||||
piechartFunc(plabel, pvalues) {
|
piechartFunc(plabel, pvalues) {
|
||||||
this.pieGraphData = {
|
this.pieGraphData = {
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
values: pvalues,
|
values: pvalues,
|
||||||
@ -634,7 +670,7 @@ export class GraphListComponent implements OnInit {
|
|||||||
height: 250,
|
height: 250,
|
||||||
autosize: false,
|
autosize: false,
|
||||||
showlegend: false,
|
showlegend: false,
|
||||||
xaxis: {
|
xaxis: {
|
||||||
tickangle: -45,
|
tickangle: -45,
|
||||||
tickformat: '%m-%d',
|
tickformat: '%m-%d',
|
||||||
showgrid: true,
|
showgrid: true,
|
||||||
@ -808,7 +844,7 @@ export class GraphListComponent implements OnInit {
|
|||||||
],
|
],
|
||||||
layout: {
|
layout: {
|
||||||
hovermode: 'closest',
|
hovermode: 'closest',
|
||||||
// width: 350,
|
// width: 350,
|
||||||
height: 250,
|
height: 250,
|
||||||
autosize: true,
|
autosize: true,
|
||||||
xaxis: {
|
xaxis: {
|
||||||
@ -819,7 +855,7 @@ export class GraphListComponent implements OnInit {
|
|||||||
showgrid: true,
|
showgrid: true,
|
||||||
},
|
},
|
||||||
yaxis: {
|
yaxis: {
|
||||||
title: 'Blocks / sec',
|
title: 'Seconds / Block',
|
||||||
rangemode: 'nonnegative',
|
rangemode: 'nonnegative',
|
||||||
fixedrange: true,
|
fixedrange: true,
|
||||||
showgrid: true,
|
showgrid: true,
|
||||||
@ -835,7 +871,7 @@ export class GraphListComponent implements OnInit {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
blockminedFunc(mDate,ProgPow, Cuckoo, RandomX, ProgPowper, Cuckooper, RandomXper) {
|
blockminedFunc(mDate, ProgPow, Cuckoo, RandomX, ProgPowper, Cuckooper, RandomXper) {
|
||||||
this.doubleareaGraphData = {
|
this.doubleareaGraphData = {
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
@ -918,64 +954,64 @@ export class GraphListComponent implements OnInit {
|
|||||||
|
|
||||||
transactionheatmapFunc(tDate, tHour, tInput, hovertext) {
|
transactionheatmapFunc(tDate, tHour, tInput, hovertext) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.heatMapGrowthData = {
|
this.heatMapGrowthData = {
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
x: tHour,
|
x: tHour,
|
||||||
y: tDate,
|
y: tDate,
|
||||||
z: tInput,
|
z: tInput,
|
||||||
name: '',
|
name: '',
|
||||||
text: hovertext,
|
text: hovertext,
|
||||||
hovertemplate: hovertext + ': %{z:,} ',
|
hovertemplate: hovertext + ': %{z:,} ',
|
||||||
colorscale: 'Rainbow',
|
colorscale: 'Rainbow',
|
||||||
type: 'heatmap',
|
type: 'heatmap',
|
||||||
visible: true,
|
visible: true,
|
||||||
colorbar: { thickness: 3 },
|
colorbar: { thickness: 3 },
|
||||||
xgap: 1,
|
xgap: 1,
|
||||||
ygap: 1,
|
ygap: 1,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
layout: {
|
layout: {
|
||||||
hovermode: 'closest',
|
hovermode: 'closest',
|
||||||
height: 250,
|
height: 250,
|
||||||
//width: 365,
|
//width: 365,
|
||||||
autosize: true,
|
|
||||||
annotations: [],
|
|
||||||
font: {
|
|
||||||
size: 8.5,
|
|
||||||
},
|
|
||||||
xaxis: {
|
|
||||||
ticks: '',
|
|
||||||
tickangle: screen.width < 767 ? '-90' : 360,
|
|
||||||
side: 'top',
|
|
||||||
autotick: false,
|
|
||||||
showgrid: true,
|
|
||||||
rangemode: 'nonnegative',
|
|
||||||
fixedrange: true,
|
|
||||||
autosize: true,
|
autosize: true,
|
||||||
|
annotations: [],
|
||||||
|
font: {
|
||||||
|
size: 8.5,
|
||||||
|
},
|
||||||
|
xaxis: {
|
||||||
|
ticks: '',
|
||||||
|
tickangle: screen.width < 767 ? '-90' : 360,
|
||||||
|
side: 'top',
|
||||||
|
autotick: false,
|
||||||
|
showgrid: true,
|
||||||
|
rangemode: 'nonnegative',
|
||||||
|
fixedrange: true,
|
||||||
|
autosize: true,
|
||||||
|
},
|
||||||
|
yaxis: {
|
||||||
|
ticks: '',
|
||||||
|
ticksuffix: ' ',
|
||||||
|
tickformat: '%m-%d',
|
||||||
|
autosize: true,
|
||||||
|
showgrid: true,
|
||||||
|
autotick: false,
|
||||||
|
rangemode: 'nonnegative',
|
||||||
|
fixedrange: true,
|
||||||
|
},
|
||||||
|
margin: {
|
||||||
|
l: 30,
|
||||||
|
r: 0,
|
||||||
|
b: 50,
|
||||||
|
t: 50,
|
||||||
|
},
|
||||||
|
showlegend: false,
|
||||||
},
|
},
|
||||||
yaxis: {
|
options: null,
|
||||||
ticks: '',
|
};
|
||||||
ticksuffix: ' ',
|
resolve();
|
||||||
tickformat: '%m-%d',
|
});
|
||||||
autosize: true,
|
|
||||||
showgrid: true,
|
|
||||||
autotick: false,
|
|
||||||
rangemode: 'nonnegative',
|
|
||||||
fixedrange: true,
|
|
||||||
},
|
|
||||||
margin: {
|
|
||||||
l: 30,
|
|
||||||
r: 0,
|
|
||||||
b: 50,
|
|
||||||
t: 50,
|
|
||||||
},
|
|
||||||
showlegend: false,
|
|
||||||
},
|
|
||||||
options: null,
|
|
||||||
};
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
transactionlinechartFunc(Tdate, Ttotalinput, Ttotalkernal, Ttotaloutput) {
|
transactionlinechartFunc(Tdate, Ttotalinput, Ttotalkernal, Ttotaloutput) {
|
||||||
this.feeGraphData = {
|
this.feeGraphData = {
|
||||||
@ -1013,7 +1049,7 @@ export class GraphListComponent implements OnInit {
|
|||||||
],
|
],
|
||||||
layout: {
|
layout: {
|
||||||
autosize: true,
|
autosize: true,
|
||||||
// width: 350,
|
// width: 350,
|
||||||
height: 250,
|
height: 250,
|
||||||
xaxis: {
|
xaxis: {
|
||||||
showgrid: true,
|
showgrid: true,
|
||||||
@ -1091,22 +1127,11 @@ export class GraphListComponent implements OnInit {
|
|||||||
options: null,
|
options: null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
totaldifficultyChartFunc(DifficultychartDate, TargetDifficulty, Type, range, tickformat) {
|
totaldifficultyChartFunc(DifficultychartDate, data, type, range, tickformat) {
|
||||||
this.linearTotalGraphData = {
|
this.linearTotalGraphData = {
|
||||||
data: [
|
data: data,
|
||||||
{
|
|
||||||
x: DifficultychartDate,
|
|
||||||
y: TargetDifficulty,
|
|
||||||
text: DifficultychartDate,
|
|
||||||
mode: 'lines+markers',
|
|
||||||
type: 'scatter',
|
|
||||||
name: '',
|
|
||||||
line: { color: '#ac3333' },
|
|
||||||
hovertemplate: '%{text}<br> Difficulty : %{y:,}',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
layout: {
|
layout: {
|
||||||
hovermode: 'closest',
|
// hovermode: 'closest',
|
||||||
height: 250,
|
height: 250,
|
||||||
autosize: true,
|
autosize: true,
|
||||||
showlegend: false,
|
showlegend: false,
|
||||||
@ -1114,13 +1139,33 @@ export class GraphListComponent implements OnInit {
|
|||||||
tickangle: -45,
|
tickangle: -45,
|
||||||
tickformat: tickformat,
|
tickformat: tickformat,
|
||||||
fixedrange: true,
|
fixedrange: true,
|
||||||
showgrid: true
|
domain: [0.2, 0.8]
|
||||||
|
// showgrid: true
|
||||||
},
|
},
|
||||||
yaxis: {
|
yaxis: {
|
||||||
title: 'Diff',
|
title: 'Cuckoo',
|
||||||
fixedrange: true,
|
fixedrange: true,
|
||||||
showgrid: true,
|
// showgrid: true,
|
||||||
range: range
|
// range: range
|
||||||
|
},
|
||||||
|
yaxis2: {
|
||||||
|
title: 'Progpow',
|
||||||
|
fixedrange: true,
|
||||||
|
// showgrid: true,
|
||||||
|
// range: range,
|
||||||
|
overlaying: 'y',
|
||||||
|
side: 'left',
|
||||||
|
position: 1.25
|
||||||
|
},
|
||||||
|
yaxis3: {
|
||||||
|
title: 'RandomX',
|
||||||
|
fixedrange: true,
|
||||||
|
// showgrid: true,
|
||||||
|
// range: range,
|
||||||
|
anchor: 'x',
|
||||||
|
overlaying: 'y',
|
||||||
|
side: 'right'
|
||||||
|
|
||||||
},
|
},
|
||||||
margin: {
|
margin: {
|
||||||
l: 50,
|
l: 50,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<div class="latest_table">
|
<div class="latest_table">
|
||||||
<h2 class="mb-3 chart_heading px-0">{{'home.LATEST_BLOCK' | translate}}</h2>
|
<h2 class="mb-3 chart_heading px-0">{{'home.LATEST_BLOCKS' | translate}}</h2>
|
||||||
<div class="mobile_table web_hdng">
|
<div class="mobile_table web_hdng">
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -46,9 +46,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div #block></div>
|
<div #block></div>
|
||||||
<!-- <ng-container #block></ng-container> -->
|
<ng-container *ngFor="let hashvalue of hashvalues">
|
||||||
<div [ngClass]="{mobile_table : true, hght_40: item.id != clickValue }"
|
<div *ngIf="hashvalue.target_difficulty_cuckatoo != '0'" [ngClass]="{mobile_table : true, hght_40: item.id != clickValue }"
|
||||||
id="hash_{{hashvalue.blockchain_block_height}}" #item *ngFor="let hashvalue of hashvalues">
|
id="hash_{{hashvalue.blockchain_block_height}}" #item >
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-6 col-md-3 tble_col">
|
<div class="col-6 col-md-3 tble_col">
|
||||||
@ -108,7 +108,7 @@
|
|||||||
</div> -->
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -163,7 +163,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="latest_table mt-3">
|
<div class="latest_table mt-3">
|
||||||
<h2 class="mb-3 chart_heading px-0">Peers</h2>
|
<h2 class="mb-3 chart_heading px-0 d-inline-block">Peers
|
||||||
|
<span *ngIf="peers && peers.length > 0" class="txn_count" >{{
|
||||||
|
peers.length | number
|
||||||
|
}}</span>
|
||||||
|
</h2>
|
||||||
<div class="mobile_table web_hdng">
|
<div class="mobile_table web_hdng">
|
||||||
|
|
||||||
<div class="mobile_table peer_table">
|
<div class="mobile_table peer_table">
|
||||||
|
@ -99,7 +99,11 @@ export class LatestblocksComponent implements OnInit {
|
|||||||
this.chartService.apiGetRequest('','/blockchain_kernel/getpeers').subscribe(
|
this.chartService.apiGetRequest('','/blockchain_kernel/getpeers').subscribe(
|
||||||
res => {
|
res => {
|
||||||
if (res['status'] == 200) {
|
if (res['status'] == 200) {
|
||||||
this.peers = res.response.dataJson;
|
let json = res.response.dataJson;
|
||||||
|
if(json && json.length > 0){
|
||||||
|
localStorage.setItem('peersJson',JSON.stringify(json));
|
||||||
|
}
|
||||||
|
this.peers = JSON.parse(localStorage.getItem('peersJson'));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error => {},
|
error => {},
|
||||||
|
Loading…
Reference in New Issue
Block a user