Bitcoin Forum

Alternate cryptocurrencies => Altcoin Discussion => Topic started by: Sultanen on December 23, 2013, 01:12:28 AM



Title: Is there a general way to get difficulty from any coin?
Post by: Sultanen on December 23, 2013, 01:12:28 AM
Is there a way to get the difficulty from any coin even if there isn't a blockchain site like http://blockchain.info/ (they have an API)? I need to access it programmatically and i want to have it from the source so ripping it from a site that already lists them all isn't an option.


Title: Re: Is there a general way to get difficulty from any coin?
Post by: BlueDragon747 on December 23, 2013, 01:25:46 AM
get it from the wallet via json rpc

https://blockchain.info/api/json_rpc_api (https://blockchain.info/api/json_rpc_api)
https://en.bitcoin.it/wiki/API_reference_(JSON-RPC) (https://en.bitcoin.it/wiki/API_reference_(JSON-RPC))

Hope that helps  ;D


Title: Re: Is there a general way to get difficulty from any coin?
Post by: Vivisector999 on December 23, 2013, 01:27:57 AM
Open your wallet, open the console and type getdifficulty. That will give your the current difficulty.


Title: Re: Is there a general way to get difficulty from any coin?
Post by: BlueDragon747 on December 23, 2013, 01:29:34 AM
Open your wallet, open the console and type getdifficulty. That will give your the current difficulty.


OP wanted to access via code not manual  ;)


Title: Re: Is there a general way to get difficulty from any coin?
Post by: Sultanen on December 23, 2013, 02:09:52 AM
get it from the wallet via json rpc

https://blockchain.info/api/json_rpc_api (https://blockchain.info/api/json_rpc_api)
https://en.bitcoin.it/wiki/API_reference_(JSON-RPC) (https://en.bitcoin.it/wiki/API_reference_(JSON-RPC))

Hope that helps  ;D
Thanks for your input!
If i get that right i need to have the qt wallet installed on the webserver in order to use that api on it. That is not an option for me unfortunatley. You can use it on an online wallet aswell but all new coins don't have an online wallet.

There isn't any way to get the information directly from a node or something?


Title: Re: Is there a general way to get difficulty from any coin?
Post by: BlueDragon747 on December 23, 2013, 02:37:01 AM
get it from the wallet via json rpc

https://blockchain.info/api/json_rpc_api (https://blockchain.info/api/json_rpc_api)
https://en.bitcoin.it/wiki/API_reference_(JSON-RPC) (https://en.bitcoin.it/wiki/API_reference_(JSON-RPC))

Hope that helps  ;D
Thanks for your input!
If i get that right i need to have the qt wallet installed on the webserver in order to use that api on it. That is not an option for me unfortunatley. You can use it on an online wallet aswell but all new coins don't have an online wallet.

on a headless linux webserver I would use the bitcoind and use something like this in a script:

./bitcoind -rpcconnect=YourIpOrDomainName -rpcport=YourPort -rpcuser=YourWalletUserName -rpcpassword=YourPassword getinfo

an online wallet is not much more than a php front end to the wallet daemon ;)

Code:
  
  require_once 'jsonRPCClient.php';
 
  $bitcoin = new jsonRPCClient('http://user:password@127.0.0.1:8332/');
 
  echo "<pre>\n";
  print_r($bitcoin->getinfo()); echo "\n";
  echo "Received: ".$bitcoin->getreceivedbylabel("Your Address")."\n";
  echo "</pre>";

if you can't get it direct from the wallet then you must get it from another website but you don't want to do this?

btw you can do this to a wallet on another server if you wanted as long as you setup the wallet conf right


Title: Re: Is there a general way to get difficulty from any coin?
Post by: Sultanen on December 23, 2013, 02:44:58 AM
get it from the wallet via json rpc

https://blockchain.info/api/json_rpc_api (https://blockchain.info/api/json_rpc_api)
https://en.bitcoin.it/wiki/API_reference_(JSON-RPC) (https://en.bitcoin.it/wiki/API_reference_(JSON-RPC))

Hope that helps  ;D
Thanks for your input!
If i get that right i need to have the qt wallet installed on the webserver in order to use that api on it. That is not an option for me unfortunatley. You can use it on an online wallet aswell but all new coins don't have an online wallet.

