[ANN] FindstakeJS is released

github: https://github.com/jointhepartypooper/FindstakeJS/

FindstakeJS
Getting to know in advance when your Peercoins stake

FindStakeJS originates from Kac-'s Findstake project, a tool written in Go to predict stakes but ported to JavaScript. UI, webserver and database all in one language.

Most cryptocoin mining requires specialized hardware, but Peercoin minting can be done on any computer. Minting is energy-efficient, because it is based on the Peercoins you hold, rather than on your processing power.

*But Peercoin can even be more energy-efficient! *

With FindStakeJS, there is no need to leave Peerunity on 24-7 anymore. Find out in advance and turn on your wallet software just before it counts and help secure the network.

Features:

Easy to use interface. (But can be improved if you are a twitter bootstrap rockstar)
Can be used without online data services, your Peerunity has already all the date it needs.
A command line option to update its internal database via Peerunityd rpc-json interface.

Awesome interface! I love it.

At the moment I’m stuck with “Retrieving data…” on Chrome. I don’t really have time to debug, but it seems it doesn’t fetch anything.

Would it be possible to explain how this data is parsed so that we can create our own?

Also another question: How is it possible to use this tool if our address has split transactions (i.e. after the minting reward we end up with two different transactions)? Can’t it be made possible to enter a txID instead of address ID?

assuming you
have node installed and
ve waited until ‘node updatedb.js’ finishes, which takes about 2 hours,
you can lookup unspent tx with the following url:

http://localhost:3000/peercoin/P8pGJii1Jos35Au7ymBhS46ahuoDVrDdb8/unspent

one address can have multiple outputs, this example has a lot of outputs

project still doesnot work properly, it finds stakes in the first minutes after start, but i am done debugging at the moment, hopefully somebody has a fresh look at it.
–update–
bug found and addressed

As for only a tx input iso an address; It actually requires an outpoint, which is a txid AND an index; Tat is too much to ask for IMHO.
To be user friendly, the UI just ask for the address and collect all unspent outputs it self to be included in the loop. It filters out those who hasn’t reached the 30 days age limit as well so the loop does slow down too much by unnecessary hash calculation. I tested with above mentioned example to test worst case wise how much it slows does down with so many outputs, but it is still workable, ish

[quote=“thehuntergames, post:3, topic:3304”]assuming you
have node installed and
ve waited until ‘node updatedb.js’ finishes, which takes about 2 hours,
you can lookup unspent tx with the following url:

http://localhost:3000/peercoin/P8pGJii1Jos35Au7ymBhS46ahuoDVrDdb8/unspent

one address can have multiple outputs, this example has a lot of outputs

project still doesnot work properly, it finds stakes in the first minutes after start, but i am done debugging at the moment, hopefully somebody has a fresh look at it.[/quote]

Do you have plans to host this somewhere so people can use it without installing? If so, may I ask you for simple API?

I ve documented in previous posts how data such as offset and stakemodifier are determined.

As for a API: Peerchemist: is it just those data inputs field needed for a hash you are after: e.g.

	BlockFromTime: 1394219584,
	StakeModifier: new BigInteger('15161125480764745506',10),
	PrevTxOffset:160,
	PrevTxTime:1394219584,
	PrevTxOutIndex:1,
	PrevTxOutValue:210090000,		
	IsProtocolV03:true,
	StakeMinAge:2592000,
	Bits:471087779,

The proof is in the eating. According to Findstakejs, I should turn on my wallet this Saturday before I go to bed to mint some coins :))

ps: found some bugs and fixed them, so you need the latest version btw

To those who wish not to install nodejs, I think i’ve found a solution:

nwjs.io ::slight_smile:

With nwjs you can package the nodejs app to a desktop application findstakejs.exe which runs a internal webbrowser that has no same origin limitations.

There is an example available that works with pouchdb https://github.com/nolanlawson/node-webkit-pouchdb-demo

Let me see if i can make an executable package for you (windows) guys…

Good news,

For the just click and go minded ones, I just committed findstake_singlepage.html to github.

I am still uploading ~60K of json files but this page can run locally anywhere without its own nodejs webserver :))

##How to use:

