<p>To communicate with your bitcoin core, you must change your bitcoin.conf and set</p>
<p>server=1</p>
<p>Then connect to your bitcoin core with &quot;http://user:password@127.0.0.1:8332&quot;</p>

CC BY-SA 4.0
2020-06-22T21:59:40.027Z
This page will help you to config your node. https://jlopp.github.io/bitcoin-core-config-generator/
mengeroshi
CC BY-SA 4.0
2020-06-23T14:32:04.880Z
I have configured this parameter server=1, but executing bitcoin-cli listtransactions 1JXKXFuB4HZf18JnpKADe2R3J8taoCcQEE still returns empty
user51679
CC BY-SA 4.0
2020-06-23T14:40:05.143Z
@user51679 Edit those in your conf file `rpcallowip=127.0.0.1`
`rpcport=8332`
Hamita
CC BY-SA 4.0
2020-06-23T15:27:07.483Z
The address I monitor is any address, is there any difference between this and 127.0.0.1 monitoring? Affect the query?
user51679
CC BY-SA 4.0
2020-06-22T17:39:58.390Z
2020-06-22T17:39:58.390Z
Hamita
<p>As <a href="https://bitcoin.stackexchange.com/users/106775/hamita">@hamita</a> pointed out you need to set <code>server=1</code> in your <code>bitcoin.conf</code> file then you can use <a href="https://github.com/jgarzik/python-bitcoinrpc" rel="nofollow noreferrer">python-bitcoinrpc</a> library to communicate with your bitcoin node.</p>
<p>Here's a short script to get all transactions of an address:</p>
<pre><code>from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from pprint import pprint