on a headless linux webserver I would use the bitcoind and use something like:
./bitcoind -rpcconnect=rpc.blockchain.info -rpcport=443 -rpcssl -rpcuser=YourWalletIdentifier -rpcpassword=YourPassword getinfo

an online wallet is not much more than a php front end to the wallet daemon ;)

if you can get it direct from the wallet then you must get it from another website but you don't want to do this?

Does the wallet itself calculate the difficulty or where does it get it? From one of the nodes? Im on shared hosting so installing a wallet there aint an option unfortunatley. I realise im not 100% sure of how cryptocurrencies work :P


Title: Re: Is there a general way to get difficulty from any coin?
Post by: BlueDragon747 on December 23, 2013, 02:48:41 AM
get it from the wallet via json rpc

https://blockchain.info/api/json_rpc_api (https://blockchain.info/api/json_rpc_api)
https://en.bitcoin.it/wiki/API_reference_(JSON-RPC) (https://en.bitcoin.it/wiki/API_reference_(JSON-RPC))

Hope that helps  ;D
Thanks for your input!
If i get that right i need to have the qt wallet installed on the webserver in order to use that api on it. That is not an option for me unfortunatley. You can use it on an online wallet aswell but all new coins don't have an online wallet.

on a headless linux webserver I would use the bitcoind and use something like:
./bitcoind -rpcconnect=rpc.blockchain.info -rpcport=443 -rpcssl -rpcuser=YourWalletIdentifier -rpcpassword=YourPassword getinfo

an online wallet is not much more than a php front end to the wallet daemon ;)

if you can get it direct from the wallet then you must get it from another website but you don't want to do this?

Does the wallet itself calculate the difficulty or where does it get it? From one of the nodes? Im on shared hosting so installing a wallet there aint an option unfortunatley. I realise im not 100% sure of how cryptocurrencies work :P


yes the network recalculates the difficulty every so many blocks, for Blakecoin it every 20 blocks so when you find that 20'th block it recalculates the difficulty and broadcasts it on the network

a network node is a wallet  ;)


Title: Re: Is there a general way to get difficulty from any coin?
Post by: Sultanen on December 23, 2013, 03:03:50 AM
get it from the wallet via json rpc

https://blockchain.info/api/json_rpc_api (https://blockchain.info/api/json_rpc_api)
https://en.bitcoin.it/wiki/API_reference_(JSON-RPC) (https://en.bitcoin.it/wiki/API_reference_(JSON-RPC))

Hope that helps  ;D
Thanks for your input!
If i get that right i need to have the qt wallet installed on the webserver in order to use that api on it. That is not an option for me unfortunatley. You can use it on an online wallet aswell but all new coins don't have an online wallet.

on a headless linux webserver I would use the bitcoind and use something like:
./bitcoind -rpcconnect=rpc.blockchain.info -rpcport=443 -rpcssl -rpcuser=YourWalletIdentifier -rpcpassword=YourPassword getinfo

an online wallet is not much more than a php front end to the wallet daemon ;)

if you can get it direct from the wallet then you must get it from another website but you don't want to do this?

Does the wallet itself calculate the difficulty or where does it get it? From one of the nodes? Im on shared hosting so installing a wallet there aint an option unfortunatley. I realise im not 100% sure of how cryptocurrencies work :P


yes the network recalculates the difficulty every so many blocks, for Blakecoin it every 20 blocks so when you find that 20'th block it recalculates the difficulty and broadcasts it on the network

a network node is a wallet  ;)
Okey, thanks! =) I read up some more on how the network works since the last post and now i see that all nodes are wallets =) So its not possible to fetch the broadcasted difficulty in any way without a wallet then? CGminer shows the difficulty even though its not a wallet per say?


Title: Re: Is there a general way to get difficulty from any coin?
Post by: BlueDragon747 on December 23, 2013, 03:05:32 AM
get it from the wallet via json rpc

https://blockchain.info/api/json_rpc_api (https://blockchain.info/api/json_rpc_api)
https://en.bitcoin.it/wiki/API_reference_(JSON-RPC) (https://en.bitcoin.it/wiki/API_reference_(JSON-RPC))

