Bitcoin Forum
June 21, 2024, 04:03:06 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to make custom behaviour based on bitcoind transaction?  (Read 111 times)
wsxdrfv (OP)
Jr. Member
*
Offline Offline

Activity: 405
Merit: 5


View Profile WWW
April 27, 2018, 01:18:37 AM
 #1

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?



RGBKey
Hero Member
*****
Offline Offline

Activity: 854
Merit: 658


rgbkey.github.io/pgp.txt


View Profile WWW
April 27, 2018, 01:33:06 AM
 #2

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.
wsxdrfv (OP)
Jr. Member
*
Offline Offline

Activity: 405
Merit: 5


View Profile WWW
April 27, 2018, 01:51:54 AM
 #3


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?
RGBKey
Hero Member
*****
Offline Offline

Activity: 854
Merit: 658


rgbkey.github.io/pgp.txt


View Profile WWW
April 27, 2018, 02:41:59 AM
 #4


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?
wsxdrfv (OP)
Jr. Member
*
Offline Offline

Activity: 405
Merit: 5


View Profile WWW
April 27, 2018, 02:58:22 AM
Last edit: April 27, 2018, 04:09:28 AM by wsxdrfv
 #5


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.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!