Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: wsxdrfv on April 27, 2018, 01:18:37 AM



Title: How to make custom behaviour based on bitcoind transaction?
Post by: wsxdrfv on April 27, 2018, 01:18:37 AM
So bitcoin daemon is running on ubuntu server, that is itself a wallet, right?

Let's say this is A wallet.

1. If some other(B) send bitcoin to A wallet's one address, then A knows it immediately?
Can we type command, [ bitcoin-cli listtransactions ] returns above simulataneously?

2. Based on above 1, can we do some custom behaviour like send all received bitcoin (from B) to another C's address?
This should automatically done by program running.
How to do this?





Title: Re: How to make custom behaviour based on bitcoind transaction?
Post by: RGBKey on April 27, 2018, 01:33:06 AM
So bitcoin daemon is running on ubuntu server, that is itself a wallet, right?

Let's say this is A wallet.

1. If some other(B) send bitcoin to A wallet's one address, then A knows it immediately?
Can we type command, [ bitcoin-cli listtransactions ] returns above simulataneously?

2. Based on above 1, can we do some custom behaviour like send all received bitcoin (from B) to another C's address?
This should automatically done by program running.
How to do this?


Yeah it's possible, you just have to write a program or script to connect to bitcoind via the RPC, and you probably need to use the ZMQ socket to get realtime notifications of transactions.

Just a small note, A wouldn't know it "immediately", but it would after a few seconds. It can take a bit to propagate through the network sometimes.


Title: Re: How to make custom behaviour based on bitcoind transaction?
Post by: wsxdrfv on April 27, 2018, 01:51:54 AM

Yeah it's possible, you just have to write a program or script to connect to bitcoind via the RPC, and you probably need to use the ZMQ socket to get realtime notifications of transactions.
Are there any example of those sort of program or script?

And what is ZMQ socket, how to make?


Title: Re: How to make custom behaviour based on bitcoind transaction?
Post by: RGBKey on April 27, 2018, 02:41:59 AM

Yeah it's possible, you just have to write a program or script to connect to bitcoind via the RPC, and you probably need to use the ZMQ socket to get realtime notifications of transactions.
Are there any example of those sort of program or script?

And what is ZMQ socket, how to make?

How much software development experience do you have? Why do you want such a script?


Title: Re: How to make custom behaviour based on bitcoind transaction?
Post by: wsxdrfv on April 27, 2018, 02:58:22 AM

Yeah it's possible, you just have to write a program or script to connect to bitcoind via the RPC, and you probably need to use the ZMQ socket to get realtime notifications of transactions.
Are there any example of those sort of program or script?

And what is ZMQ socket, how to make?

How much software development experience do you have? Why do you want such a script?
javascript 1 year, C# 7 years.  For research.