Selaa lähdekoodia

05/25/2021 08:05:08 PM MST

master
coldstar 3 vuotta sitten
vanhempi
commit
f283aeaa34
1 muutettua tiedostoa jossa 10 lisäystä ja 3 poistoa
  1. +10
    -3
      routes/baseActionsRouter.js

+ 10
- 3
routes/baseActionsRouter.js Näytä tiedosto

@@ -307,6 +307,7 @@ router.get("/address/:address", function(req, res) {

var address = req.params.address;


res.locals.address = address;

console.log("address is:" + address);
@@ -316,6 +317,11 @@ router.get("/address/:address", function(req, res) {
res.locals.result = {};

const { exec } = require('child_process');

var balance = "Not Found";
var received = "Not Found";


var yourscript = exec('/usr/local/bin/vivo-cli -conf=/etc/masternodes/vivo_n1.conf getaddressbalance \'{\"addresses\": [\"' + address + '"]}\'',
//var yourscript = exec('whoami',
(error, stdout, stderr) => {
@@ -327,11 +333,12 @@ router.get("/address/:address", function(req, res) {
console.log(obj.balance);
console.log(obj.received);

res.locals.address = obj.address;
res.locals.balance = obj.balance;
res.locals.received = obj.received;
balance = obj.balance;
received = obj.received;

console.log(stderr);

if (error !== null) {
console.log(`exec error: ${error}`);
}


Loading…
Peruuta
Tallenna