Browse Source

05/25/2021 02:36:32 PM MST

master
coldstar 3 years ago
parent
commit
687f95a885
2 changed files with 52 additions and 33 deletions
  1. +30
    -29
      package.json
  2. +22
    -4
      routes/baseActionsRouter.js

+ 30
- 29
package.json View File

@@ -1,30 +1,31 @@
{
"name": "rpc-explorer",
"version": "1.0.0",
"scripts": {
"start": "node ./bin/www"
},
"repository": {
"type": "git",
"url": "https://github.com/smartcash/rpc-explorer.git"
},
"dependencies": {
"bitcoin": "3.0.1",
"body-parser": "~1.16.0",
"cookie-parser": "~1.4.3",
"crypto-js": "3.1.9-1",
"debug": "~2.6.0",
"decimal.js": "7.2.3",
"express": "~4.14.1",
"express-session": "1.15.2",
"jstransformer-markdown-it": "^2.0.0",
"moment": "^2.18.1",
"moment-duration-format": "1.3.0",
"monk": "^4.0.0",
"morgan": "~1.7.0",
"pug": "2.0.0-rc.2",
"serve-favicon": "~2.3.2",
"simple-git": "1.73.0"
},
"license": "MIT"
}
"name": "vivo-explorer",
"version": "1.0.0",
"scripts": {
"start": "node ./bin/www"
},
"repository": {
"type": "git",
"url": "https://gt.clarifylife.net/ddp/vivo-explorer.git"
},
"dependencies": {
"bitcoin": "3.0.1",
"body-parser": "~1.16.0",
"cookie-parser": "~1.4.3",
"crypto-js": "3.1.9-1",
"debug": "~2.6.0",
"decimal.js": "7.2.3",
"express": "~4.14.1",
"express-session": "1.15.2",
"jstransformer-markdown-it": "^2.0.0",
"moment": "^2.18.1",
"moment-duration-format": "1.3.0",
"monk": "^4.0.0",
"morgan": "~1.7.0",
"pug": "2.0.0-rc.2",
"serve-favicon": "~2.3.2",
"simple-git": "1.73.0",
"exec-sync": "0.1.6"
},
"license": "MIT"
}

+ 22
- 4
routes/baseActionsRouter.js View File

@@ -309,13 +309,31 @@ router.get("/address/:address", function(req, res) {

res.locals.result = {};

// TODO handle RPC error
rpcApi.getBalance(client, address).then(function(result) {
res.locals.result.address = result.address;

res.render("address");
const { spawn } = require("child_process");

const ls = spawn("/usr/local/bin/vivo-cli -conf=/etc/masternodes/vivo_n1.conf", [" \'{\"addresses\": [\"" + address + "\"]}\'"]);

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

});

router.get("/tx/:transactionId", function(req, res) {
var txid = req.params.transactionId;



Loading…
Cancel
Save