Bitcoin Forum
May 11, 2024, 08:54:26 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: I want to use RPC to get all historical transactions of an address  (Read 226 times)
linuxqq (OP)
Jr. Member
*
Offline Offline

Activity: 34
Merit: 6


View Profile
June 23, 2020, 03:07:38 PM
Merited by ABCbits (1)
 #1

I want to use RPC to get all historical transactions of an address,I have synchronized the full node on my computer. Below is the configuration of my bitcoin.conf

Code:
blockfilterindex=1
datadir=/opt/bitcoin/bitcoin-data
dbcache=10240
txindex=1
reindex=1
rpcuser=xxx
rpcpassword=xxx
daemon=1
server=1
rest=1
rpcbind=0.0.0.0:8332
rpcallowip=0.0.0.0/0
deprecatedrpc=accounts

But the result I return using listtransactions is empty
Code:
root@ubuntu:/opt/bitcoin/bitcoin-data# bitcoin-cli listtransactions "1L671pxzdY9dzEayZ9yEfUVWAoGsq99PoC"
[]

I don’t know what I did wrong, I just want to synchronize a full node locally, can query all historical transaction records of any specified address, thank you for your help

1715460866
Hero Member
*
Offline Offline

Posts: 1715460866

View Profile Personal Message (Offline)

Ignore
1715460866
Reply with quote  #2

1715460866
Report to moderator
The trust scores you see are subjective; they will change depending on who you have in your trust list.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715460866
Hero Member
*
Offline Offline

Posts: 1715460866

View Profile Personal Message (Offline)

Ignore
1715460866
Reply with quote  #2

1715460866
Report to moderator
BrewMaster
Legendary
*
Offline Offline

Activity: 2114
Merit: 1292


There is trouble abrewing


View Profile
June 23, 2020, 03:52:44 PM
Merited by Quickseller (3), ABCbits (2)
 #2

can query all historical transaction records of any specified address, thank you for your help

that is not possible with the way a full node (like bitcoin core)stores the blockchain because the blocks and their transactions are not sorted based on addresses so that you could easily search for address historical transactions.

you'll have to either rescan the entire blockchain for each address, which takes a lot of time or use another tool to index the blockchain based on addresses like what block explorers do then search it.

There is a FOMO brewing...
linuxqq (OP)
Jr. Member
*
Offline Offline

Activity: 34
Merit: 6


View Profile
June 24, 2020, 01:16:27 AM
 #3

So do I still need my own database to store transaction records at these addresses?
DaveF
Legendary
*
Offline Offline

Activity: 3472
Merit: 6270


Crypto Swap Exchange


View Profile WWW
June 24, 2020, 01:20:35 AM
Merited by BrewMaster (2), ABCbits (1)
 #4

So do I still need my own database to store transaction records at these addresses?
Yes.
There are some long and complicated ways around it, but none are simple.
If you want to get the information without going to a public explorer, there are many open source ones that you can use.

https://github.com/iquidus/explorer
https://github.com/bitpay/bitcore

-Dave

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
domob
Legendary
*
Offline Offline

Activity: 1135
Merit: 1166


View Profile WWW
June 24, 2020, 05:20:31 AM
 #5

As others have already pointed out, this is not possible (at least not easily) with Bitcoin Core alone.  As an alternative to block explorers already mentioned, you can also run ElectrumX (https://github.com/kyuupichan/electrumx) to generate and maintain a database indexed by address.  Once synced up, ElectrumX allows you to query exactly for the data you want.

Use your Namecoin identity as OpenID: https://nameid.org/
Donations: 1domobKsPZ5cWk2kXssD8p8ES1qffGUCm | NMC: NCdomobcmcmVdxC5yxMitojQ4tvAtv99pY
BM-GtQnWM3vcdorfqpKXsmfHQ4rVYPG5pKS | GPG 0xA7330737
linuxqq (OP)
Jr. Member
*
Offline Offline

Activity: 34
Merit: 6


View Profile
July 09, 2020, 03:57:37 AM
 #6

Thank you very much for your reply. Maybe I don’t have a special understanding of the principles of Bitcoin, but I’m working hard to learn. I currently read the electrumx rosksdb directly. It seems that electrumx stores scripthash, but I want to get all the wallet addresses, a lot of BTC explorer How did they get the wallet address? electrumx's database does not store scriptPubKey
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!