Author

Topic: -walletnotify command (Read 203 times)

HCP
legendary
Activity: 2086
Merit: 4318
June 17, 2018, 11:49:50 PM
#11
I managed to solve the problem,
Awesome... glad you got it sorted.

Quote
I tried to lock this thread but I couldn't understand how  Undecided
If some one can show me or one of the admins can shut it down by himself it would be great/
Bottom left hand corner just about the "Quick Reply" box is a link that says "Lock Topic"... click that.


or

Edit the 1st post, click "Additional Options"... then check the "Lock Topic" and click "save" (Adding [SOLVED] tag to the subject line is also recommended):

newbie
Activity: 7
Merit: 0
June 17, 2018, 11:27:44 AM
#10
I managed to solve the problem,

When I started litecoind with -walletnotify='/full/path/to/script.sh %s' it worked.

Tnx everyone for the effort!

I tried to lock this thread but I couldn't understand how  Undecided

If some one can show me or one of the admins can shut it down by himself it would be great/
newbie
Activity: 7
Merit: 0
June 17, 2018, 09:09:02 AM
#9
Regarding permissions I gave the .sh file 777 permissions but still not luck

Did you also check whether the user who is running the daemon does have permission (read and execute) on the directory?
Because usually user do NOT have permissions to read the home directory of another user (/home/node_scripts/).

I am not 100% sure what do u mean by the user which is running the process but, litecoind owned by root and the script is owned by a user which is part of sudoers. The script has 777 permissions, Does the bitcoind process should have a permission for this file as well?
legendary
Activity: 1624
Merit: 2481
June 12, 2018, 06:23:02 AM
#8
Regarding permissions I gave the .sh file 777 permissions but still not luck

Did you also check whether the user who is running the daemon does have permission (read and execute) on the directory?
Because usually user do NOT have permissions to read the home directory of another user (/home/node_scripts/).
HCP
legendary
Activity: 2086
Merit: 4318
June 12, 2018, 05:41:53 AM
#7
To rule out issues with networking and the VM... Have you tried a really simple script that just writes something to a file on the local (VM) disk?

This will at least confirm that the walletnotify functionality is working... you can then attempt to troubleshoot why your script is not working (ie. try running the script manually etc.)
newbie
Activity: 7
Merit: 0
June 12, 2018, 04:17:17 AM
#6
Tried also with adding %s to the script,

Regarding permissions I gave the .sh file 777 permissions but still not luck  Huh Huh Huh

Anymore ideas?

Tnx!
HCP
legendary
Activity: 2086
Merit: 4318
June 10, 2018, 05:52:31 PM
#5
Another thing that you might want to do is to check the permissions for the script and/or the directory that it is contained in. Does the user that litecoind is running as have permission to read/execute that script? Huh
legendary
Activity: 1624
Merit: 2481
June 10, 2018, 12:49:21 PM
#4
walletnotify=/home/node_scripts/example.sh

You need to pass the argument (TX ID) to your script. Put %s at the end:

Code:
walletnotify=/home/node_scripts/example.sh %s



Mind posting your shell script to see if you have made a mistake there?
newbie
Activity: 7
Merit: 0
June 10, 2018, 10:14:47 AM
#3
Hey.
So I tried to make the adjustments and start with something simple as echo "Hello" within the .sh file.

litecoin.conf:
walletnotify=/home/node_scripts/example.sh

The file exists on that path..
I restarted the core after modifying the .conf file but still not working.

Any ideas?
legendary
Activity: 1624
Merit: 2481
June 10, 2018, 09:57:02 AM
#2
walletnotify="echo %s | nc REMOTE_IP PORT"


You might try it with

Code:
walletnotify=/path/to/your/script.sh %s

Then inside your script.sh you can access the TXID with $1


Note that walletnotify is called when you (1) receive a transaction, (2) send a transaction and (3) a received transaction got its first confirmation.
blocknotify is called each time a new block is received. In this case the block hash is being passed as the argument.
newbie
Activity: 7
Merit: 0
June 10, 2018, 09:48:10 AM
#1
Hey, Could really use ur help!!

I have a node running on a VM, when I am trying to use walletnotify I am not getting anything.

My goal is to get an event listener on my wallet to notify when a relevant transaction is updated.

Tried both walletnotify and blocknotify - non of them worked..

I am writing Java and communicating with the node via JSON RPC impl'

My .conf file:

testnet=1
rpcuser=rpcuser
rpcpassword=rpcpassword
rpcallowip=0.0.0.0/0
rpcbind=0.0.0.0
walletnotify="echo %s | nc REMOTE_IP PORT"

on the other end I can validate that the socket is open and listening on the specific port.

Can some one help??
TNX!!!
Jump to: