Can I use walletnotify or blocknotify remotely with a NodeJS application?

0

I'd like to get information from my bitcoin node running on a cloud server to be used to make changes in my NodeJS app running on my computer. So, in the bitcoin.conf file, should I have something like walletnotify=curl http://My.IP.Address:PortAppUses/walletnotify.js?tx=%s? If that's right, what do I write in the walletnotify.js file to simply save the incoming transaction id as a variable?

Setheroni

Posted 2018-02-24T04:48:41.973

Reputation: 7

Answers

1

In your example you are telling it to place the transaction id as a GET request in the URI under the tx parameter.

walletnotify=curl http://My.IP.Address:PortAppUses/walletnotify.js?tx=%s

All you would need to do inside of walletnotify.js is pull the tx GET, in nodejs express that would be something like:

const express = require("express");
const app = express();
const request = require("request");

app.get("/", function(req, res){

    let transactionId = req.query.tx;

    //do whatever with transactionId

}); 

m1xolyd1an

Posted 2018-02-24T04:48:41.973

Reputation: 3 356

I already got it, but I appreciate it! Love your YouTube, by the way!Setheroni 2018-02-26T17:28:50.720