laraveljson-rpcbitcoind

Bitcoind walletnotify configure on Laravel does not work


I have successfully configured bitcoind and connected it from a Laravel application. My issue now is walletnotify does not get triggered when a new transaction comes on an internally generated address.

bitcoin.conf

maxconnections=12
rpcuser=user
rpcpassword=pass
test.rpcport=18332
rpcallowip=0.0.0.0/0 --testing purposes
keypool=10000
server=1
testnet=1
txindex=1
walletnotify=/usr/bin/curl http://127.0.0.1/notify/%s

I have also tried with:

walletnotify=curl http://127.0.0.1/notify/%s

The route:

Route::get('/notify', 'HomeController@notify');

The Controller:

public function notify($tx) {

        $txinfo = Bitcoind::getRawTransaction($tx, true);

        $txinfo = $txinfo->get();

        .....

    }

Notes: Blockchain is synced. I have checked the debug.log from bitcoin but no errors from walletnotify or at least the curl when it should run.

If I manually call the route and pass a txid, everything goes well.

Thanks in advance for any help!


Solution

  • Problem solved!

    WalletNotify config below works just fine.

    walletnotify=curl http://127.0.0.1/notify/%s
    

    The problem was I build the function that verifies the transaction in the HomeController, which is guarded by the AUTH middleware. As I started this for testing purposes, I forget about the guard from the HomeController which is created by laravel authentication scaffolding.