how can i use walletnotify command to get notification

+1 vote
Hi,

Could you please give me an example of how to set this runtime param to get notification everytime a new item appended in a stream called stream9 and where can i see all the notifications. how can i call external services when one of these notification occurs

i tried following

multichain-cli chain1 walletnotify %e streamcreationId // i got method not found

multichaind -walletnotify %e streamcreationId -daemon // it didn't show any error
asked May 8, 2018 by anshuman

1 Answer

+1 vote
 
Best answer

You first need to create some kind of command that captures these notifications. For example in Linux you could put this simple shell script in a file /temp/report-tx

#!/bin/sh
echo $1 $2

The script just outputs the two parameters passed to it. Then you need to configure MultiChain to execute this script and pass it the right parameters. For example put this in multichain.conf:

walletnotifynew=/temp/report-tx %e %s

By using walletnotifynew instead of walletnotify you'll only be informed of each new transaction once, and not get a second notification when it's confirmed in the blockchain.

More on how to use these commands here:

https://www.multichain.com/developers/runtime-parameters/

answered May 9, 2018 by MultiChain
selected May 9, 2018 by anshuman
...