Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: helloeverybody on December 27, 2015, 11:40:25 AM



Title: Full node with search function???
Post by: helloeverybody on December 27, 2015, 11:40:25 AM
ive been running a full node for a while now but i was surprised that since i hold the full ledger on my pc then shouldn't i be able to search for any transaction without using a 3rd party website? Or is this already a feature and ive just completely missed how to do it?


Title: Re: Full node with search function???
Post by: achow101 on December 27, 2015, 03:13:14 PM
There is, kind of. You need to use the debug console. In the debug console, you can get information about a block using
Code:
getblock <hash>

where <hash> is the hash of the block.
You can get the hash by using
Code:
getblockhashs <height>
where <height> is the block height.

You can also get transaction info by using
Code:
getrawtransaction <txid>
Where <txid> is the txid. This won't always work since Bitcoin Core doesn't index all of the transactions by default. If you want to be able to search every single transaction in the blockchain, then you will need to enable txindex by adding
Code:
txindex=1
to your bitcoin.conf file or add -txindex to the command that starts up Bitcoin Core.


Title: Re: Full node with search function???
Post by: helloeverybody on December 27, 2015, 08:28:44 PM
There is, kind of. You need to use the debug console. In the debug console, you can get information about a block using
Code:
getblock <hash>

where <hash> is the hash of the block.
You can get the hash by using
Code:
getblockhashs <height>
where <height> is the block height.

You can also get transaction info by using
Code:
getrawtransaction <txid>
Where <txid> is the txid. This won't always work since Bitcoin Core doesn't index all of the transactions by default. If you want to be able to search every single transaction in the blockchain, then you will need to enable txindex by adding
Code:
txindex=1
to your bitcoin.conf file or add -txindex to the command that starts up Bitcoin Core.

That seems like a lot of hassle just to do a search. i would be easier just using blockchain.info or something similar. i wonder if they will implement this into later updates. i know its not essential but it seems like it would be kind of handy and convenient to have built into the node. it atleast gives a small bit of incentive to actually run the full node in that you can search it as well.


Title: Re: Full node with search function???
Post by: cr1776 on December 27, 2015, 10:44:28 PM
There is, kind of. You need to use the debug console. In the debug console, you can get information about a block using
Code:
getblock <hash>

where <hash> is the hash of the block.
You can get the hash by using
Code:
getblockhashs <height>
where <height> is the block height.

You can also get transaction info by using
Code:
getrawtransaction <txid>
Where <txid> is the txid. This won't always work since Bitcoin Core doesn't index all of the transactions by default. If you want to be able to search every single transaction in the blockchain, then you will need to enable txindex by adding
Code:
txindex=1
to your bitcoin.conf file or add -txindex to the command that starts up Bitcoin Core.

That seems like a lot of hassle just to do a search. i would be easier just using blockchain.info or something similar. i wonder if they will implement this into later updates. i know its not essential but it seems like it would be kind of handy and convenient to have built into the node. it atleast gives a small bit of incentive to actually run the full node in that you can search it as well.

I think it is much more likely that the recommendation will be to use an add on web (or other) interface that queries Bitcoin core versus having it integrated into Bitcoin core itself.


Title: Re: Full node with search function???
Post by: unamis76 on December 28, 2015, 02:20:10 AM
There is, kind of. You need to use the debug console. In the debug console, you can get information about a block using
Code:
getblock <hash>

where <hash> is the hash of the block.
You can get the hash by using
Code:
getblockhashs <height>
where <height> is the block height.

You can also get transaction info by using
Code:
getrawtransaction <txid>
Where <txid> is the txid. This won't always work since Bitcoin Core doesn't index all of the transactions by default. If you want to be able to search every single transaction in the blockchain, then you will need to enable txindex by adding
Code:
txindex=1
to your bitcoin.conf file or add -txindex to the command that starts up Bitcoin Core.

That seems like a lot of hassle just to do a search. i would be easier just using blockchain.info or something similar. i wonder if they will implement this into later updates. i know its not essential but it seems like it would be kind of handy and convenient to have built into the node. it atleast gives a small bit of incentive to actually run the full node in that you can search it as well.

I don't see a need to implement such features on Core. You can use existing websites or setup a blockchain explorer yourself (https://github.com/bitcoin-abe/bitcoin-abe)


Title: Re: Full node with search function???
Post by: helloeverybody on December 28, 2015, 03:01:24 AM
There is, kind of. You need to use the debug console. In the debug console, you can get information about a block using
Code:
getblock <hash>

where <hash> is the hash of the block.
You can get the hash by using
Code:
getblockhashs <height>
where <height> is the block height.

You can also get transaction info by using
Code:
getrawtransaction <txid>
Where <txid> is the txid. This won't always work since Bitcoin Core doesn't index all of the transactions by default. If you want to be able to search every single transaction in the blockchain, then you will need to enable txindex by adding
Code:
txindex=1
to your bitcoin.conf file or add -txindex to the command that starts up Bitcoin Core.

That seems like a lot of hassle just to do a search. i would be easier just using blockchain.info or something similar. i wonder if they will implement this into later updates. i know its not essential but it seems like it would be kind of handy and convenient to have built into the node. it atleast gives a small bit of incentive to actually run the full node in that you can search it as well.


I don't see a need to implement such features on Core. You can use existing websites or setup a blockchain explorer yourself (https://github.com/bitcoin-abe/bitcoin-abe)

Obviously there is no need for it but if you have the whole ledger sitting on your computer you would think you wouldn't need a third party to access it really.  Not a must but would be a welcome feature. 


Title: Re: Full node with search function???
Post by: domob on December 28, 2015, 12:31:55 PM
Obviously there is no need for it but if you have the whole ledger sitting on your computer you would think you wouldn't need a third party to access it really.  Not a must but would be a welcome feature. 

As others explained already, there are ways to access the ledger - just not out-of-the-box with a nice GUI.  So if you want, you can, but since most people probably don't need that every day, it makes sense to not bloat Bitcoin Core's UI with it.


Title: Re: Full node with search function???
Post by: helloeverybody on December 28, 2015, 12:37:05 PM
Obviously there is no need for it but if you have the whole ledger sitting on your computer you would think you wouldn't need a third party to access it really.  Not a must but would be a welcome feature. 

As others explained already, there are ways to access the ledger - just not out-of-the-box with a nice GUI.  So if you want, you can, but since most people probably don't need that every day, it makes sense to not bloat Bitcoin Core's UI with it.

Sound like im the only person that would think this would fit nicely into bitcoin core then =p


Title: Re: Full node with search function???
Post by: fbueller on December 29, 2015, 08:36:14 PM
Github is a good place to discuss this stuff! An address based index was discussed recently: https://github.com/bitcoin/bitcoin/pull/6835 but ultimately, it would result in unnecessary bloat for a full node. Arbitrary searches (eg, all tx's with *this* public key) involve a full scan of every block, so it's an intensive task.

The Unix way is to write a simple command, that does one thing. Trying to meet everyone's needs is impossible, so best to allow specialized apps to flourish as separate projects.


Title: Re: Full node with search function???
Post by: Cubic Earth on December 30, 2015, 11:58:27 AM
Sound like im the only person that would think this would fit nicely into bitcoin core then =p

Everyone would be happy to have the functionality, but hardly anyone would be willing to put up with the cost.  You probably just don't have a sense of what a block explorer entails based on your previous comment about already having the ledger on the computer.  The blockchain is basically a highly compressed record that is not amenable to quickly searching by address.  A service like blockchain.info has a custom database that they created from the blockchain, but who's data structures are searchable by address, balance, etc..  Such a database could be many times larger than the standard blockchain, and I think it would take something like a week of CPU time to do all the indexing.


Title: Re: Full node with search function???
Post by: Cyrus on December 30, 2015, 04:12:32 PM
[...]able to search for any transaction without using a 3rd party website?
Code:
getrawtransaction <txid>
That seems like a lot of hassle just to do a search.

That's just lazy if you ask me. It can be done in two commands(including  txindex=1 which you only need to use once).


Title: Re: Full node with search function???
Post by: helloeverybody on December 30, 2015, 04:41:10 PM
[...]able to search for any transaction without using a 3rd party website?
Code:
getrawtransaction <txid>
That seems like a lot of hassle just to do a search.

That's just lazy if you ask me. It can be done in two commands(including  txindex=1 which you only need to use once).

Ok its not hassle but its not very convenient is it,Id be faster just opening a third party explorer than finding out the command ,It could just be a search bar thats just for lazy people right?. Why have it more complicated than it needs to be?? I mean at the moment there is no incentive to run a node other than supporting bitcoin which most adopters arent going to do,I didnt think it would be such a big issue putting something like this in but obviously it is.

Anyway we have cleared up already that nobody wants it in the core and its too hard on resources.


Title: Re: Full node with search function???
Post by: calkob on December 31, 2015, 03:19:58 PM
Yeah sounds like a lot of hassle, think i will just continue to use a blockexplorer website. 


Title: Re: Full node with search function???
Post by: Beparanf on January 01, 2016, 10:23:08 AM
Yeah sounds like a lot of hassle, think i will just continue to use a blockexplorer website.  

Yes. I also use website block explorer. That is fast and I do not type command lines. I can see more with block explorer.