Hope that helps  ;D
Thanks for your input!
If i get that right i need to have the qt wallet installed on the webserver in order to use that api on it. That is not an option for me unfortunatley. You can use it on an online wallet aswell but all new coins don't have an online wallet.

on a headless linux webserver I would use the bitcoind and use something like:
./bitcoind -rpcconnect=rpc.blockchain.info -rpcport=443 -rpcssl -rpcuser=YourWalletIdentifier -rpcpassword=YourPassword getinfo

an online wallet is not much more than a php front end to the wallet daemon ;)

if you can get it direct from the wallet then you must get it from another website but you don't want to do this?

Does the wallet itself calculate the difficulty or where does it get it? From one of the nodes? Im on shared hosting so installing a wallet there aint an option unfortunatley. I realise im not 100% sure of how cryptocurrencies work :P


yes the network recalculates the difficulty every so many blocks, for Blakecoin it every 20 blocks so when you find that 20'th block it recalculates the difficulty and broadcasts it on the network

a network node is a wallet  ;)
Okey, thanks! =) I read up some more on how the network works since the last post and now i see that all nodes are wallets =) So its not possible to fetch the broadcasted difficulty in any way without a wallet then? CGminer shows the difficulty even though its not a wallet per say?

cgminer gets it from the pool which has a wallet connected and when solo mining its get it from the wallet direct

Edit:
using the info from a pool would be the same as getting the info from another website, in the end you need a node in the network to receive the broadcasts to tell you what the current difficulty is ;)


Title: Re: Is there a general way to get difficulty from any coin?
Post by: Sultanen on December 23, 2013, 03:12:11 AM
get it from the wallet via json rpc

https://blockchain.info/api/json_rpc_api (https://blockchain.info/api/json_rpc_api)
https://en.bitcoin.it/wiki/API_reference_(JSON-RPC) (https://en.bitcoin.it/wiki/API_reference_(JSON-RPC))

Hope that helps  ;D
Thanks for your input!
If i get that right i need to have the qt wallet installed on the webserver in order to use that api on it. That is not an option for me unfortunatley. You can use it on an online wallet aswell but all new coins don't have an online wallet.

on a headless linux webserver I would use the bitcoind and use something like:
./bitcoind -rpcconnect=rpc.blockchain.info -rpcport=443 -rpcssl -rpcuser=YourWalletIdentifier -rpcpassword=YourPassword getinfo

an online wallet is not much more than a php front end to the wallet daemon ;)

if you can get it direct from the wallet then you must get it from another website but you don't want to do this?

Does the wallet itself calculate the difficulty or where does it get it? From one of the nodes? Im on shared hosting so installing a wallet there aint an option unfortunatley. I realise im not 100% sure of how cryptocurrencies work :P


yes the network recalculates the difficulty every so many blocks, for Blakecoin it every 20 blocks so when you find that 20'th block it recalculates the difficulty and broadcasts it on the network

a network node is a wallet  ;)
Okey, thanks! =) I read up some more on how the network works since the last post and now i see that all nodes are wallets =) So its not possible to fetch the broadcasted difficulty in any way without a wallet then? CGminer shows the difficulty even though its not a wallet per say?

cgminer gets it from the pool which has a wallet connected and when solo mining its get it from the wallet direct
Thanks alot for the help, you got answers for all my stupid questions =) So i guess another server is the best way to get on with this project then =)


Title: Re: Is there a general way to get difficulty from any coin?
Post by: Eliavres on December 23, 2013, 03:13:21 AM
IF my assumption is correct you want to make a tool to sort all coins by difficulty..not exactly an easy feat. You would need a back end from which to retrieve that stat for each currency, my best guess would be the pools, pick out the most popular ones for each coin.


Title: Re: Is there a general way to get difficulty from any coin?
Post by: BlueDragon747 on December 23, 2013, 03:19:06 AM
it might be best to think along the lines of getting the data from easiest source for a particular coin rather than all the same would save overhead at least  :D

Best of luck with your project  8)


Title: Re: Is there a general way to get difficulty from any coin?
Post by: Sultanen on December 23, 2013, 10:32:04 AM
You guys might be right, but relying on a single online source aint gonna cut it, but using multiple backup sources might be an alternative i guess =)