Saturday, August 24, 2013

Using Web Config Files in CGWatcher

Using Web Config Files in CGWatcher

While CGRemote will make managing all of your miners as easy as configuring just one, it is not yet finished. Until then, CGWatcher provides features that make this much easier than it has been in the past. A few features that specifically address this are:

Web Config Files

CGWatcher allows you to use URLs when specifying a config file in Profile Manager. This means you can create one config, save it online, and use it across some or all of your miners. Web Config Files are downloaded to each computer as is necessary because the miner doesn't allow URLs. It also saves each web config file as a Named Config File, meaning you can access its URL in the drop-down list in Profile Manager. 

Each time CGWatcher starts or restarts cgminer or bfgminer using a profile with a web config, it is re-downloaded to ensure it is using the latest settings. You can also update these files manually by either re-saving the profile in Profile Manager, or opening the web config file in Config File Editor and clicking the Reload button at the bottom next to its URL.

CGWatcher Variables

Variables allow you to create name/value pairs to use in config files, arguments, or batch files. When CGWatcher finds a variable name (enclosed in %...%) it replaces it with that variable's value. This means you can use a variable in multiple config files, and changing its value would change it for all. This also means that when you're using web config files to share a config file between miners, you can allow each miner to customize the config to its own hardware.

Variables are replaced in config files, arguments, and batch files right before the miner is started or restarted. CGWatcher now uses temporary config files and batch files, meaning your originals aren't modified.

To set variables, go to the Settings tab and click the 'Other Tools...' button, then select 'Manage Variables' in the popup menu. Alternatively you can press Ctrl+Shift+V.

This example shows two miners sharing a web config file that uses variables, allowing each miner to fill in its own settings.


While arguments in profiles have been around since profiles have, they can also be used to customize a web config file being shared by many miners. This is because arguments are stored locally on each miner, and these arguments override any settings that are also found in the config file. If the config file says "intensity" : "13" but Miner A has argument --intensity 15, it will use 15 intensity. Other miners using this web config would use 13 intensity unless they too have an intensity specified in their profile's arguments.

More Customization and Sharing
As many users know, profiles are stored in a file called profiles.dat. Variables are stored in a file called variables.ini. You can now change the location of these files if you wish, by moving them and then editing their paths in CGWatcher.exe.ini. Look for the following settings:



This would allow you to also share these files between miners, if you should find that useful. In an upcoming version you will also be able to store profiles online, so you can create a master list of profiles for all of your miners to use, while still being able to create profiles locally for each miner.

Need Somewhere to Store Config Files Online?

Pastebin is great for storing config files. Create an account so you can log in should you ever want to change settings. It is important though that when getting the paste's URL you only use the RAW URL in Profile Manager. You can get this by viewing the paste and then clicking the RAW link near the top. This will open up your paste in a new tab where only the text is displayed, no HTML or other web page elements. This is important because you do not want any HTML included in the config file when it is downloaded. The RAW link is a link to the paste text only, no HTML. If you use a different site to host your config files, make sure there is no HTML included in the config file.

An example of a normal paste URL: (do not use this type of URL)

Its RAW URL: (use this type of URL)

Questions/Comments? Feel free to share them below.


  1. This is a cool feature but I can't get it working. I want to have a config file with a variable for my pool username (each rig has a different username)

    I've set up the variable User=xxxx in cgwatcher
    I've changed the config file entry to "user" : %USER%,

    When I try to save I get "an exception occured" pointing to the first % symbol in that line.

    Am I doing something wrong here?

    1. Actually ignore me, I didn't put the variable in quotes it should have been

      "user" : "%USER%",