Bitcoin Forum
May 02, 2024, 12:16:38 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to send bitcoin automatically?  (Read 458 times)
wsxdrfv (OP)
Jr. Member
*
Offline Offline

Activity: 405
Merit: 5


View Profile WWW
June 04, 2018, 06:48:03 AM
 #1

If bitcoin's balance is higher than some standard (like 0.2 BTC), how to send another address automatically?

I want to make this process automatic.

I am using ubuntu and at there bitcoin daemon is running.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
June 04, 2018, 07:18:53 AM
Merited by mdayonliner (1)
 #2

A simple script and "cron" should be able to do this... The script can simply use bitcoin-cli and RPC calls to check the balance of the address... then, if addressBalance > $target, create a transaction that sends BTC to the address you want to send to.

Once you have the script working OK, you can use Cron to schedule the task to run every 5-10 minutes (or hourly or daily or whatever you like).

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


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
reflector
Sr. Member
****
Offline Offline

Activity: 826
Merit: 263



View Profile
June 04, 2018, 01:58:59 PM
 #3

If bitcoin's balance is higher than some standard (like 0.2 BTC), how to send another address automatically?

I want to make this process automatic.

I am using ubuntu and at there bitcoin daemon is running.

As HCP said you could use the script to push the transaction on the concern wallet you want bro. You could find some exchanges and mining pool wallet do this work. You could take that as a example for it mate.
If you do not want to do work on script side. You will be able to use the exchange the wallet and add the limited fund push after the it reaches the withdrawal limit mate.
wsxdrfv (OP)
Jr. Member
*
Offline Offline

Activity: 405
Merit: 5


View Profile WWW
June 04, 2018, 11:59:22 PM
 #4

A simple script and "cron" should be able to do this... The script can simply use bitcoin-cli and RPC calls to check the balance of the address... then, if addressBalance > $target, create a transaction that sends BTC to the address you want to send to.

Once you have the script working OK, you can use Cron to schedule the task to run every 5-10 minutes (or hourly or daily or whatever you like).

Thanks. So how can I make that script? Is it shell programming? If then, what is the code that run command line execution inside shell script?
I want to see exact code example.
mr-anonymous
Jr. Member
*
Offline Offline

Activity: 30
Merit: 4


View Profile
June 05, 2018, 01:28:07 AM
Merited by btj (2)
 #5

If you are coder, make it from JSON RPC.
wsxdrfv (OP)
Jr. Member
*
Offline Offline

Activity: 405
Merit: 5


View Profile WWW
June 05, 2018, 05:35:04 AM
 #6

If you are coder, make it from JSON RPC.
Yes I am coder, but familiar with C#.

Anyway, how to make from JSON RPC. How? exact process workflow?
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
June 05, 2018, 08:19:22 AM
 #7

Thanks. So how can I make that script? Is it shell programming? If then, what is the code that run command line execution inside shell script?
I want to see exact code example.

You seem to ask a lot of basic questions.

HCP already gave you pseudo code with your logic, you can work with.

If we would give you an further 'example', it already would be the whole code. Thats literally less than 10 lines of code..


Without offending you.. but if you can't create such a small script (and can't find anything on google), you probaly shouldn't work on a crypto project.

Please do yourself a favor and do NOT create/host a crypto site/project/exchange/.. Your application will definitely be vulnerable.
You are inviting black hats into stealing your funds..

mr-anonymous
Jr. Member
*
Offline Offline

Activity: 30
Merit: 4


View Profile
June 05, 2018, 09:57:52 PM
Merited by btj (2)
 #8

If you are coder, make it from JSON RPC.
Yes I am coder, but familiar with C#.

Anyway, how to make from JSON RPC. How? exact process workflow?


There more informations from here:
https://bitcoin.stackexchange.com/questions/5810/how-do-i-call-json-rpc-api-using-c

You can use
Quote
getbalance
method to check if amount to send is available.

And then
Quote
sendfrom
to the amount to another address.

But i think sendfrom is disabled, you have to host a PHP script on your node server that serve as API for your own script.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4612



View Profile
June 08, 2018, 04:16:53 PM
 #9

If bitcoin's balance is higher than some standard (like 0.2 BTC), how to send another address automatically?

I want to make this process automatic.

This question sounds like it has significant potential to be an XY problem.

Why do you want "to send another address automatically?"  I suspect that there might be a better way to accomplish what you want instead of doing that.
wsxdrfv (OP)
Jr. Member
*
Offline Offline

Activity: 405
Merit: 5


View Profile WWW
June 11, 2018, 03:31:40 AM
 #10

If bitcoin's balance is higher than some standard (like 0.2 BTC), how to send another address automatically?

I want to make this process automatic.

This question sounds like it has significant potential to be an XY problem.

Why do you want "to send another address automatically?"  I suspect that there might be a better way to accomplish what you want instead of doing that.
Because I want to automatically move coin to more safe place.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4612



View Profile
June 11, 2018, 03:42:12 AM
 #11

I want to automatically move coin to more safe place.

Perhaps you should just receive it at the "more safe place" originally.  Then you won't have to move it.
pebwindkraft
Sr. Member
****
Offline Offline

Activity: 257
Merit: 343


View Profile
June 12, 2018, 08:09:39 AM
 #12

I want to automatically move coin to more safe place.

Perhaps you should just receive it at the "more safe place" originally.  Then you won't have to move it.
In another thread OP is asking on cold storage. I think he wants to collect his coins on the live system, and when it goes over a certain threashold, move the funds to the cold storage. Similar as to what the exchanges would do with hot and cold wallets.
I had a similar setup with a mining provider. Every day or week I would receive funds from them. A part was used to buy beer  Smiley At a certain height, I pushed a part manually to my cold storage system.
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
June 12, 2018, 10:33:59 AM
 #13

I want to automatically move coin to more safe place.

Perhaps you should just receive it at the "more safe place" originally.  Then you won't have to move it.
I think he wants to collect his coins on the live system, and when it goes over a certain threashold, move the funds to the cold storage.

Thats self-explanatory.
DannyHamilton is still right. The 'better' way of doing it would be to receive the payments to the cold storage directly.
Thats way less prone to errors than receiving everything in a hot wallet to forward it afterwards. I don't see the actual benefit.


Every day or week I would receive funds from them. A part was used to buy beer  Smiley At a certain height, I pushed a part manually to my cold storage system.

If you are using two wallets (hot-/cold-), it is recommended (security-wise) to receive them to your cold wallet, which you then use to fund your hot wallet. Not vice-versa.

realpseudozach
Full Member
***
Offline Offline

Activity: 170
Merit: 108


View Profile WWW
June 15, 2018, 08:32:29 AM
 #14

If bitcoin's balance is higher than some standard (like 0.2 BTC), how to send another address automatically?

I want to make this process automatic.

This question sounds like it has significant potential to be an XY problem.

Why do you want "to send another address automatically?"  I suspect that there might be a better way to accomplish what you want instead of doing that.
Because I want to automatically move coin to more safe place.

Agree that you should receive to the cold storage but if you still want to do simple operations with a wallet. You can use https://github.com/ruimarinho/bitcoin-core to getbalance and if it's over a certain threshold simply sendToAddress. Note that you'll need a full node obviously.

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!