There is even an API for those interested that the webpage uses:

  var keytx='to'+ TXId + '_' + txindex;

  var fileurl="https://googledrive.com/host/0B_v7IYUBEIMyR1ZfWWl6VjNnLTg/json/" + keytx + ".json";

  $.ajax({
    url: fileurl,
    dataType: "jsonp",
    jsonpCallback: keytx, 
    success: function(data){
      /* Do something with data */
    }
  });

I think it would be best of all if something like this was built into peerunity, as extension to the mining tab.

would this encourage people to switch off computer and the network is less protected?

No, this will encourage people to unlock their wallet at the right time (those who only have one or two transactions in their wallet that can be used for minting). Not everyone is minting with full active nodes too.

Full active nodes will remain full active (because it takes time to have more than 8 connections, so you don’t want to loose this advantage).
Those who are minting with non-full active nodes will still need to run their wallet h24 to keep a decent connection as it requires a minimum of 8 active connections to be able to mint.

Also most wallets that are minting have dispatched transactions: they are minting one PoS block every 1h for example, so they cannot switch off their equipments in-between.

This may help little minters, those who have one big transaction only to open their wallet and unlock it at the right time. So I would rather say this is actually encouraging people to join the network.

The answer is no for the first order effect, where as difficulty changes is assumed to be insignificant. This is because a node only contributes to the security of the network when it finds a block. If it is not going to find a block in a certain period, it won’t add security to the network in the period.

However for the higher order effects, when unpredicted big change of difficulty is considered, taking nodes off line will reduce network security. Specifically, if someone takes his node off line for a month because the diff has been 15 and in this month his stakes will only find block at diff=13, then unexpectedly the difficulty dips to below 13, the node won’t be able to find the block at diff = 13 (hence unable to contribute to network security, pushing the diff up).

[quote=“thehuntergames, post:1, topic:3304”]

github: https://github.com/jointhepartypooper/FindstakeJS/

FindstakeJS
Getting to know in advance when your Peercoins stake

FindStakeJS originates from Kac-'s Findstake project, a tool written in Go to predict stakes but ported to JavaScript. UI, webserver and database all in one language.

Most cryptocoin mining requires specialized hardware, but Peercoin minting can be done on any computer. Minting is energy-efficient, because it is based on the Peercoins you hold, rather than on your processing power.

*But Peercoin can even be more energy-efficient! *

With FindStakeJS, there is no need to leave Peerunity on 24-7 anymore. Find out in advance and turn on your wallet software just before it counts and help secure the network.

Features:

Easy to use interface. (But can be improved if you are a twitter bootstrap rockstar)
Can be used without online data services, your Peerunity has already all the date it needs.
A command line option to update its internal database via Peerunityd rpc-json interface.[/quote]

How to use/install in windows?

There is a readme file too, but if you dont want to install nodejs and all that jazz, just download findstake_singlepage.html from https://github.com/jointhepartypooper/FindstakeJS/tree/master/FindstakeSinglePage

and open it

How to use:

[quote=“thehuntergames, post:14, topic:3304”]- goto http://ppc.blockr.io/api/v1/address/unspent/your-Peercoin-address to lookup tx and n

  • fill in a transaction id and index[/quote]

Maybe it is not obvoius, but don’t click on the link above. Substitute the “your-Peercoin-address” in the address with your address.
You can get the txID by openning your wallet and right-clicking on the transaction when you received the fund, and selecting “Show details…”.
The n is usually 1. I think the findstakeJS should use 1 as default.

BTW what time zone is the found stake displayed in ?

ok changed default index to 1

For those who wish to test:
try the following dataset

tx: 262c5be8cef19cad44bdf4af664bfd22f67e7b58f90bd39af90ceeef453fff3d
index:1
around Sep 25th, 2014 (unix time 1411634680)
min diff: 57

although the output is already spent, I’ve uploaded the corresponding data for further test purposes

PS: enjoy while it last, not sure when google drive decides to suspend my account :frowning:
I’ll see to get proper hosting when peercoin is back to 7$

GMT ?

I assume it displays local time as it uses moment-withlocales, but test it with the above dataset and let me know

what hour and minutes is the test block to be found ?

http://www.convert-unix-time.com/?t=1411634680

GMT: Thu, 25 Sep 2014 08:44:40 GMT

thx for testing :slight_smile: