Author

Topic: Is there a general way to get difficulty from any coin? (Read 1124 times)

member
Activity: 84
Merit: 10
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 =)
legendary
Activity: 1509
Merit: 1030
Solutions Architect
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  Cheesy

Best of luck with your project  Cool
jr. member
Activity: 58
Merit: 10
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.
member
Activity: 84
Merit: 10
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 Wink

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 Tongue


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  Wink
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 =)
legendary
Activity: 1509
Merit: 1030
Solutions Architect
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 Wink

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 Tongue


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  Wink
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 Wink
member
Activity: 84
Merit: 10
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 Wink

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 Tongue


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  Wink
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?
legendary
Activity: 1509
Merit: 1030
Solutions Architect
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 Wink

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 Tongue


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  Wink
member
Activity: 84
Merit: 10
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 Wink

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 Tongue
legendary
Activity: 1509
Merit: 1030
Solutions Architect
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 Wink

Code:
  
  require_once 'jsonRPCClient.php';
 
  $bitcoin = new jsonRPCClient('http://user:[email protected]:8332/');
 
  echo "
\n";
  print_r($bitcoin->getinfo()); echo "\n";
  echo "Received: ".$bitcoin->getreceivedbylabel("Your Address")."\n";
  echo "
";

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
member
Activity: 84
Merit: 10
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?
legendary
Activity: 1509
Merit: 1030
Solutions Architect
Open your wallet, open the console and type getdifficulty. That will give your the current difficulty.


OP wanted to access via code not manual  Wink
hero member
Activity: 541
Merit: 500
Open your wallet, open the console and type getdifficulty. That will give your the current difficulty.
legendary
Activity: 1509
Merit: 1030
Solutions Architect
member
Activity: 84
Merit: 10
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.
Jump to: