Bitcoin Forum
May 05, 2024, 05:01:45 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Using Electrum script to monitor incoming transactions?  (Read 504 times)
Fizpok (OP)
Sr. Member
****
Offline Offline

Activity: 344
Merit: 250


View Profile WWW
September 22, 2017, 10:28:08 AM
 #1

Could anyone help: I have an address, that is receiving money, from time to time. Think online store.
I need to pay comission to authors of the e.book payment was for. Say, $1 incoming, $.3 to A, $.2 to B.
Can I run Electrum, with some script monitoring an address, and whenever money arrive, re-send them to list of addresses?
Or is console script something that runs once and terminates?
Thank you.

Ethereum Programming Guide
Create Solidity contracts: Step-by Step Hands-on Guides.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714885305
Hero Member
*
Offline Offline

Posts: 1714885305

View Profile Personal Message (Offline)

Ignore
1714885305
Reply with quote  #2

1714885305
Report to moderator
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
September 22, 2017, 12:39:56 PM
 #2

There are definitely ways to do it with shell scripts... as there are people who run monitoring scripts on some of the "public" private keys (like the example ones on the Bitcoin wiki)... any deposit into that address is pretty much instantly forwarded to other addresses.

I'm not sure of the specifics tho... but I would think that you could probably setup a cron job that runs the script every X seconds (or minutes or whatever)... and your script would just need to check for new transactions on the appropriate address.

You might find that in this instance, using a Bitcoin Core full node might be a better option as bitcoind has some "notify" options available...

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Fizpok (OP)
Sr. Member
****
Offline Offline

Activity: 344
Merit: 250


View Profile WWW
September 22, 2017, 02:03:34 PM
 #3

Thanks, but bitcoin core is a bit too big. As for cron job - heh, I am under Windows Sad
I do realize that I can use tools to start the script by timer, but my question is, if it has built in observer mode (I even thought about while(1), but I am not sure how to do it on Python with low impact on performance).

Ethereum Programming Guide
Create Solidity contracts: Step-by Step Hands-on Guides.
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
September 22, 2017, 10:04:41 PM
 #4

I am fairly sure that the Electrum command line stuff is non-functional in Windows... ie.  ".\electrum.exe help" will not yield any output.

So, you're not going to be able to make it work with a script anyway...

Bitcoin Core or Electrum on Linux is looking like your best option... Although, maybe you can leverage APIs from the likes of BlockCypher etc: https://www.blockcypher.com/dev/bitcoin/

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Abdussamad
Legendary
*
Offline Offline

Activity: 3612
Merit: 1564



View Profile
September 23, 2017, 11:35:03 AM
 #5

you should not split the payments up after every single transaction. that will cost way too much in fees. instead make periodic payouts to the authors say once a month.
Thekool1s
Legendary
*
Offline Offline

Activity: 1512
Merit: 1218


Change is in your hands


View Profile
September 24, 2017, 07:26:34 PM
 #6

Why don't use a php based solution for this? Electrum isn't designed to work like this, you can easily make a localserver and run a blocktrail server for your payments. It should be quite easy to code a program like this in php and mysql if you have used them before, Other than that, the only way i can think of is through macro recorders but that won't do the job perfectly. So my advice is get an api from blocktrail or any other bitcoin processor and let a script run in the background.
Fizpok (OP)
Sr. Member
****
Offline Offline

Activity: 344
Merit: 250


View Profile WWW
September 25, 2017, 09:45:56 AM
 #7

Why don't use a php based solution for this? Electrum isn't designed to work like this, you can easily make a localserver and run a blocktrail server for your payments. It should be quite easy to code a program like this in php and mysql if you have used them before, Other than that, the only way i can think of is through macro recorders but that won't do the job perfectly. So my advice is get an api from blocktrail or any other bitcoin processor and let a script run in the background.

Could you point me at some starting point/examples?

Ethereum Programming Guide
Create Solidity contracts: Step-by Step Hands-on Guides.
Thekool1s
Legendary
*
Offline Offline

Activity: 1512
Merit: 1218


Change is in your hands


View Profile
September 25, 2017, 10:23:45 AM
 #8

Why don't use a php based solution for this? Electrum isn't designed to work like this, you can easily make a localserver and run a blocktrail server for your payments. It should be quite easy to code a program like this in php and mysql if you have used them before, Other than that, the only way i can think of is through macro recorders but that won't do the job perfectly. So my advice is get an api from blocktrail or any other bitcoin processor and let a script run in the background.

Could you point me at some starting point/examples?

Well you can start from the blocktrail api: https://www.blocktrail.com/api/docs/lang/php It has different examples and covers a whole lot of different subjects. I have a question for you. Are you a programmer or do you have some sort of programming knowledge? if you don't then the link above will not make much sense to you. A script which functions like your idea shouldn't cost more than $150 to make imo.
Fizpok (OP)
Sr. Member
****
Offline Offline

Activity: 344
Merit: 250


View Profile WWW
September 25, 2017, 10:51:04 AM
 #9

Why don't use a php based solution for this? Electrum isn't designed to work like this, you can easily make a localserver and run a blocktrail server for your payments. It should be quite easy to code a program like this in php and mysql if you have used them before, Other than that, the only way i can think of is through macro recorders but that won't do the job perfectly. So my advice is get an api from blocktrail or any other bitcoin processor and let a script run in the background.

Could you point me at some starting point/examples?

Well you can start from the blocktrail api: https://www.blocktrail.com/api/docs/lang/php It has different examples and covers a whole lot of different subjects. I have a question for you. Are you a programmer or do you have some sort of programming knowledge? if you don't then the link above will not make much sense to you. A script which functions like your idea shouldn't cost more than $150 to make imo.

Programmer - yes, Python - no.
I thought of a script in Electrum console, not in command line, but...
I can easily arrange it via AutoIt or like, but it is... humiliating, I'd say Smiley There should be a direct solution.
I'll study your links, thanks.

Ethereum Programming Guide
Create Solidity contracts: Step-by Step Hands-on Guides.
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!