I'm running a Symfony4 (PHP) project which makes use of a routing system.
Routing system?
Mind explaining what you mean?
You can read more here:
https://symfony.com/doc/current/routing.htmlIt's essentially just removing the uglyness in URL's, such as the .php extension...
I want to use walletnotify in the following way, but i want to make sure that it's right before testing:
bitcoin.conf:
walletnotify=curl
http://127.0.0.1:8000/wallet/notify/%s~snip~
how would i use the argv function in this case and would it work?
You have to specify the path to your script.
E.g. :
walletnotify = /home/path/to/your/script.sh %s
And inside your script.sh you can have the following:
#!/bin/sh
curl http://127.0.0.1:8000/wallet/notify/$1
%s (transaction ID) will be passed to your script and can be used/accessed via
$1 (argv).
Note that
walletnotify is called when:
1) You receive a transaction
2) You send a transaction
3) A (receiving) transaction gets the
first confirmation
If you want to check for a further status (2+ confirmations), you have to use
blocknotify instead of
walletnotify.
Thank you very much, i'll try it out! Is there no way to do it directly without the need for a bash script?
Also in regards to the path, is it starting from the folder where bitcoin.conf is located? or the root of the system? I suppose i should create a home folder where the bitcoin.conf is?
& to access the $1 in argv, do i simply do $transactionID = $argv[$1]; ?