Bitcoin Forum
May 10, 2024, 05:35:46 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to read alt-coin difficulty  (Read 1383 times)
FiniteRed (OP)
Sr. Member
****
Offline Offline

Activity: 346
Merit: 255


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]
1715362546
Hero Member
*
Offline Offline

Posts: 1715362546

View Profile Personal Message (Offline)

Ignore
1715362546
Reply with quote  #2

1715362546
Report to moderator
1715362546
Hero Member
*
Offline Offline

Posts: 1715362546

View Profile Personal Message (Offline)

Ignore
1715362546
Reply with quote  #2

1715362546
Report to moderator
1715362546
Hero Member
*
Offline Offline

Posts: 1715362546

View Profile Personal Message (Offline)

Ignore
1715362546
Reply with quote  #2

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

Posts: 1715362546

View Profile Personal Message (Offline)

Ignore
1715362546
Reply with quote  #2

1715362546
Report to moderator
1715362546
Hero Member
*
Offline Offline

Posts: 1715362546

View Profile Personal Message (Offline)

Ignore
1715362546
Reply with quote  #2

1715362546
Report to moderator
1715362546
Hero Member
*
Offline Offline

Posts: 1715362546

View Profile Personal Message (Offline)

Ignore
1715362546
Reply with quote  #2

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

Activity: 826
Merit: 500



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 (OP)
Sr. Member
****
Offline Offline

Activity: 346
Merit: 255


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 (OP)
Sr. Member
****
Offline Offline

Activity: 346
Merit: 255


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:  

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