Bitcoin Forum
October 20, 2017, 12:17:20 AM *
News: Latest stable version of Bitcoin Core: 0.15.0.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: [PERL][YAC] YaCoin stats  (Read 531 times)
kalgecin
Hero Member
*****
Offline Offline

Activity: 819


View Profile
May 09, 2013, 11:18:26 PM
 #1

I hacked together a perl script to show live stats. to use it, you need to install libjson-perl.
For Ubuntu people:

Code:
sudo apt-get install libjson-perl

I don't have windows, so if someone gets this running on windows please share what you needed to install.

Code:
#!/usr/bin/perl
use JSON;
$numsecs = 30;               #seconds to refresh
$hashespersec = 400000;  #Your mining speed
$input = `./yacoind getinfo`;
#print "Input:\n".$input."\n";
$json = JSON->new->allow_nonref;
$arrs = $json->decode($input);
$oldblocks = $arrs->{'blocks'};
sleep $numsecs;
while(1==1){
$input = `./yacoind getinfo`;
# print "Input:\n".$input."\n";
$json = JSON->new->allow_nonref;
$arrs = $json->decode($input);
# print "old: $oldblocks, new: ". $arrs->{'blocks'}."\n";
$secsperblock = ($numsecs/($arrs->{'blocks'}-$oldblocks));
print "Block: $secsperblock s ";
$hashesperblock = (2**32)*$arrs->{'difficulty'};
        $blocks = $arrs->{'blocks'}-$oldblocks;
        $speed = ($blocks*$hashesperblock)/$numsecs;
$time = $hashesperblock/400000;
$speed = $speed/$hashespersec;
        printf "Netspeed: %.3f MH/s %.3f hrs/b\n",$speed,$time/3600;
$oldblocks = $arrs->{'blocks'};
sleep $numsecs;
}

usage:
Code:
kalgecin@laptop:~/yacoin/src$ perl ~/yacoin.pl
suggestions for improvement are being accepted. Criticism is also accepted  Tongue Wink

Donations: Y7HPdphiDdH1Q7T2NJ4gxvNxP6XqPnVcNR






██████████████████████████████████████████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████████████████████████████████
███████████████████████████████████████████████████████████████████████▄▄▄███████████████████████
███████████████████████████████████████████████████████████████████████▀▀▀████████████████████████
██████████████████████████████████████████████████████████████████████████████████████████████████
█████████████████████████████████████████████████████████████████████████████████████████████████





...INTRODUCING WAVES........
...ULTIMATE ASSET/CUSTOM TOKEN BLOCKCHAIN PLATFORM...






1508458640
Hero Member
*
Offline Offline

Posts: 1508458640

View Profile Personal Message (Offline)

Ignore
1508458640
Reply with quote  #2

1508458640
Report to moderator
1508458640
Hero Member
*
Offline Offline

Posts: 1508458640

View Profile Personal Message (Offline)

Ignore
1508458640
Reply with quote  #2

1508458640
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1508458640
Hero Member
*
Offline Offline

Posts: 1508458640

View Profile Personal Message (Offline)

Ignore
1508458640
Reply with quote  #2

1508458640
Report to moderator
1508458640
Hero Member
*
Offline Offline

Posts: 1508458640

View Profile Personal Message (Offline)

Ignore
1508458640
Reply with quote  #2

1508458640
Report to moderator
limitless
Member
**
Offline Offline

Activity: 70



View Profile
May 09, 2013, 11:20:52 PM
 #2

nicely done!

My yacoin giveaway: https://bitcointalk.org/index.php?topic=199716.0 - Need more people to donate in order to keep it going.
My yacoin bounty thread: https://bitcointalk.org/index.php?topic=200252.0 - If you want to add bounties, just post here.
YAC address: YKmZSWKiqc9MPzmZ89SAwyXM4wSQqoQE3J
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!