|
|
@@ -310,29 +310,46 @@ router.get("/address/:address", function(req, res) { |
|
|
|
res.locals.address = address; |
|
|
|
|
|
|
|
console.log("address is:" + address); |
|
|
|
//res.locals.result = {}; |
|
|
|
res.locals.result = {}; |
|
|
|
|
|
|
|
const { spawn } = require("child_process"); |
|
|
|
|
|
|
|
//const ls = spawn("/usr/local/bin/vivo-cli", [" -conf=/etc/masternodes/vivo_n1.conf \'{\"addresses\": [\"" + address + "\"]}\'"]); |
|
|
|
const { exec } = require('child_process'); |
|
|
|
var yourscript = exec('/usr/local/bin/vivo-cli", [" -conf=/etc/masternodes/vivo_n1.conf getaddressbalance \'{\"addresses\": [\"" + address + "\"]}\'', |
|
|
|
(error, stdout, stderr) => { |
|
|
|
console.log(stdout); |
|
|
|
console.log(stderr); |
|
|
|
if (error !== null) { |
|
|
|
console.log(`exec error: ${error}`); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
const ls = spawn("ls", "-lah"); |
|
|
|
|
|
|
|
ls.stdout.on("data", data => { |
|
|
|
console.log(`stdout: ${data}`); |
|
|
|
}); |
|
|
|
/* |
|
|
|
const { spawn } = require("child_process"); |
|
|
|
|
|
|
|
ls.stderr.on("data", data => { |
|
|
|
console.log(`stderr: ${data}`); |
|
|
|
}); |
|
|
|
//const ls = spawn("/usr/local/bin/vivo-cli", [" -conf=/etc/masternodes/vivo_n1.conf \'{\"addresses\": [\"" + address + "\"]}\'"]); |
|
|
|
|
|
|
|
ls.on('error', (error) => { |
|
|
|
console.log(`error: ${error.message}`); |
|
|
|
}); |
|
|
|
|
|
|
|
ls.on("close", code => { |
|
|
|
console.log(`child process exited with code ${code}`); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const ls = spawn("ls", "-lah"); |
|
|
|
|
|
|
|
ls.stdout.on("data", data => { |
|
|
|
console.log(`stdout: ${data}`); |
|
|
|
}); |
|
|
|
|
|
|
|
ls.stderr.on("data", data => { |
|
|
|
console.log(`stderr: ${data}`); |
|
|
|
}); |
|
|
|
|
|
|
|
ls.on('error', (error) => { |
|
|
|
console.log(`error: ${error.message}`); |
|
|
|
}); |
|
|
|
|
|
|
|
ls.on("close", code => { |
|
|
|
console.log(`child process exited with code ${code}`); |
|
|
|
}); |
|
|
|
*/ |
|
|
|
|
|
|
|
//res.render("address"); |
|
|
|
|
|
|
|