Bitcoin Forum
October 18, 2017, 09:41:57 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: How to read alt-coin difficulty  (Read 1310 times)
FiniteRed
Sr. Member
****
Offline Offline

Activity: 319


View Profile
October 29, 2013, 04:10:58 PM
 #1

Hi Everyone

I am looking for a quick way to allow a Linux script to get hold of the current network difficulty from a LiteCoin wallet - I have
looked at RPC calls et al but have as of yet not found a (semi-simple) solution.

Has anyone got any suggestions?

Many thanks

FR

[G]-[ ]-[ ]-[ ]-[ ]-[ ]-[ ]-[ ]-[ ]-[ ] ~ [ ]-[ ]-[ ]-[ ]-[ ]-[ ]-[ ]-[ ]-[ ]-[H]
1508319717
Hero Member
*
Offline Offline

Posts: 1508319717

View Profile Personal Message (Offline)

Ignore
1508319717
Reply with quote  #2

1508319717
Report to moderator
1508319717
Hero Member
*
Offline Offline

Posts: 1508319717

View Profile Personal Message (Offline)

Ignore
1508319717
Reply with quote  #2

1508319717
Report to moderator
1508319717
Hero Member
*
Offline Offline

Posts: 1508319717

View Profile Personal Message (Offline)

Ignore
1508319717
Reply with quote  #2

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

Posts: 1508319717

View Profile Personal Message (Offline)

Ignore
1508319717
Reply with quote  #2

1508319717
Report to moderator
RandomQ
Hero Member
*****
Offline Offline

Activity: 672



View Profile
October 29, 2013, 07:23:46 PM
 #2

For bitcoin it would be "bitcoind getdifficulty"

Try litecoin get difficulty

You would to code that into your code/call

I may be 100% wrong not a coder
FiniteRed
Sr. Member
****
Offline Offline

Activity: 319


View Profile
October 30, 2013, 04:46:48 PM
 #3

Thanks all for your feedback, I got Java to parse the JSON from CoinChoose in the end  Cheesy

Cheers for the suggestions!

FR

[G]-[ ]-[ ]-[ ]-[ ]-[ ]-[ ]-[ ]-[ ]-[ ] ~ [ ]-[ ]-[ ]-[ ]-[ ]-[ ]-[ ]-[ ]-[ ]-[H]
FiniteRed
Sr. Member
****
Offline Offline

Activity: 319


View Profile
October 31, 2013, 12:19:36 PM
 #4

Actually found a far better way to do it directly from Linux script using curl:

Code:
curl --silent --user user:pass --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getinfo", "params": [] }' -H 'content-type: text/plain;' http://<wallet_IP>:<rpc_port>/ | ./jq '.result | .difficulty')

The output is then piped to jq (a json parser) and the difficulty values extracted ^_^

Hope someone else finds that useful Smiley

[G]-[ ]-[ ]-[ ]-[ ]-[ ]-[ ]-[ ]-[ ]-[ ] ~ [ ]-[ ]-[ ]-[ ]-[ ]-[ ]-[ ]-[ ]-[ ]-[H]
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!