Bitcoin Forum
June 22, 2024, 02:31:35 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [PERL][YAC] YaCoin stats  (Read 646 times)
kalgecin (OP)
Hero Member
*****
Offline Offline

Activity: 819
Merit: 1000


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...






limitless
Member
**
Offline Offline

Activity: 70
Merit: 10



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:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!