Bitcoin Forum
May 22, 2024, 01:40:23 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Way to fire up Bitcoin-QT once a week to sync blocks, then quit?  (Read 1617 times)
aferret (OP)
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
July 11, 2014, 07:52:35 PM
 #1

Hey all,

I'm not very much involved with Bitcoin anymore, but I do still do minor amounts of mining, and occasionally do micropayments.  Ergo, I'd like to maybe once a week, once a month spin up my client just to synchronize blocks (so if I *do* need to use it, it's current), and shut down.

I'm on mac, for what it's worth.

The --help seems to imply there's no way to quit automatically, and without messing with the JSON API and whatnot, I suppose the easiest way is to start up at 3am, run for a few hours, then send a kill to the PID file, but that feels dirty.  What I'm really looking for is something more like "run until synchronized, OR for a maximum of N hours".

Is there a better way that I'm missing?  Is this/should this be a feature request?
azeteki
Member
**
Offline Offline

Activity: 96
Merit: 10

esotericnonsense


View Profile WWW
July 11, 2014, 08:08:31 PM
 #2

You said you didn't want to mess with the API, but in case you do, it should not be that difficult to make up a script that can achieve this.

Start up bitcoin-qt.

Using JSON-RPC, poll it for latest block every now and then ('getbestblockhash', 'getblock').
Assume you are synced when the 'time' field is within say 12 hours of your system time.
Using JSON-RPC, send 'stop' request.

A cron job with a bash script (does mac have equivalents?) seems capable of doing it.

dserrano5
Legendary
*
Offline Offline

Activity: 1974
Merit: 1029



View Profile
July 11, 2014, 08:45:39 PM
 #3

The --help seems to imply there's no way to quit automatically, and without messing with the JSON API and whatnot, I suppose the easiest way is to start up at 3am, run for a few hours, then send a kill to the PID file, but that feels dirty.

If you're going to run bitcoin at 3am, why not do it daily? You can let it run for 2-3 hours, then issue a 'bitcoin-cli stop' and you'll always have the chain pretty much updated.
InwardContour
Sr. Member
****
Offline Offline

Activity: 644
Merit: 260


View Profile
July 12, 2014, 07:37:25 PM
 #4

Every Sunday you can simply open QT via the spotlight, let it run while you do your thing on your computer, checking every two hours or so and when you see the green check that shows it is fully synced you can press "apple" + "Q" to close it.

It could not be more simple then this
Relnarien
Sr. Member
****
Offline Offline

Activity: 399
Merit: 257


View Profile
July 13, 2014, 04:23:59 AM
 #5

Hey all,

I'm not very much involved with Bitcoin anymore, but I do still do minor amounts of mining, and occasionally do micropayments.  Ergo, I'd like to maybe once a week, once a month spin up my client just to synchronize blocks (so if I *do* need to use it, it's current), and shut down.

I'm on mac, for what it's worth.

The --help seems to imply there's no way to quit automatically, and without messing with the JSON API and whatnot, I suppose the easiest way is to start up at 3am, run for a few hours, then send a kill to the PID file, but that feels dirty.  What I'm really looking for is something more like "run until synchronized, OR for a maximum of N hours".

Is there a better way that I'm missing?  Is this/should this be a feature request?

I'm a little confused about what you actually want to do. You can just set automated tasks on your Mac to launch the client and shutdown your computer if that's all you really need. Isn't Automator available for the version of Mac OS that you're using?
cp1
Hero Member
*****
Offline Offline

Activity: 616
Merit: 500


Stop using branwallets


View Profile
July 13, 2014, 04:27:41 AM
 #6

The --help seems to imply there's no way to quit automatically, and without messing with the JSON API and whatnot, I suppose the easiest way is to start up at 3am, run for a few hours, then send a kill to the PID file, but that feels dirty.

If you're going to run bitcoin at 3am, why not do it daily? You can let it run for 2-3 hours, then issue a 'bitcoin-cli stop' and you'll always have the chain pretty much updated.

Yeah, just do whatever cron is called on mac with two jobs, one to start and one to stop.

Guide to armory offline install on USB key:  https://bitcointalk.org/index.php?topic=241730.0
AliceWonder
Full Member
***
Offline Offline

Activity: 168
Merit: 100



View Profile
July 13, 2014, 09:56:59 PM
 #7

The --help seems to imply there's no way to quit automatically, and without messing with the JSON API and whatnot, I suppose the easiest way is to start up at 3am, run for a few hours, then send a kill to the PID file, but that feels dirty.

If you're going to run bitcoin at 3am, why not do it daily? You can let it run for 2-3 hours, then issue a 'bitcoin-cli stop' and you'll always have the chain pretty much updated.

Yeah, just do whatever cron is called on mac with two jobs, one to start and one to stop.

They call it something else but the user crontab command is still there and it still reads a standard crontab file.

At least on whatever version of OS X my mum has.

QuarkCoin - what I believe bitcoin was intended to be. On reddit: http://www.reddit.com/r/QuarkCoin/
InwardContour
Sr. Member
****
Offline Offline

Activity: 644
Merit: 260


View Profile
July 14, 2014, 01:58:20 AM
 #8

The --help seems to imply there's no way to quit automatically, and without messing with the JSON API and whatnot, I suppose the easiest way is to start up at 3am, run for a few hours, then send a kill to the PID file, but that feels dirty.

If you're going to run bitcoin at 3am, why not do it daily? You can let it run for 2-3 hours, then issue a 'bitcoin-cli stop' and you'll always have the chain pretty much updated.

Yeah, just do whatever cron is called on mac with two jobs, one to start and one to stop.
Even this is much more complicated then it needs to be. The OP can simply open bitcoin QT and close it once it has synched the blockchain. This would take no more then a total of 30 seconds of the OP's time every week.
nwfella
Legendary
*
Offline Offline

Activity: 1582
Merit: 1000

Well hello there!


View Profile
July 14, 2014, 07:55:57 AM
 #9

Use Cocktail to schedule regular startup's with shutdown's issued after whatever time period is reasonable given how often you update your wallet and the speed with which your system/connection does it.

¯¯̿̿¯̿̿'̿̿̿̿̿̿̿'̿̿'̿̿̿̿̿'̿̿̿)͇̿̿)̿̿̿̿ '̿̿̿̿̿̿\̵͇̿̿\=(•̪̀●́)=o/̵͇̿̿/'̿̿ ̿ ̿̿

