particl-desktop icon indicating copy to clipboard operation
particl-desktop copied to clipboard

Automate timesync

Open DrDBanner opened this issue 5 years ago • 2 comments

Is your feature request related to a problem? Please describe. The common Timesync problem

Describe the solution you'd like Automatically set NTP syncing during installation and adding a scheduler for resync every hour.

Describe alternatives you've considered Make it a user task (uncool)

Additional context

Time sync is a common problem of Windows and/or your PC under special circumstances.

Meanwhile: Click on the clock in the taskbar and select "Change date and time settings". Turn off "Set time automatically" and then turn it back on. This forces a resync.

Doing this automatically (periodically) is what we might have to implement into the client software.

Force using NTP server Open a cmd prompt: Press [Windows]+[R] to open the “Run” box. Type “cmd” into the box and then press [Ctrl]+[Shift]+[Enter] to run the command as an administrator.

Copy & Paste this into the cmd box

net stop w32time
w32tm /config /syncfromflags:manual /manualpeerlist:"0.it.pool.ntp.org 1.it.pool.ntp.org 2.it.pool.ntp.org 3.it.pool.ntp.org"
net start w32time
w32tm /config /update
w32tm /resync /rediscover

Once done you can automate this

SCHTASKS /CREATE /SC MINUTE /MO 10 /TN "MyTasks\TimeSync10mins" /TR "w32tm /resync" /RU System

DrDBanner avatar Feb 12 '20 12:02 DrDBanner

The time syncronization is simply reported back from a running particl-core instance (daemon). Its output within the particl-desktop application is to inform the user of any potential issues that core may be experiencing in terms of connections to its peers. Thats not to say that the daemon is actually experiencing issues: greater time offsets are very likely to lead to increasing problems with various of services, but its possible that some activity may still be possible.

Its then, from the perspective of the desktop application, unknown whether core is actually experiencing issues with any particular time offset value. And because this depends on additional activities such as actual peer connections, it may differ from daemon to daemon.

I'm hence more inclined to request this to be logged against core instead. However, some investigation into possible options can be done to determine whether specific issues can be determined from various core outputs.

In saying that though, time sync on a device is not as simple as running the script you provided. For example: inputs for specific NTP services connections need to be provided for as the script supplied simply makes assumptions about the user wanting to use pool.ntp.org. Also, other such things as users may have various policies that prevent such changes from occurring (or simply, a user may not be authenticated to change the source on their machine) or may be connected to a network that provides its own time service. Or even that the user has manually configured their machine to not update automatically.

Forcing a script to run to change system config is just plain wrong, so such changes should at worst be optional. Instead, a better solution may be to indicate service degradation within the desktop client, indicating issues and a reason why particularly functionality should be disabled. A user can then perform the necessary system changes as they see fit.

zaSmilingIdiot avatar Feb 12 '20 13:02 zaSmilingIdiot

Ok. I am on the same page. Perhaps a general helpful solution would be to add a link to each problem that the client indicates directing to a resource in the wiki that covers that particular error.

DrDBanner avatar Feb 20 '20 16:02 DrDBanner