# rpc_user and rpc_password are set in the bitcoin.conf file
rpc_user = &quot;&lt;from bitcoin.conf&gt;&quot;
rpc_pass = &quot;&lt;from bitcoin.conf&gt;&quot;
rpc_host = &quot;&lt;ip address of your bitcoind&gt;&quot; # if running locally then 127.0.0.1
rpc_client = AuthServiceProxy(f&quot;http://{rpc_user}:{rpc_pass}@{rpc_host}:8332&quot;, timeout=240)


track_address = &quot;&lt;your address&gt;&quot;
tx_list = rpc_client.listtransactions()

address_tx_list = []
for tx in tx_list:
    if tx['address'] == track_address:
        address_tx_list.append(tx)

pprint(address_tx_list)
</code></pre>
<p>I'm also writing the chapter <a href="https://github.com/jodobear/Learning-Bitcoin-from-the-Command-Line/blob/master/18_4_Accessing_Bitcoind_with_Python.md" rel="nofollow noreferrer">Accessing Bitcoind with Python</a> if you want to know more. NOTE: It is a work in progress.</p>
<p>EDIT: Added <code>server=1</code> for completeness.</p>

CC BY-SA 4.0
2020-06-23T02:46:39.117Z
I just want to input an address and connect to the local BITCOIN RPC to query all historical transaction records of a specific address,I can't query all historical transaction records by trying this code, is there any good idea? thank
user51679
CC BY-SA 4.0
2020-06-23T10:45:06.090Z
An empty message was returned root@ubuntu:~# bitcoin-cli listtransactions  "3Fr1mGhnPAQ9YDf1dzg4B47PkX5TuvFtYv"
[
]
user51679
CC BY-SA 4.0
2020-06-25T00:01:23.450Z
That is because that address is not being tracked by your node as it wasn't generated by it nor it isn't watching the wallet that generated that address. If you want to be able to track each and every address then you should use something like esplora which is what blockstream.info backed is.
jodobear
CC BY-SA 4.0
2020-06-22T23:13:32.620Z
2020-06-23T00:12:44.277Z
2020-06-23T00:12:44.277Z
jodobear
<p>How to use python rpc bitcoin to get the historical transaction record of a wallet address？My computer has synchronized all btc blocks, and txindex=1 has been configured. I want to try to get all the historical transaction records of a wallet address. Do I still need to create a mysql or redis cache? Below is my configuration</p>
<pre><code>datadir=/opt/bitcoin/bitcoin-data
dbcache=10240
txindex=1
rpcuser=*****hi 
rpcpassword=****
daemon=1
server=1
rest=1
rpcbind=0.0.0.0:8332
rpcallowip=0.0.0.0/0
deprecatedrpc=accounts
</code></pre>
<p>I just want to input an address and connect to the local BITCOIN RPC to query all historical transaction records of a specific address</p>
<p>An empty message was returned</p>
<pre><code>root@ubuntu:~# bitcoin-cli listtransactions  &quot;3Fr1mGhnPAQ9YDf1dzg4B47PkX5TuvFtYv&quot;
[
]
</code></pre>

CC BY-SA 4.0
2020-06-22T20:55:35.333Z
Bitcoin-core does not keep an index of address balances or histories. You will need to find/write some additional code in order to use it in this way.
chytrik
<bitcoin-core><json-rpc><python>
How to use python rpc bitcoin to get the historical transaction record of a wallet address
user51679
# How to use python rpc bitcoin to get the historical transaction record of a wallet address

(Asked by: username_0 on 2020-06-22)

How to use python rpc bitcoin to get the historical transaction record of a wallet address？My computer has synchronized all btc blocks, and txindex=1 has been configured. I want to try to get all the historical transaction records of a wallet address. Do I still need to create a mysql or redis cache? Below is my configuration

```
datadir=/opt/bitcoin/bitcoin-data
dbcache=10240
txindex=1
rpcuser=*****hi 
rpcpassword=****
daemon=1
server=1
rest=1
rpcbind=0.0.0.0:8332
rpcallowip=0.0.0.0/0
deprecatedrpc=accounts

```

I just want to input an address and connect to the local BITCOIN RPC to query all historical transaction records of a specific address

An empty message was returned

```
root@ubuntu:~# bitcoin-cli listtransactions  "3Fr1mGhnPAQ9YDf1dzg4B47PkX5TuvFtYv"
[
]

```

**Tags:** bitcoin-core, json-rpc, python

> **Comments:**
> **username_1**: Bitcoin-core does not keep an index of address balances or histories. You will need to find/write some additional code in order to use it in this way.  

---

## 2 answers

### Answer by username_4 on 2020-06-22. Score: 4 | Accepted answer

As [@username_2](https://bitcoin.stackexchange.com/users/106775/username_2) pointed out you need to set `server=1` in your `bitcoin.conf` file then you can use [python-bitcoinrpc](https://github.com/jgarzik/python-bitcoinrpc) library to communicate with your bitcoin node.

Here's a short script to get all transactions of an address:

```
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from pprint import pprint

# rpc_user and rpc_password are set in the bitcoin.conf file
rpc_user = "<from bitcoin.conf>"
rpc_pass = "<from bitcoin.conf>"
rpc_host = "<ip address of your bitcoind>" # if running locally then 127.0.0.1
rpc_client = AuthServiceProxy(f"http://{rpc_user}:{rpc_pass}@{rpc_host}:8332", timeout=240)

track_address = "<your address>"
tx_list = rpc_client.listtransactions()

address_tx_list = []
for tx in tx_list:
    if tx['address'] == track_address:
        address_tx_list.append(tx)

pprint(address_tx_list)

```

I'm also writing the chapter [Accessing Bitcoind with Python](https://github.com/username_4/Learning-Bitcoin-from-the-Command-Line/blob/master/18_4_Accessing_Bitcoind_with_Python.md) if you want to know more. NOTE: It is a work in progress.

EDIT: Added `server=1` for completeness.

> **Comments:**
> **username_0**: I just want to input an address and connect to the local BITCOIN RPC to query all historical transaction records of a specific address,I can't query all historical transaction records by trying this code, is there any good idea? thank  
> **username_0**: An empty message was returned root@ubuntu:~# bitcoin-cli listtransactions  "3Fr1mGhnPAQ9YDf1dzg4B47PkX5TuvFtYv" [ ]  
> **username_4**: That is because that address is not being tracked by your node as it wasn't generated by it nor it isn't watching the wallet that generated that address. If you want to be able to track each and every address then you should use something like esplora which is what blockstream.info backed is.  

---

### Answer by username_2 on 2020-06-22. Score: 1

To communicate with your bitcoin core, you must change your bitcoin.conf and set

server=1

Then connect to your bitcoin core with "http://user:password@127.0.0.1:8332"

> **Comments:**
> **username_3**: This page will help you to config your node. https://jlopp.github.io/bitcoin-core-config-generator/  
> **username_0**: I have configured this parameter server=1, but executing bitcoin-cli listtransactions 1JXKXFuB4HZf18JnpKADe2R3J8taoCcQEE still returns empty  
> **username_2**: @username_0 Edit those in your conf file `rpcallowip=127.0.0.1` `rpcport=8332`  
> **username_0**: The address I monitor is any address, is there any difference between this and 127.0.0.1 monitoring? Affect the query?  

---