Gimme the crypto!!
kokojie
Legendary
*
Offline Offline

Activity: 1806
Merit: 1003



View Profile
July 14, 2014, 04:22:14 PM
 #10

Same as on any OS, use the task scheduler for your OS, to start bitcoin-qt, wait 2-3 hours, then shut it down.


btc: 15sFnThw58hiGHYXyUAasgfauifTEB1ZF6
Sydboy
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile
July 14, 2014, 07:22:12 PM
 #11

lol yeah. OP will spend 6 weeks researching and testing this when it could easily be done with a few clicks.

The --help seems to imply there's no way to quit automatically, and without messing with the JSON API and whatnot, I suppose the easiest way is to start up at 3am, run for a few hours, then send a kill to the PID file, but that feels dirty.

If you're going to run bitcoin at 3am, why not do it daily? You can let it run for 2-3 hours, then issue a 'bitcoin-cli stop' and you'll always have the chain pretty much updated.

Yeah, just do whatever cron is called on mac with two jobs, one to start and one to stop.
Even this is much more complicated then it needs to be. The OP can simply open bitcoin QT and close it once it has synched the blockchain. This would take no more then a total of 30 seconds of the OP's time every week.
AliceWonder
Full Member
***
Offline Offline

Activity: 168
Merit: 100



View Profile
July 14, 2014, 09:18:28 PM
 #12

lol yeah. OP will spend 6 weeks researching and testing this when it could easily be done with a few clicks.

Automating things means you don't have to remember, and means you can schedule it to take place when you normally aren't doing other things. And automating probably means he can do with bitcoind instead of bitcoin-qt

QuarkCoin - what I believe bitcoin was intended to be. On reddit: http://www.reddit.com/r/QuarkCoin/
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!