소스 검색

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



불러오는 중...
취소
저장