Skip to content

Commit

Permalink
changes for DVS
Browse files Browse the repository at this point in the history
  • Loading branch information
devdavies committed Aug 15, 2018
1 parent f9308e4 commit 60c0064
Show file tree
Hide file tree
Showing 7 changed files with 145 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ typings/


public/css/radial-progress.css
/.project
4 changes: 2 additions & 2 deletions app/api/mockApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ var config = require("../config.js");
var coins = require("../coins.js");

var SHA256 = require("crypto-js/sha256");
var earliestBlockTime = 1231006505;
var earliestBlockTime = 1529517603;
var avgBlockTime = 200000;
var currentBlockHeight = 1234567;
var currentBlockHeight = 329;


function getBlockchainInfo() {
Expand Down
6 changes: 4 additions & 2 deletions app/coins.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
var btc = require("./coins/btc.js");
var ltc = require("./coins/ltc.js");
var dvs = require("./coins/dvs.js");

module.exports = {
"BTC": btc,
"LTC": ltc
};
"LTC": ltc,
"DVS": dvs
};
134 changes: 134 additions & 0 deletions app/coins/dvs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
var Decimal = require("decimal.js");
Decimal8 = Decimal.clone({ precision:8, rounding:8 });

module.exports = {
name:"Davies",
logoUrl:"/img/logo/ltc.svg",
siteTitle:"Davies Explorer",
nodeTitle:"Davies Full Node",
nodeUrl:"https://daviescoin.io/",
demoSiteUrl: "https://explorer.daviescoin.io",
miningPoolsConfigUrls:[
"https://raw.githubusercontent.com/hashstream/pools/master/pools.json",
],
maxBlockWeight: 4000000,
currencyUnits:[
{
name:"DVS",
multiplier:1,
default:true,
values:["", "dvs", "DVS"],
decimalPlaces:8
},
{
name:"lite",
multiplier:1000,
values:["lite"],
decimalPlaces:5
},
{
name:"photon",
multiplier:1000000,
values:["photon"],
decimalPlaces:2
},
{
name:"litoshi",
multiplier:100000000,
values:["litoshi", "lit"],
decimalPlaces:0
}
],
feeSatoshiPerByteBucketMaxima: [5, 10, 25, 50, 100, 150, 200, 250],
genesisBlockHash: "f0f28695c029b93bfc0f7b75fa85cb742573b12a221fd9ec02f4207308f021ef",
genesisCoinbaseTransactionId: "f36a59601eb663a4aed9c4c3290dd619f94b62737bccafd6b13263fbddeb97cf",
genesisCoinbaseTransaction: {
"txid":"f36a59601eb663a4aed9c4c3290dd619f94b62737bccafd6b13263fbddeb97cf",
"hash":"f36a59601eb663a4aed9c4c3290dd619f94b62737bccafd6b13263fbddeb97cf",
"blockhash":"f0f28695c029b93bfc0f7b75fa85cb742573b12a221fd9ec02f4207308f021ef",
"version":1,
"locktime":0,
"size":176,
"vsize":176,
"time":1529517603,
"blocktime":1529517603,
"vin":[
{
"prev_out":{
"hash":"0000000000000000000000000000000000000000000000000000000000000000",
"n":0
},
"coinbase":"04ffff001d01042932302f4a756e2f323031382044656d6f63726174696320436f696e20666f722074686520576f726c64"
}
],
"vout":[
{
"value":"50.00000000",
"n":0,
"scriptPubKey":{
"hex":"040184710fa689ad5023690c80f3a49c8f13f8d45b8c857fbcbc8bc4a8e4d3eb4b10f4d4604fa08dce601aaf0f470216fe1b51850b4acf21b179c45070ac7b03a9 OP_CHECKSIG",
"type":"pubkey",
"reqSigs":1,
"addresses":[
"Ecn1Wjgv2EbYvGBEExPF7uvaNrc648XZU1"
]
}
}
]
},
historicalData: [
// {
// type: "blockheight",
// date: "2011-10-07",
// blockHeight: 0,
// blockHash: "12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2",
// summary: "The Litecoin genesis block.",
// alertBodyHtml: "This is the first block in the Litecoin blockchain.",
// referenceUrl: "https://medium.com/@SatoshiLite/satoshilite-1e2dad89a017"
// },
// {
// type: "tx",
// date: "2017-05-10",
// txid: "ce385e55fb2a73fa438426145b074f08314812fa3396472dc572b3079e26e0f9",
// summary: "First SegWit transaction.",
// referenceUrl: "https://twitter.com/satoshilite/status/862345830082138113"
// },
// {
// type: "blockheight",
// date: "2011-10-13",
// blockHeight: 448,
// blockHash: "6995d69ce2cb7768ef27f55e02dd1772d452deb44e1716bb1dd9c29409edf252",
// summary: "The first block containing a (non-coinbase) transaction.",
// referenceUrl: ""
// },
// {
// type: "link",
// date: "2016-05-02",
// url: "/rpc-browser?method=verifymessage&args%5B0%5D=Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2&args%5B1%5D=G7W57QZ1jevRhBp7SajpcUgJiGs998R4AdBjcIgJq5BOECh4jHNatZKCFLQeo9PvZLf60ykR32XjT4IrUi9PtCU%3D&args%5B2%5D=I%2C+Charlie+Lee%2C+am+the+creator+of+Litecoin&execute=Execute",
// summary: "Litecoin's Proof-of-Creator",
// referenceUrl: "https://medium.com/@SatoshiLite/satoshilite-1e2dad89a017"
// }
],
exchangeRateData:{
jsonUrl:"https://api.coinmarketcap.com/v1/ticker/Litecoin/",
exchangedCurrencyName:"usd",
responseBodySelectorFunction:function(responseBody) {
if (responseBody[0] && responseBody[0].price_usd) {
return responseBody[0].price_usd;
}

return -1;
}
},
blockRewardFunction:function(blockHeight) {
var eras = [ new Decimal8(50) ];
for (var i = 1; i < 34; i++) {
var previous = eras[i - 1];
eras.push(new Decimal8(previous).dividedBy(2));
}

var index = Math.floor(blockHeight / 840000);

return eras[index];
}
};
2 changes: 1 addition & 1 deletion app/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var credentials = require("./credentials.js");
var coins = require("./coins.js");

var currentCoin = "BTC";
var currentCoin = "DVS";

module.exports = {
cookiePassword: "0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
Expand Down
2 changes: 1 addition & 1 deletion app/credentials.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {

rpc: {
host:"localhost",
port:8332,
port:10000,
username:"username",
password:"password"
},
Expand Down
4 changes: 2 additions & 2 deletions routes/baseActionsRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
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]));
}
Expand Down

0 comments on commit 60c0064

Please sign in to comment.