简体   繁体   中英

Bitcoin Wallet Transaction Callback

Is it possible for the Bitcoin client (running in server mode) to send a HTTP request upon receiving a transaction and it being confirmed? Ie to send to a PHP script for callback/confirmation.

This is possible using the walletnotify parameter in your bitcoin.conf file.

walletnotify=/home/bitcoin/transaction.sh %s

This will call the transaction.sh script with the txid as a paramter. From there you can basically do anything.

For example:

#!/bin/sh
curl -d "txid=$1" http://127.0.0.1/callback

Note: the address you want to monitor has to be part of your wallet

您可以解析https://blockchain.info/rawaddr/ $ bitcoin_address api进行新交易

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM