Bitcoin Forum
June 25, 2024, 01:32:52 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Is there a general way to get difficulty from any coin?  (Read 1111 times)
Sultanen (OP)
Member
**
Offline Offline

Activity: 84
Merit: 10


View Profile
December 23, 2013, 01:12:28 AM
 #1

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.
BlueDragon747
Legendary
*
Offline Offline

Activity: 1509
Merit: 1030


Solutions Architect


View Profile WWW
December 23, 2013, 01:25:46 AM
 #2

get it from the wallet via json rpc

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

Hope that helps  Grin

Info: GithubBlakecoin.org - BCT Blakecoin thread - Twitter - BCS - BlakeZone  Trade Blakecoin: Xeggex.com Merged Mining Pools: EU3 - NY2/AT1 - LA1
Donation Addresses: BLC: Bd3jJftFbwxWSKNSNz35vkDd57kG6jHAjt PHO: BZXPMc8eF9YZcJStskkP2bVia38fv9VmuT BBTC: 2h8c4NbzXJXk6QQ89r7YYMGhe13gQUC2ajD ELT: e7cm6cAgpfhvk3Myh2Jkmi1nqaHtDHnxXb 
UMO: uQH9H17t7kz3eVQ3vKDzMsWCK4hn5nh2gC LIT: 8p8Z4h5fkZ8SCoyEtihKcjzZLA7gFjTdmL BTC: 1Q6kgcNqhKh8u67m6Gj73T2LMgGseETwR6
Vivisector999
Hero Member
*****
Offline Offline

Activity: 541
Merit: 500



View Profile
December 23, 2013, 01:27:57 AM
 #3

Open your wallet, open the console and type getdifficulty. That will give your the current difficulty.

Check out AC3  @ https://ac3.io/
BlueDragon747
Legendary
*
Offline Offline

Activity: 1509
Merit: 1030


Solutions Architect


View Profile WWW
December 23, 2013, 01:29:34 AM
 #4

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

Info: GithubBlakecoin.org - BCT Blakecoin thread - Twitter - BCS - BlakeZone  Trade Blakecoin: Xeggex.com Merged Mining Pools: EU3 - NY2/AT1 - LA1
Donation Addresses: BLC: Bd3jJftFbwxWSKNSNz35vkDd57kG6jHAjt PHO: BZXPMc8eF9YZcJStskkP2bVia38fv9VmuT BBTC: 2h8c4NbzXJXk6QQ89r7YYMGhe13gQUC2ajD ELT: e7cm6cAgpfhvk3Myh2Jkmi1nqaHtDHnxXb 
UMO: uQH9H17t7kz3eVQ3vKDzMsWCK4hn5nh2gC LIT: 8p8Z4h5fkZ8SCoyEtihKcjzZLA7gFjTdmL BTC: 1Q6kgcNqhKh8u67m6Gj73T2LMgGseETwR6
Sultanen (OP)
Member
**
Offline Offline

Activity: 84
Merit: 10


View Profile
December 23, 2013, 02:09:52 AM
Last edit: December 23, 2013, 02:35:59 AM by Sultanen
 #5

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?
BlueDragon747
Legendary
*
Offline Offline

Activity: 1509
Merit: 1030


Solutions Architect


View Profile WWW
December 23, 2013, 02:37:01 AM
 #6

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: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

Info: GithubBlakecoin.org - BCT Blakecoin thread - Twitter - BCS - BlakeZone  Trade Blakecoin: Xeggex.com Merged Mining Pools: EU3 - NY2/AT1 - LA1
Donation Addresses: BLC: Bd3jJftFbwxWSKNSNz35vkDd57kG6jHAjt PHO: BZXPMc8eF9YZcJStskkP2bVia38fv9VmuT BBTC: 2h8c4NbzXJXk6QQ89r7YYMGhe13gQUC2ajD ELT: e7cm6cAgpfhvk3Myh2Jkmi1nqaHtDHnxXb 
UMO: uQH9H17t7kz3eVQ3vKDzMsWCK4hn5nh2gC LIT: 8p8Z4h5fkZ8SCoyEtihKcjzZLA7gFjTdmL BTC: 1Q6kgcNqhKh8u67m6Gj73T2LMgGseETwR6
Sultanen (OP)
Member
**
Offline Offline

