Ethereum: Bitcoind Walletnotify more than 6 confirmations

Ethereum: Bitcoind -walletnotify more than 6 confirmations?

As a frequent user of the popular cryptocurrency wallet and node software, it is likely that you have found the need for notifications of your wallet every time certain events occur. In this article, we will explore how to configure Walletnotify in Bitcoin Core (BTC) with PHP scripts to notify when more than 6 confirmations are received.

Understand the balletify

Before immersing ourselves in the solution, let’s quickly review what walletnotify does:

  • When configured Walletnotify, send notifications to your configured email address or other destinations as soon as certain events happen.

  • The notification is activated by the call signals sent from Bitcoin Core when specific actions are carried out in your wallet.

PHP scripts configuration for notifications

To send notifications with more than 6 confirmations, we will use a personalized PHP script that is connected to the call return ‘Walletnotify’. Here is an example of how you can configure this:

Step 1: Install node.js and npm

Before continuing, make sure your system has node.js installed (version 14 or higher) together with NPM (Node Package Manager). You can download both from [nodejs.org] (

`Bash

For Windows users:

NPM Installation -G Node

Step 2: Create a new PHP script

Create a new file calledNotify.phpin its favorite directory and add the following code:

PHP

<? PHP

// Establish the details of the Bitcoin core wallet connection

$ bcconn = new bitcoincore (‘http: // its btc node: 8332’);

// Define the call return function to activate notifications

Onnotify function ($ CB, $ result) {

// Record notification data on the console

Echo “Activated notification:”. Json_encode ($ result). “north”;

// Send the notification by email or other destination (choose your method)

$ email = “your_email@example.com”; // Replace with your email address

require_once ‘Vendor/Autoload.php’;

Use mailchimp mailchimp;

$ mailchimp = new mailchimp (“your_api_key”, “your_secret_key”);

$ mailchimp-> Send (“your_notification_group”, “subject”, “notification:” json_encode ($ result));

}

`

Step 3: Configure the Script PHP to send notifications with more than 6 confirmations

To send notifications when more than 6 confirmations are received, modify yourbccon.json(located in the Central Bitcoin directory) as follows:

JSON

"Notify": {

"Call return": Onnotify,

"Parameters": [

{

"Call return": "Confirm",

"Method": "Publish",

"URL": "

},

{

"Call return": "Confirm",

"Method": "Publish",

"URL": "

}

]

}

In this example, we are configuring the option 'Notify' to use two call return functions (confirm ‘) for the delivery of notifications:

  • The first confolution of confirmation calls is activated when a new form survey or sending.

  • The second confolution of confirmation is activated when a new transaction has been received with more than 6 confirmations.

Bitcoin Core configuration

To enable the notify option in its installation of Bitcoin core, follow these steps:

  • Download and install the latest version of Bitcoin Core from [Bitcoin.org] (

  • Start Bitcoin Core (BC --Ren) to update the configuration files.

  • Configure the bcconf.json file with the necessary configuration (for example, notification email addresses, API keys).

Try your configuration

After configuring your wallet and executing the PHP script with more than 6 confirmations, you must receive notifications by email or other destination.

Keep in mind that this configuration requires a central Bitcoin node that works and a mailchimp account to send emails.

Leave A Comment

Your email address will not be published. Required fields are marked *