Peer url updated
This commit is contained in:
parent
5fc8a380fb
commit
3d9cf6c292
@ -559,7 +559,12 @@ export class BlockchainKernelController {
|
||||
) => {
|
||||
var self = this;
|
||||
try {
|
||||
http.get('http://116.203.152.58:13413/v1/peers/connected',
|
||||
if(Global.network == "Floonet"){
|
||||
var peer_url = process.env.FLOONET_PEER_URL;
|
||||
}else{
|
||||
var peer_url = process.env.TESTNET_PEER_URL;
|
||||
}
|
||||
http.get(peer_url,
|
||||
async (resp) => {
|
||||
// console.log('resp resp respresp',resp);
|
||||
let data = '';
|
||||
|
@ -10,7 +10,11 @@ export function validationMiddleware<T>(
|
||||
skipMissingProperties = false,
|
||||
): express.RequestHandler {
|
||||
return (request: Request, response: Response, next: NextFunction) => {
|
||||
if(request.headers.network){
|
||||
Global.network = request.headers.network;
|
||||
}else{
|
||||
Global.network = 'Floonet';
|
||||
}
|
||||
validate(
|
||||
plainToClass(type, {
|
||||
...request.body,
|
||||
|
@ -101,9 +101,17 @@ export class LatestblocksComponent implements OnInit {
|
||||
if (res['status'] == 200) {
|
||||
let json = res.response.dataJson;
|
||||
if(json && json.length > 0){
|
||||
localStorage.setItem('peersJson',JSON.stringify(json));
|
||||
if(localStorage.getItem('network') == "Testnet"){
|
||||
localStorage.setItem('peersJson_Testnet',JSON.stringify(json));
|
||||
}else{
|
||||
localStorage.setItem('peersJson_Floonet',JSON.stringify(json));
|
||||
}
|
||||
}
|
||||
if(localStorage.getItem('network') == "Testnet"){
|
||||
this.peers = JSON.parse(localStorage.getItem('peersJson_Testnet'));
|
||||
}else{
|
||||
this.peers = JSON.parse(localStorage.getItem('peersJson_Floonet'));
|
||||
}
|
||||
this.peers = JSON.parse(localStorage.getItem('peersJson'));
|
||||
}
|
||||
},
|
||||
error => {},
|
||||
|
Loading…
Reference in New Issue
Block a user