|
|
@@ -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}`); |
|
|
|
} |
|
|
|