Navigation Menu

Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Tool updated, Readme updated
Browse files Browse the repository at this point in the history
  • Loading branch information
AgriG33k committed Aug 17, 2018
1 parent e0a840b commit 0f2f485
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 63 deletions.
12 changes: 11 additions & 1 deletion README.md
Expand Up @@ -7,7 +7,7 @@ JavaScript-based Proof-Of-Stake (POS) reward calculator for Peercoin (PPC), also

Created by FuzzyBear of [Peercointalk](http://peercointalk.org/).

This is still in the development and testing phase.
After 4 years of testing, tool is now in version 1.

## Helping Out

Expand All @@ -31,6 +31,16 @@ The current reward for the next tip is shown above. You will receive that amount

## Changelog

### v1.0

* POS difficulty is retrieved directly from the [Peercoin explorer](https://explorer.peercoin.net/)
* Recast of the explanation texts
* Translation of no-javascript text and link to how-to enable javascript guide added
* Minor code improvements
* Useless code deleted
* Favicon updated
* Dependencies updated

### v0.0.1

* Enable calculating the probability of minting a block within 10 minutes, 1 day, 31 days, 90 days and 1 year.
Expand Down
99 changes: 50 additions & 49 deletions index.html
Expand Up @@ -2,8 +2,8 @@
<html>
<head>
<meta charset=utf-8>
<title id=title>Ohm POS Calculator</title>
<link rel=icon href="data:image/vnd.microsoft.icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A7PT4Mszm8pmw3e3bltjr+ofZ6vqM4O3bq+jxmebz9zL///8A////AP///wD///8A////AP///wD6/P0Jy+fzmqjc8P2O0+n9edXp/XDf7/1s6fX9Z+z3/WDq9v1T5vP9oefwm/r7/Qn///8A////AP///wD6+/0Jwef0wZLS6f1esdP9SKbD/0Kmv/8/r8b/P8bc/0Hd7/9F6vf/WfL7/V/u+f2a6PDB+vv9Cf///wD///8A0Ov2mYfQ6v1FmMX9O5TC/zS51f890N//SfX+/y2hvv81wt//PtHo/0/h8f9q7/n9kvH5/c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AAAAACAAQAAgAEAAMADAADgBwAA+B8AAA==">
<title id=title>PPC POS Calculator</title>
<link rel=icon href="https://peercoin.net/favicon.ico">
<style>
/* CSS based on peercoin.net by super3 and other contributors */

Expand Down Expand Up @@ -32,81 +32,87 @@
}

</style>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="translations.js"></script>

</head>
<body>
<div id="wrap">
<header>
<noscript>
<section id="noscript-padding"></section>
</noscript>

<section id="languages">
<label id="header_prefix">Languages:</label>
<span id="header_prefix">Languages:</span>
<a href="#" onclick="translate_page('en')">English</a>
<a href="#" onclick="translate_page('de')">Deutsch</a>
<a href="#" onclick="translate_page('es')">Español</a>
<a href="#" onclick="translate_page('fr')">Français</a>
<!--
Translations needed in translate.js
<a href="#" onclick="translate_page('nl')">Nederlands</a>
<a href="#" onclick="translate_page('ru')">русский</a>
<a href="#" onclick="translate_page('zh-cn')">简体中文</a>
<a href="#" onclick="translate_page('cs')">Česky</a>
<a href="#" onclick="translate_page('no')">Norsk</a>
<a href="#" onclick="translate_page('no')">Norsk</a>
-->
</section>
<h1><label id="header_title">Peercoin Proof-Of-Stake (POS) Calculator v0.0.1</label></h1>

<h1 id="header_title">Peercoin Proof-Of-Stake (POS) Calculator v1.0</h1>

</header>
<article id="content">
<p>
<span><label id="intro">Currently we are still in the very early stages... so there is only some basic functions, but you can:</label></span>
<p id="intro">This tool does only one thing but it does it well: calculate probability to generate a POS Peercoin block. You can adjust:</p>
<ul>
<li><label id="desc1">Enter the amount of coins you sent in a transaction, the number of days that have passed and the POS difficulty to get a readout.</label>
<li><label id="desc2">The probability of minting a block reaches its maximum after 90 days and doesn't increase after that.</label>
<li><label id="desc3">The POS difficulty value can be obtained from the console window of ppcoin-qt, you can get it with the command: getdifficulty. Or, if you have ppcoind running, in a command prompt: ppcoind getdifficulty.</label>
<li><label id="desc4">More features to come soon...</label>
<li id="desc1">The amount of coins you sent in a transaction</li>
<li id="desc2">The number of days that have passed. The probability of minting is null before 30 days and reaches its maximum after 90 days and doesn't increase after that.</li>
<li id="desc3">The POS difficulty to get a readout. At launch, tool gets the last value for POS difficulty directly from the Peercoin blockchain.</li>
</ul>
<br>
<table>
<tr>
<td><label id="entry_coins">Number Of Coins</label></td>
<td id="entry_coins">Number Of Coins</td>
<td><input type="number" id="NumberOfCoinsStart" value="1000" onBlur="return is_int(this)"></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><label id="entry_days">Age of transaction (days)</label></td>
<td id="entry_days">Age of transaction (days)</td>
<td><input type="number" id="AgeOfTransaction" value="31"></td>
<td style="color:red;font-size:80%" id="AgeOfTransaction_error">Probability maxed at 90 days</td>
</tr>
<tr>
<td><label id="entry_difficulty">POS difficulty</label></td>
<td id="entry_difficulty">POS difficulty</td>
<td><input type="number" id="POSDifficulty" value="10"></td>
<td>&nbsp;</td>
</tr>
</table>
<br>
<table class=result>
<tr>
<th><label id="prob_mint">Minting POS block within</label></th>
<th><label id="prob_10m">10 min</label></th>
<th><label id="prob_24h">24 hours</label></th>
<th><label id="prob_31d">31 days</label></th>
<th><label id="prob_90d">90 days</label></th>
<th><label id="prob_1y">1 year</label></th>
<th id="prob_mint">Minting POS block within</th>
<th id="prob_10m">10 min</th>
<th id="prob_24h">24 hours</th>
<th id="prob_31d">31 days</th>
<th id="prob_90d">90 days</th>
<th id="prob_1y">1 year</th>
</tr>
<tr>
<th><label id="prob_prob">Probability</label></th>
<td class=num><label id="probNextBlock"></label></td>
<td class=num><label id="probBlockToday"></label></td>
<td class=num><label id="probBlock31d"></label></td>
<td class=num><label id="probBlock90d"></label></td>
<td class=num><label id="probBlockYear"></label></td>
<th id="prob_prob">Probability</th>
<td class=num id="probNextBlock"></td>
<td class=num id="probBlockToday"></td>
<td class=num id="probBlock31d"></td>
<td class=num id="probBlock90d"></td>
<td class=num id="probBlockYear"></td>
</tr>
<tr>
<th><label id="reward_block">Reward</label></td>
<td class=num><label id="rewardNextBlock"></label></td>
<td class=num><label id="rewardBlockToday"></label></td>
<td class=num><label id="rewardBlock31d"></label></td>
<td class=num><label id="rewardBlock90d"></label></td>
<td class=num><label id="rewardBlockYear"></label></td>
<th id="reward_block">Reward</td>
<td class=num id="rewardNextBlock"></td>
<td class=num id="rewardBlockToday"></td>
<td class=num id="rewardBlock31d"></td>
<td class=num id="rewardBlock90d"></td>
<td class=num id="rewardBlockYear"></td>
</tr>
</table>
<br>
Expand All @@ -117,11 +123,13 @@ <h1><label id="header_title">Peercoin Proof-Of-Stake (POS) Calculator v0.0.1</la
<a id="footer_github" href="https://github.com/FuzzyBearBTC/peercoin-POSCalculator" target="_blank">Contribute to this project on GitHub</a>
</footer>
</div>

<noscript>
<section id=noscript>
<p>Peercoin POS Calculator requires JavaScript. Please enable it in your browser and refresh.
<p id="noscript-text">Peercoin POS Calculator requires JavaScript. Please enable it in your browser and refresh.</p>
</section>
</noscript>

<script>
var is_int = function(value) {
return ((parseFloat(value) === parseInt(value)) && !isNaN(value));
Expand Down Expand Up @@ -256,21 +264,14 @@ <h1><label id="header_title">Peercoin Proof-Of-Stake (POS) Calculator v0.0.1</la
// Because it runs dynamically, it should run at least once initially
run();

// Dynamically pull the current POS difficulty using peerchain's api and YQL to bypass cross-origin-request restrictions.
// This doesn't currently work, but could be replaced with a different API call later. Leaving this in for now.
//$.ajax({
// url: "http://query.yahooapis.com/v1/public/yql",
// jsonp: "callback",
// dataType: "jsonp",
// data: {
// q: "select * from json where url=\"http://peerchain.net/api/network/last\"",
// format: "json"
// },
// success: function( response ) {
// difficultyInput.value = response.query.results.json.pos_difficulty;
// run();
// }
//});
$.ajax({
url: "https://explorer.peercoin.net/api/getdifficulty",
dataType: "json",
success: function( response ) {
difficultyInput.value = response["proof-of-stake"];
run();
}
});

</script>

Expand Down
26 changes: 13 additions & 13 deletions translations.js
Expand Up @@ -4,10 +4,10 @@ var translations = {
"header_prefix": "Languages: ",
"header_title": "Peercoin Proof-Of-Stake (POS) Calculator v1.0",
"intro": "This tool does only one thing but it does it well: calculate probability to generate a POS Peercoin block. You can adjust:",
"desc1": "The amount of coins you sent in a transaction, the number of days that have passed and the POS difficulty to get a readout.",
"desc2": "The probability of minting is null before 30 days and reaches its maximum after 90 days and doesn't increase after that.",
"desc3": "At laucnh, tool gets the last value for POS difficulty directly from the Peercoin blockchain.",
"entry_coins": "Number Of coins",
"desc1": "The amount of coins you sent in a transaction",
"desc2": "The number of days that have passed. The probability of minting is null before 30 days and reaches its maximum after 90 days and doesn't increase after that",
"desc3": "The POS difficulty to get a readout. At launch, tool gets the last value for POS difficulty directly from the Peercoin blockchain",
"entry_coins": "Number of coins",
"entry_days": "Age of transaction (days)",
"entry_difficulty": "POS difficulty",
"prob_mint": "Minting POS block within",
Expand All @@ -28,9 +28,9 @@ var translations = {
"header_prefix": "Sprachen: ",
"header_title": "Peercoin Nachweis-der-Beteiligung (POS) Rechner v1.0",
"intro": "Dieses Online-Tool macht nur eines, aber es macht es gut : die Warscheinlichkeit rechnen, einen Peercoin-POS-Block zu erzeugen. Sie können ändern.",
"desc1": "Der Betrag der Transaktion, die Anzahl der Tage, die seit der Transaktion vergangen sind und die POS-Schwierigkeit, Ergebnisse zu erzielen.",
"desc2": "Die Warscheinlichkeit, einen POS-Block zu erzeugen, ist vor 30 Tagen Null und erreicht ihr Maximum nach 90 Tagen. Die Warscheinlichkeit erhöht weiter nicht.",
"desc3": "Beim Start des Tools wird der letzte Wert für die POS-Schwierigkeit direkt aus der Peercoin-Blockchain abgerufen.",
"desc1": "Der Betrag der Transaktion",
"desc2": "Die Anzahl der Tage die seit der Transaktion vergangen sind. Die Warscheinlichkeit, einen POS-Block zu erzeugen, ist vor 30 Tagen Null und erreicht ihr Maximum nach 90 Tagen. Die Warscheinlichkeit erhöht weiter nicht.",
"desc3": "Die POS-Schwierigkeit, Ergebnisse zu erzielen. Beim Start des Tools wird der letzte Wert für die POS-Schwierigkeit direkt aus der Peercoin-Blockchain abgerufen.",
"entry_coins": "Anzahl der Münzen",
"entry_days": "Alter der Transaktion (Tage)",
"entry_difficulty": "POS Schwierigkeit",
Expand All @@ -52,9 +52,9 @@ var translations = {
"header_prefix": "Idiomas: ",
"header_title": "Peercoin Prueba-De-Juego (POS) Calculadora v0.0.1",
"intro": "Esta herramienta hace una cosa pero lo hace bien: calcule la probabilidad de generar un bloque POS Peercoin. Puede cambiar:",
"desc1": "La cantidad de monedas que envió en una transacción, la duración que ha pasado y la dificultad de POS para obtener una lectura.",
"desc2": "La probabilidad de un bloque de moneda es cero antes de 30 días alcanza su máximo después de 90 días. No aumenta después de eso.",
"desc3": "En el lanzamiento de la herramienta, el último valor para la dificultad POS se recupera directamente desde la cadena de bloques Peercoin.",
"desc1": "La cantidad de monedas que envió en una transacción",
"desc2": "la duración que ha pasado. La probabilidad de un bloque de moneda es cero antes de 30 días alcanza su máximo después de 90 días. No aumenta después de eso.",
"desc3": "La dificultad de POS para obtener una lectura. En el lanzamiento de la herramienta, el último valor para la dificultad POS se recupera directamente desde la cadena de bloques Peercoin.",
"entry_coins": "Número De monedas",
"entry_days": "Edad de transacción (días)",
"entry_difficulty": "POS dificultad",
Expand All @@ -76,9 +76,9 @@ var translations = {
"header_prefix": "Langues : ",
"header_title": "Calculateur Preuve-de-Part (POS) Peercoin v1.0",
"intro": "Cet outil en ligne ne fait qu'une chose mais il le fait bien : calculer la probabilité de générer un bloc POS Peercoin. Vous pouvez modifier :",
"desc1": "Le montant de la transaction, le nombre de jours écoulés depuis et la difficulté POS pour avoir un résultat.",
"desc2": "La probabilité de générer un bloc POS est nulle avant 30 jours et atteint son maximum après 90 jours. La probabilité n'augmente plus au-delà.",
"desc3": "Au lancement de l'outil, la dernière valeur pour la difficulté POS est récupérée directement depuis la blockchain Peercoin.",
"desc1": "Le montant de la transaction",
"desc2": "Le nombre de jours écoulés depuis la transaction. La probabilité de générer un bloc POS est nulle avant 30 jours et atteint son maximum après 90 jours. La probabilité n'augmente plus au-delà.",
"desc3": "La difficulté POS pour avoir un résultat. Au lancement de l'outil, la dernière valeur pour la difficulté POS est récupérée directement depuis la blockchain Peercoin.",
"entry_coins": "Nombre de pièces",
"entry_days": "Âge de la transaction (jours)",
"entry_difficulty": "Difficulté POS",
Expand Down

0 comments on commit 0f2f485

Please sign in to comment.