Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: supermoney on November 22, 2015, 10:57:15 AM



Title: [SOLVED] walletnotify not working on Windows
Post by: supermoney on November 22, 2015, 10:57:15 AM
Hello guys, months ago I was writing a PHP script using walletnotify for storing transactions in a database. Now bitcoind at notify pop ups the system console for a second but it doesn't execute any...
After many tests I ended up using a very simple script for testing purposes:

test.php
Code:
<?php
$fp=fopen("C:/test.txt","a");
$out=$argv[1]."\n";
fwrite($fp,$out);
?>

bitcoin.conf
Code:
walletnotify = C:/php/php.exe -f C:/test.php %s

debug.log
Code:
2015-11-22 12:30:56 AddToWallet e20f0f5eb3b1d68fc1f33440cfc419a7e03719f645b292fec07211a56e6c185b  new
2015-11-22 12:30:56 runCommand error: system(C:/php/php.exe -f C:/test.php e20f0f5eb3b1d68fc1f33440cfc419a7e03719f645b292fec07211a56e6c185b) returned 1

Which actually works if ran manually through cmd but not by bitcoind when gets new transactions, just the console flashes and then byebye... Is my walletnotify cmd string correct?

SOLVED: had to use '\' instead of '/' damn it  ::)


Title: Re: [SOLVED] walletnotify not working on Windows
Post by: BitAurum on November 22, 2015, 08:34:30 PM
If you solved the problem you should lock this thread to avoid more posts on this thread.
You can find the link to lock this thread at the bottom of this page.


Title: Re: [SOLVED] walletnotify not working on Windows
Post by: FruitsBasket on November 22, 2015, 08:36:44 PM
If you solved the problem you should lock this thread to avoid more posts on this thread.
You can find the link to lock this thread at the bottom of this page.
Lol, why are you explaining a sr member where the lock button is located, I think that he knows where it is.

@supermonkey, such litlle details are very i portant one small mistake and then it is not working. Good that you have fixed it!


Title: Re: [SOLVED] walletnotify not working on Windows
Post by: supermoney on November 24, 2015, 09:58:01 PM
If you solved the problem you should lock this thread to avoid more posts on this thread.
You can find the link to lock this thread at the bottom of this page.

Thanks for the tip but I know it already.
Anyways, I left the thread open because I've got another question for you: what does happen if bitcoind eg. crashes? Will walletnotify seek for new/missing transactions at launch?
Still didn't try (sorry  :-[) but I hope it won't skip them lol


Title: Re: [SOLVED] walletnotify not working on Windows
Post by: supermoney on November 28, 2015, 01:56:12 PM
If you solved the problem you should lock this thread to avoid more posts on this thread.
You can find the link to lock this thread at the bottom of this page.

Thanks for the tip but I know it already.
Anyways, I left the thread open because I've got another question for you: what does happen if bitcoind eg. crashes? Will walletnotify seek for new/missing transactions at launch?
Still didn't try (sorry  :-[) but I hope it won't skip them lol

Any idea? Explanation? I wanna make sure walletnotify it's a safe and stable way to fetch ~50/100 transactions (send/receive) a day.


Title: Re: [SOLVED] walletnotify not working on Windows
Post by: supermoney on December 08, 2015, 09:27:31 AM
I've now completed my scripts and everything is working like a charm, closed.