我已经成功地配置了bitcoind,并从Laravel应用程序连接了它。我现在的问题是,当新事务出现在内部生成的地址上时,walletnotify不会被触发。
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我还尝试过:
walletnotify=curl http://127.0.0.1/notify/%s路由:
Route::get('/notify', 'HomeController@notify');控制器:
public function notify($tx) {
        $txinfo = Bitcoind::getRawTransaction($tx, true);
        $txinfo = $txinfo->get();
        .....
    }注意:区块链是同步的。我已经检查了比特币中的debug.log,但walletnotify没有错误,至少在它应该运行的时候没有卷曲。
如果我手动调用路由并传递一个txid,一切都会正常进行。
提前感谢您的帮助!
发布于 2020-03-24 04:31:00
问题解决了!
下面的WalletNotify配置运行得很好。
walletnotify=curl http://127.0.0.1/notify/%s问题是我在HomeController中构建了验证事务的函数,它由AUTH中间件保护。在开始测试时,我忘记了来自HomeController的防护,它是由laravel身份验证脚手架创建的。
https://stackoverflow.com/questions/60805861
复制相似问题