Bitcoin Forum
May 25, 2024, 09:30:40 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: java api to find bitcoin difficulty?  (Read 1411 times)
newguy05 (OP)
Hero Member
*****
Offline Offline

Activity: 1316
Merit: 503


Someone is sitting in the shade today...


View Profile WWW
August 29, 2013, 12:37:12 AM
 #1

Hi have a newbie question, how do i use java to find the current bitcoin network difficulty and past difficulties etc..?  I looked at bitcoinj but that's mostly for wallet sending/receiving i believe.  I dont need wallet or security, just want a way to get stats about the network using java.

Can someone point me in the right direction on the api/packages that's available or how to do that.  thanks

         ▄██████
       ▄████████
     ▄██████████
   ▄█▀     █████
 ▄███      █████
█████      ███████████████████████████
█████      ███████████████████████████
█████      ███████████████████████████
█████                           ████▀
█████                           ██▀
█████                          ▄▀   
██████████████████████████████▀
████████████████████████████▀
L I N K
by BLOCKMASON





..CREATE WEB APIS........
..FROM ANY SMART........
..CONTRACT.........................






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

READ THE
WHITEPAPER

>>>






▄          █▄                         ▄
██▄        ███▄                     ▄██
████▄      █████▄                 ▄████
██████▄    ███████▄             ▄██████
████████▄   ▀███████▄         ▄███████▀
██████████▄   ▀███████▄     ▄███████▀
████████████▄   ▀███████▄ ▄███████▀  
██████████████▄   ▀█████████████▀   ▄██
████████████████▄   ▀█████████▀   ▄████
██████████████████▄   ▀█████▀   ▄██████
████████████████████▄   ▀█▀   ▄████████
BLOCKMASON
BUILDING THE FUTURE









FACEBOOK
REDDIT
TWITTER

LINKEDIN
GITHUB
MEDIUM
tgerring
Full Member
***
Offline Offline

Activity: 142
Merit: 100


Hive/Ethereum


View Profile WWW
August 29, 2013, 05:49:16 AM
 #2

Your best bet is probably to use a service such at blockchain.info to gather stats. You'll have to make an HTTP request and parse the result with some JSON module.

If you do ever want to interact with the mainline client directly, it's easily as simple, because bitcoind support a JSON-RPC interface. The wiki even has Java-specific information.

Hive, a beautiful wallet for Mac OS X, now available for testing. Follow the story here.
BitcoinKit.framework and Tor.framework, now available to iOS and Mac OS X developers
Tweeting at @hivewallet. Donations appreciated at 142m1MpXHhymF4aASiWwYohe1Y55v5BQwc
newguy05 (OP)
Hero Member
*****
Offline Offline

Activity: 1316
Merit: 503


Someone is sitting in the shade today...


View Profile WWW
August 29, 2013, 01:39:34 PM
 #3

Your best bet is probably to use a service such at blockchain.info to gather stats. You'll have to make an HTTP request and parse the result with some JSON module.

If you do ever want to interact with the mainline client directly, it's easily as simple, because bitcoind support a JSON-RPC interface. The wiki even has Java-specific information.

hi thanks for the response, yes i am looking for a direct connection to the p2p network not via a third party. For example how does blockchain.info get its stats?  I can code the api myself in java but just confused as to how to go about getting stats on the network, dont want to have a dependency on a third party website (third party api jar files are ok but i cant find any).

for example

public static long getCurrentDifficulty()
{
//what are some of the high level steps i have to do?
}

         ▄██████
       ▄████████
     ▄██████████
   ▄█▀     █████
 ▄███      █████
█████      ███████████████████████████
█████      ███████████████████████████
█████      ███████████████████████████
█████                           ████▀
█████                           ██▀
█████                          ▄▀   
██████████████████████████████▀
████████████████████████████▀
L I N K
by BLOCKMASON





..CREATE WEB APIS........
..FROM ANY SMART........
..CONTRACT.........................






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

READ THE
WHITEPAPER

>>>






▄          █▄                         ▄
██▄        ███▄                     ▄██
████▄      █████▄                 ▄████
██████▄    ███████▄             ▄██████
████████▄   ▀███████▄         ▄███████▀
██████████▄   ▀███████▄     ▄███████▀
████████████▄   ▀███████▄ ▄███████▀  
██████████████▄   ▀█████████████▀   ▄██
████████████████▄   ▀█████████▀   ▄████
██████████████████▄   ▀█████▀   ▄██████
████████████████████▄   ▀█▀   ▄████████
BLOCKMASON
BUILDING THE FUTURE









FACEBOOK
REDDIT
TWITTER

LINKEDIN
GITHUB
MEDIUM
tgerring
Full Member
***
Offline Offline

Activity: 142
Merit: 100


Hive/Ethereum


View Profile WWW
August 29, 2013, 01:52:09 PM
 #4

You may not be able to grab every stat (such as historical network difficulty) with just bitcoind.

Here's a full list of bitcoind API calls

Hive, a beautiful wallet for Mac OS X, now available for testing. Follow the story here.
BitcoinKit.framework and Tor.framework, now available to iOS and Mac OS X developers
Tweeting at @hivewallet. Donations appreciated at 142m1MpXHhymF4aASiWwYohe1Y55v5BQwc
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!