From 6af3fc8b9cbf30e8862605dde410ffc1ca13cacc Mon Sep 17 00:00:00 2001 From: coldstar Date: Tue, 25 May 2021 15:49:36 -0700 Subject: [PATCH] 05/25/2021 03:49:36 PM MST --- routes/baseActionsRouter.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/routes/baseActionsRouter.js b/routes/baseActionsRouter.js index 38f9969..1d99750 100755 --- a/routes/baseActionsRouter.js +++ b/routes/baseActionsRouter.js @@ -315,12 +315,18 @@ router.get("/address/:address", function(req, res) { res.locals.result = {}; - const { exec } = require('child_process'); var yourscript = exec('/usr/local/bin/vivo-cli -conf=/etc/masternodes/vivo_n1.conf getaddressbalance \'{\"addresses\": [\"' + address + '"]}\'', //var yourscript = exec('whoami', (error, stdout, stderr) => { console.log(stdout); + + const json = stdout; + const obj = JSON.parse(json); + + console.log(obj.balance); + console.log(obj.received); + console.log(stderr); if (error !== null) { console.log(`exec error: ${error}`);