Permalink
Browse files

changes for Davies

  • Loading branch information...
devdavies committed Aug 27, 2018
1 parent 60c0064 commit cb1c8ea02ebada60f832303f934eca36d26bac89
Showing with 33 additions and 13 deletions.
  1. +4 −4 app/coins/dvs.js
  2. +5 −3 app/config.js
  3. BIN public/img/logo/dvs.png
  4. +24 −6 routes/baseActionsRouter.js
@@ -3,7 +3,7 @@ Decimal8 = Decimal.clone({ precision:8, rounding:8 });

module.exports = {
name:"Davies",
logoUrl:"/img/logo/ltc.svg",
logoUrl:"/img/logo/dvs.png",
siteTitle:"Davies Explorer",
nodeTitle:"Davies Full Node",
nodeUrl:"https://daviescoin.io/",
@@ -110,11 +110,11 @@ module.exports = {
// }
],
exchangeRateData:{
jsonUrl:"https://api.coinmarketcap.com/v1/ticker/Litecoin/",
jsonUrl:"https://api.coinmarketcap.com/v2/ticker/",
exchangedCurrencyName:"usd",
responseBodySelectorFunction:function(responseBody) {
if (responseBody[0] && responseBody[0].price_usd) {
return responseBody[0].price_usd;
return 0;// responseBody[0].price_usd;
}

return -1;
@@ -131,4 +131,4 @@ module.exports = {

return eras[index];
}
};
};
@@ -5,7 +5,7 @@ var currentCoin = "DVS";

module.exports = {
cookiePassword: "0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
demoSite: true,
demoSite: false,
coin: currentCoin,

rpcBlacklist:[
@@ -29,7 +29,9 @@ module.exports = {
"walletpassphrase",
"walletpassphrasechange",
"verifychain",
"pruneblockchain"
"pruneblockchain",
"generate",
"generatetoaddress"
],

site: {
@@ -42,7 +44,7 @@ module.exports = {

// Edit "ipWhitelistForRpcCommands" regex to limit access to RPC Browser / Terminal to matching IPs
ipWhitelistForRpcCommands:/^(127\.0\.0\.1)?(\:\:1)?$/,

//ipWhitelistForRpcCommands:/^(\:\:1)/,
siteTools:[
{name:"Node Status", url:"/node-status", desc:"Summary of this node: version, network, uptime, etc.", fontawesome:"fas fa-broadcast-tower"},
{name:"Peers", url:"/peers", desc:"Detailed info about the peers connected to this node.", fontawesome:"fas fa-sitemap"},
Binary file not shown.
@@ -38,8 +38,8 @@ router.get("/", function(req, res) {
promises.push(coreApi.getMempoolInfo());
promises.push(coreApi.getMiningInfo());

var chainTxStatsIntervals = [ 144/*, 144 * 7, 144 * 30, 144 * 265 */]; //TOOD: add this back when we have enough blocks
res.locals.chainTxStatsLabels = [ "24 hours"/*, "1 week", "1 month", "1 year", "All time" */];
var chainTxStatsIntervals = [ 144, 144 * 7, /*144 * 30, 144 * 265 */]; //TOOD: add this back when we have enough blocks
res.locals.chainTxStatsLabels = [ "24 hours", "1 week", /*"1 month", "1 year", "All time" */];
for (var i = 0; i < chainTxStatsIntervals.length; i++) {
promises.push(coreApi.getChainTxStats(chainTxStatsIntervals[i]));
}
@@ -525,6 +525,24 @@ router.get("/address/:address", function(req, res) {
});
});

router.get("/txoutsetinfo", function(req, res) {
client.command([{method:"gettxoutsetinfo"}], function(err, result, resHeaders) {
if(err) {
res.write(JSON.stringify(err, null, 4), function() {
res.end();
});
} else if(result) {
res.write(JSON.stringify(result, null, 4), function() {
res.end();
});
} else {
res.write(JSON.stringify({"Error":"No response from node"}, null, 4), function() {
res.end();
});
}
});
});

router.get("/rpc-terminal", function(req, res) {
if (!config.demoSite) {
var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
@@ -599,16 +617,16 @@ router.post("/rpc-terminal", function(req, res) {
});

router.get("/rpc-browser", function(req, res) {
if (!config.demoSite) {
/*if (!config.demoSite) {
var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
var match = config.ipWhitelistForRpcCommands.exec(ip);
if (!match) {
res.send("RPC Terminal / Browser may not be accessed from '" + ip + "'. This restriction can be modified in your config.js file.");

// res.send("RPC Terminal / Browser may not be accessed from '" + ip + "'. This restriction can be modified in your config.js file.");
res.render("browser");
return;
}
}
}*/

coreApi.getHelp().then(function(result) {
res.locals.gethelp = result;

0 comments on commit cb1c8ea

Please sign in to comment.