NebulousLabs/Sia-UI

Move the loadingScreen.js modules to config.json for ability to tune which are loaded.

4Dolio opened this issue · 0 comments

Accidentally posted this at NebulousLabs/Sia#2585 (comment) first.
Feature Request:

  • Easy tuning of which modules to run when launching Sia-UI!
  • OS: Windows
  • Version 1.3.1-Release

Per NebulousLabs/Sia#2452 (comment) I was tipped off to try and modify : ...\SiaCoin\Sia-UI-v1.3.1-win32-x64\resources\app\js\rendererjs\loadingScreen.js to modify line ~128 to exclude unwanted modules. I attempted to use 'modules': 'cgrtw' so to not load the unneeded host module. But it appears to have not worked, host appears to still be running. Perhaps it would need to be recompiled into the blob? Shrugs.

The most obvious place for such a tunable seems like ...\AppData\Roaming\Sia-UI\config.json where there is already a nice block for the siad, adding a modules key:value pair would be nice.

I have resorted to creating this ...\SiaCoin\Sia-UI-v1.3.1-win32-x64\resources\app\siad.exe.vbs which lives next to the siad.exe daemon executable. It will start siad with the desired modules. It launches the siad in the background so to not leave a .bat or .cmd window floating about. Next you launch Sia-UI normally and it will communicate with this siad daemon rather than starting one with the default modules itself. This is useful for me on my renter-only laptop so it does not bother the UPNP of another system running the host. It could also be used on a host so to not run the renter module perhaps. Perhaps the miner module could also be enabled by changing the module flags used but I have not tried that.

' Place this .vbs next to your siad.exe and use it to, launch siad 
' without host module, in the background, leaving no parent terminal.
' When you run Sia-UI it will talk to the siad deamon this script launched.
' Create a windoes shortcut to this script wherever you find most convenient.

' NOTICE: the normal task tray RightClick and Quit will not stop the siad launched from this script.
' It would be better to print this in a dialog one could then click on to acknowledge. Feature.

' To exit gracefully type stop in Sia-UI >_ Terminal, run .vbs again to resume.
' Note that upon stop the terminal still prints that the host module was start/stopped, lies, odd.
' The host tab of Sia-UI will still be present and proclaim that the wallet should be unlocked, ignore.

DIM objShell
Set objShell = CreateObject( "WScript.Shell" )
appDataLocation=objShell.ExpandEnvironmentStrings("%APPDATA%")
siad_deamon = "siad.exe -d " & appDataLocation & "\Sia-UI\sia -Mgctwr"
set objShell=wscript.createObject("wscript.shell")
iReturn=objShell.Run(siad_deamon, 0, TRUE)

' End of dumb visual basic script.