Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Add an option to stop parity once in sync #8244

Closed
chevdor opened this issue Mar 28, 2018 · 6 comments
Closed

Add an option to stop parity once in sync #8244

chevdor opened this issue Mar 28, 2018 · 6 comments
Labels
M2-config 📂 Chain specifications and node configurations. Z1-question 🙋‍♀️ Issue is a question. Closer should answer.

Comments

@chevdor
Copy link

chevdor commented Mar 28, 2018

This is not a bug but a feature request aiming at having more users in sync, faster and more consistently, especially for those not operating nodes running 100% of the time.

Similar issue reported for geth: ethereum/go-ethereum#16400

In the early days, Parity has been built as a node and the priority was/is obviously to never stop or break.Today, if we consider the users operating nodes on servers, this is still critical that parity nodes never stops.

We also need to consider another class of users: those who use Parity daily (or almost) and start/stop parity all the time. For those, it used to be fast syncing their node: a few minutes or an hour at max would fetch a good week or too of blocks.

This is no longer the case. Nowadays, not syncing every day becomes quickly painful.

I propose the addition of a new flag that would stop and exit when the chain has been caught up.
It could something like:
parity --exit-when-synced N
With N being the number of seconds to keep running once the chain is in sync. N=0 means parity exists immediately once the chain is caught up.

Having this flag means users could sync all their parity chains (fundation, ropsten, kovan) overnight on a single machine by simply chaining the syncs:

parity --chain kovan --exit-when-synced 15 && \
parity --chain ropsten --exit-when-synced 15 && \
parity --exit-when-synced

Once all the syncs are done, the poor (but warm) laptop could go back to rest for a good part of the night.

Recently, as a workaround to that, I published https://github.com/chevdor/ethup. One benefit of ethup is that it supports geth as well but I think it would be more elegant to have a solution directly in parity, without having to install additional npm packages.

@5chdn
Copy link
Contributor

5chdn commented Mar 28, 2018

Just turn it off after sync like this:

parity --mode passive --mode-alarm 2147483647

It will stop syncing once done for 68 years.

To do this for multiple chains, just do:

parity --mode passive --mode-alarm 2147483647 & \
parity --mode passive --mode-alarm 2147483647 --chain kovan --ports-shift 100 & \
parity --mode passive --mode-alarm 2147483647 --chain ropsten --ports-shift 200

@5chdn 5chdn closed this as completed Mar 28, 2018
@5chdn 5chdn added Z1-question 🙋‍♀️ Issue is a question. Closer should answer. M2-config 📂 Chain specifications and node configurations. labels Mar 28, 2018
@5chdn 5chdn added this to the 1.11 milestone Mar 28, 2018
@chevdor
Copy link
Author

chevdor commented Mar 28, 2018

Thanks @5chdn
I tried using: parity --mode passive --mode-alarm 15 but parity never exited.

@5chdn
Copy link
Contributor

5chdn commented Mar 28, 2018

15 means it will switch back to active after 15 seconds

@chevdor
Copy link
Author

chevdor commented Apr 4, 2018

So in short, there is no way to exit the client using this option, it will only switch back to 'active' sooner or later. Is that correct?

@5chdn
Copy link
Contributor

5chdn commented Apr 4, 2018

Yes, there is no way to terminate parity "from within"

@chevdor
Copy link
Author

chevdor commented Apr 4, 2018

Ok, thanks for the confirmation. So I think ethup remains a valid workaround for now but I like samples you provided for --ports-shift.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
M2-config 📂 Chain specifications and node configurations. Z1-question 🙋‍♀️ Issue is a question. Closer should answer.
Projects
None yet
Development

No branches or pull requests

2 participants