<p>You're looking for <code>walletnotify</code> setting in bitcoin.conf</p>

<p>It will call the specified script for every transaction received for your own wallets.</p>

<pre><code>walletnotify=/some/path/mywalletscript.py
</code></pre>

<p>Here <code>mywalletscript.py</code> will handle the JSON data passed into it. </p>

<p><a href="https://github.com/damonp/walletnotify/blob/master/walletnotify.php" rel="nofollow noreferrer">Here is a sample walletnotify implementation</a> including database access. It's a bit dated but should give you an idea on how to handle events.</p>

<p>As per <a href="https://bitcointalk.org/index.php?topic=1442574.0" rel="nofollow noreferrer">this Bitcointalk thread</a> you can also hook up handlers for <code>blocknotify</code> and <code>alertnotify</code> so you can create your own payment system by receiving alerts, checking block confirmations and so on.</p>

<p>Just wire up a <code>walletnotify</code> handler via bitcoin.conf as answered <a href="https://bitcoin.stackexchange.com/questions/24457/how-do-i-use-walletnotify">here</a> and <a href="https://bitcointalk.org/index.php?topic=1442574.0" rel="nofollow noreferrer">here</a>.</p>

CC BY-SA 4.0
2019-10-29T18:43:42.127Z
2019-10-29T18:43:42.127Z
Jose Fonseca
<p>I want to run a python script when occur an incoming transaction. I think set <strong>zapwallettxes</strong> flag in <strong>bitcoin.conf</strong> but I don't know where set the script path to execute.</p>

<p>Is it possible to execute another executable file or another language script?</p>

<bitcoin-core><bitcoind><python>
How to run a python script when occur incoming transaction in Bitcoin core 0.18?
H.Mohseni
# How to run a python script when occur incoming transaction in Bitcoin core 0.18?

(Asked by: username_0 on 2019-10-29)

I want to run a python script when occur an incoming transaction. I think set **zapwallettxes** flag in **bitcoin.conf** but I don't know where set the script path to execute.

Is it possible to execute another executable file or another language script?

**Tags:** bitcoin-core, bitcoind, python


---

## 1 answers

### Answer by username_1 on 2019-10-29. Score: 2 | Accepted answer

You're looking for walletnotify setting in bitcoin.conf
It will call the specified script for every transaction received for your own wallets.
walletnotify=/some/path/mywalletscript.py

Here mywalletscript.py will handle the JSON data passed into it. 
Here is a sample walletnotify implementation including database access. It's a bit dated but should give you an idea on how to handle events.
As per this Bitcointalk thread you can also hook up handlers for blocknotify and alertnotify so you can create your own payment system by receiving alerts, checking block confirmations and so on.
Just wire up a walletnotify handler via bitcoin.conf as answered here and here.


---

