Changes
This commit is contained in:
parent
cfa2a7f0bf
commit
6652ee583b
@ -16,7 +16,7 @@ import {
|
||||
TransactionFeeDto,
|
||||
} from '../dtos';
|
||||
import { Paginate } from '../utils';
|
||||
const https = require('https');
|
||||
const http = require('http');
|
||||
|
||||
var moment = require('moment');
|
||||
|
||||
@ -490,10 +490,10 @@ export class BlockchainKernelController {
|
||||
lang: lang
|
||||
},
|
||||
}); */
|
||||
console.log(path.resolve(__dirname + '/../i18n/'+request.query.lang+'.json'));
|
||||
console.log("Without :",path.resolve('/../i18n/'+request.query.lang+'.json'));
|
||||
response.header("Content-Type",'application/json');
|
||||
response.sendFile(path.resolve(__dirname + '/../i18n/'+request.query.lang+'.json'));
|
||||
console.log(path.resolve(__dirname + '/../i18n/' + request.query.lang + '.json'));
|
||||
console.log("Without :", path.resolve('/../i18n/' + request.query.lang + '.json'));
|
||||
response.header("Content-Type", 'application/json');
|
||||
response.sendFile(path.resolve(__dirname + '/../i18n/' + request.query.lang + '.json'));
|
||||
|
||||
} catch (error) {
|
||||
next(new InternalServerErrorException(error));
|
||||
@ -506,14 +506,29 @@ export class BlockchainKernelController {
|
||||
next: NextFunction,
|
||||
) => {
|
||||
try {
|
||||
https.get('http://5.9.174.122:3413/v1/peers/connected', (resp) => {
|
||||
console.log('resp resp respresp',resp);
|
||||
http.get('http://5.9.174.122:3413/v1/peers/connected', (resp) => {
|
||||
// console.log('resp resp respresp',resp);
|
||||
let data = '';
|
||||
|
||||
// A chunk of data has been recieved.
|
||||
|
||||
});
|
||||
resp.on('data', function (chunk) {
|
||||
data += chunk;
|
||||
let dataJson = JSON.parse(data);
|
||||
dataJson.forEach(function (value, i) {
|
||||
value['id'] = i;
|
||||
});
|
||||
response.status(200).json({
|
||||
status: 200,
|
||||
timestamp: Date.now(),
|
||||
message: 'Peers list fetched successfully',
|
||||
response: {
|
||||
dataJson
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
} catch (error) {
|
||||
console.log('error 3###########', error);
|
||||
next(new InternalServerErrorException(error));
|
||||
}
|
||||
};
|
||||
|
@ -272,9 +272,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 col-md-3 tble_col">
|
||||
<div class="block_div">
|
||||
<div class="block_div" title="Cuckaroo : {{ peer.total_difficulty.cuckaroo | number }}, Cuckatoo : {{ peer.total_difficulty.cuckatoo | number }}, Progpow : {{ peer.total_difficulty.progpow | number }}, Randomx : {{ peer.total_difficulty.randomx | number }}">
|
||||
<h6>Total Difficulty</h6>
|
||||
<span class="blck_value">{{ peer.total_difficulty.cuckaroo }},{{ peer.total_difficulty.cuckatoo}},{{ peer.total_difficulty.randomx}},{{ peer.total_difficulty.progpow}}</span>
|
||||
<span class="blck_value peers_diff">{{ peer.total_difficulty.cuckaroo }},{{ peer.total_difficulty.cuckatoo}},{{ peer.total_difficulty.progpow}},{{ peer.total_difficulty.randomx}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -47,21 +47,15 @@ export class LatestblocksComponent implements OnInit {
|
||||
}
|
||||
|
||||
public getpeersList() {
|
||||
const httpOptions = {
|
||||
headers: new HttpHeaders({
|
||||
'Access-Control-Allow-Origin':'*'
|
||||
})
|
||||
};
|
||||
|
||||
this.http
|
||||
.get('http://5.9.174.122:3413/v1/peers/connected',httpOptions)
|
||||
.subscribe((res) => {
|
||||
console.log('reeeee',res);
|
||||
// this.peers = res;
|
||||
|
||||
console.log('this.peers',this.peers);
|
||||
});
|
||||
this.peers = [{"id": 1,"capabilities":{"bits":15},"user_agent":"MW/Epic 1.0.0","version":1,"addr":"54.233.177.64:3414","direction":"Outbound","total_difficulty":{"cuckaroo":1630,"cuckatoo":706,"randomx":138024,"progpow":49792},"height":10},{"id": 2,"capabilities":{"bits":15},"user_agent":"MW/Epic 1.0.0","version":1,"addr":"95.216.102.217:3414","direction":"Outbound","total_difficulty":{"cuckaroo":1630,"cuckatoo":706,"randomx":138024,"progpow":49792},"height":10},{"id": 3,"capabilities":{"bits":15},"user_agent":"MW/Epic 1.0.0","version":1,"addr":"90.190.172.177:3414","direction":"Outbound","total_difficulty":{"cuckaroo":2,"cuckatoo":2,"randomx":1024,"progpow":256},"height":0},{"id": 4,"capabilities":{"bits":15},"user_agent":"MW/Epic 1.0.0","version":1,"addr":"67.189.82.196:3414","direction":"Outbound","total_difficulty":{"cuckaroo":1630,"cuckatoo":706,"randomx":138024,"progpow":49792},"height":10},{"id": 5,"capabilities":{"bits":15},"user_agent":"MW/Epic 1.0.0","version":1,"addr":"167.71.72.2:3414","direction":"Outbound","total_difficulty":{"cuckaroo":1630,"cuckatoo":706,"randomx":138024,"progpow":49792},"height":10}];
|
||||
this.chartService.apiGetRequest('','/blockchain_kernel/getpeers').subscribe(
|
||||
res => {
|
||||
if (res['status'] == 200) {
|
||||
this.peers = res.response.dataJson;
|
||||
}
|
||||
},
|
||||
error => {},
|
||||
);
|
||||
// this.peers = [{"id": 1,"capabilities":{"bits":15},"user_agent":"MW/Epic 1.0.0","version":1,"addr":"54.233.177.64:3414","direction":"Outbound","total_difficulty":{"cuckaroo":1630,"cuckatoo":706,"randomx":138024,"progpow":49792},"height":10},{"id": 2,"capabilities":{"bits":15},"user_agent":"MW/Epic 1.0.0","version":1,"addr":"95.216.102.217:3414","direction":"Outbound","total_difficulty":{"cuckaroo":1630,"cuckatoo":706,"randomx":138024,"progpow":49792},"height":10},{"id": 3,"capabilities":{"bits":15},"user_agent":"MW/Epic 1.0.0","version":1,"addr":"90.190.172.177:3414","direction":"Outbound","total_difficulty":{"cuckaroo":2,"cuckatoo":2,"randomx":1024,"progpow":256},"height":0},{"id": 4,"capabilities":{"bits":15},"user_agent":"MW/Epic 1.0.0","version":1,"addr":"67.189.82.196:3414","direction":"Outbound","total_difficulty":{"cuckaroo":1630,"cuckatoo":706,"randomx":138024,"progpow":49792},"height":10},{"id": 5,"capabilities":{"bits":15},"user_agent":"MW/Epic 1.0.0","version":1,"addr":"167.71.72.2:3414","direction":"Outbound","total_difficulty":{"cuckaroo":1630,"cuckatoo":706,"randomx":138024,"progpow":49792},"height":10}];
|
||||
}
|
||||
|
||||
|
||||
|
@ -632,3 +632,9 @@ margin-right: 10px;
|
||||
min-width: 5rem;
|
||||
padding: 0;
|
||||
}
|
||||
.peers_diff{
|
||||
width: 160px;
|
||||
overflow: hidden;
|
||||
display: inline-block;
|
||||
text-overflow: ellipsis;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user