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?
Add a comment
|
1 Answer
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
});
-
I already got it, but I appreciate it! Love your YouTube, by the way! Commented Feb 26, 2018 at 17:28