Activity: 84
Merit: 10


View Profile
December 23, 2013, 02:44:58 AM
 #7

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
BlueDragon747
Legendary
*
Offline Offline

Activity: 1509
Merit: 1030


Solutions Architect


View Profile WWW
December 23, 2013, 02:48:41 AM
 #8

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

Info: GithubBlakecoin.org - BCT Blakecoin thread - Twitter - BCS - BlakeZone  Trade Blakecoin: Xeggex.com Merged Mining Pools: EU3 - NY2/AT1 - LA1
Donation Addresses: BLC: Bd3jJftFbwxWSKNSNz35vkDd57kG6jHAjt PHO: BZXPMc8eF9YZcJStskkP2bVia38fv9VmuT BBTC: 2h8c4NbzXJXk6QQ89r7YYMGhe13gQUC2ajD ELT: e7cm6cAgpfhvk3Myh2Jkmi1nqaHtDHnxXb 
UMO: uQH9H17t7kz3eVQ3vKDzMsWCK4hn5nh2gC LIT: 8p8Z4h5fkZ8SCoyEtihKcjzZLA7gFjTdmL BTC: 1Q6kgcNqhKh8u67m6Gj73T2LMgGseETwR6
Sultanen (OP)
Member
**
Offline Offline

Activity: 84
Merit: 10


View Profile
December 23, 2013, 03:03:50 AM
 #9

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?
BlueDragon747
Legendary
*
Offline Offline

Activity: 1509
Merit: 1030


Solutions Architect


View Profile WWW
December 23, 2013, 03:05:32 AM
 #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

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

Info: GithubBlakecoin.org - BCT Blakecoin thread - Twitter - BCS - BlakeZone  Trade Blakecoin: Xeggex.com Merged Mining Pools: EU3 - NY2/AT1 - LA1
Donation Addresses: BLC: Bd3jJftFbwxWSKNSNz35vkDd57kG6jHAjt PHO: BZXPMc8eF9YZcJStskkP2bVia38fv9VmuT BBTC: 2h8c4NbzXJXk6QQ89r7YYMGhe13gQUC2ajD ELT: e7cm6cAgpfhvk3Myh2Jkmi1nqaHtDHnxXb 
UMO: uQH9H17t7kz3eVQ3vKDzMsWCK4hn5nh2gC LIT: 8p8Z4h5fkZ8SCoyEtihKcjzZLA7gFjTdmL BTC: 1Q6kgcNqhKh8u67m6Gj73T2LMgGseETwR6
Sultanen (OP)
Member
**
Offline Offline

Activity: 84
Merit: 10


View Profile
December 23, 2013, 03:12:11 AM
 #11

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 =)
Eliavres
Jr. Member
*
Offline Offline

Activity: 58
Merit: 10


View Profile
December 23, 2013, 03:13:21 AM
 #12

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.
BlueDragon747
Legendary
*
Offline Offline

Activity: 1509
Merit: 1030


Solutions Architect


View Profile WWW
December 23, 2013, 03:19:06 AM
 #13

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

Info: GithubBlakecoin.org - BCT Blakecoin thread - Twitter - BCS - BlakeZone  Trade Blakecoin: Xeggex.com Merged Mining Pools: EU3 - NY2/AT1 - LA1
Donation Addresses: BLC: Bd3jJftFbwxWSKNSNz35vkDd57kG6jHAjt PHO: BZXPMc8eF9YZcJStskkP2bVia38fv9VmuT BBTC: 2h8c4NbzXJXk6QQ89r7YYMGhe13gQUC2ajD ELT: e7cm6cAgpfhvk3Myh2Jkmi1nqaHtDHnxXb 
UMO: uQH9H17t7kz3eVQ3vKDzMsWCK4hn5nh2gC LIT: 8p8Z4h5fkZ8SCoyEtihKcjzZLA7gFjTdmL BTC: 1Q6kgcNqhKh8u67m6Gj73T2LMgGseETwR6
Sultanen (OP)
Member
**
Offline Offline

Activity: 84
Merit: 10


View Profile
December 23, 2013, 10:32:04 AM
 #14

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 =)
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!