Преглед изворни кода

05/25/2021 03:18:15 PM MST

master
coldstar пре 3 година
родитељ
комит
db2ac6ae54
1 измењених фајлова са 33 додато и 16 уклоњено
  1. +33
    -16
      routes/baseActionsRouter.js

+ 33
- 16
routes/baseActionsRouter.js Прегледај датотеку

@@ -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");



Loading…
Откажи
Сачувај