Config files

From Open Transactions
Revision as of 13:48, 12 June 2013 by Cryptoman (talk | contribs) (Created page with "'''.ini file:''' When either the OT Server (transaction.exe), or the OT command-line test client (testwallet.exe) starts up, it tries to read from the ini file. The '''locati...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

.ini file:

When either the OT Server (transaction.exe), or the OT command-line test client (testwallet.exe) starts up, it tries to read from the ini file. The location of the ini file is subject to change but for now, it is: C:\ot.ini (Windows systems) ~/.ot_ini (Non-Windows)

If the ini file fails opening, then OT will assuming the data_folder path is: ./data_folder

The ini file currently only stores the DEFAULT PATHS for the data_folder. Here's the ini file on my system (located at ~/.ot_ini):

;; Open-Transactions ini file


(You don't have to use the .ini file, it's just a convenience. You'll otherwise have to provide these paths explicitly, whenever you start OT.)

Eventually the ini file will store all sorts of things. Suggestions?

Config Files

While the ini files are per-user, the config files are per-application. When Open-Transactions starts up, the server and client will each try to read from their respective config files.

The config file is located relative to the data_folder location. When OT starts up, the initial data_folder path is read either A. from your ini file, or B. passed in on the command line, or C. set by a call to OT_API_Init(const char * szPath).

Continuing the above example, this "main path" aka "data_folder path" would be: /Users/au/Projects/Open-Transactions/testwallet/data_folder

From there, an OT client will assume that its configuration file is named "ot_client.cfg", and that it can be found in that folder, but ONE LEVEL UP. That is, /Users/au/Projects/Open-Transactions/testwallet/data_folder/../ot_client.cfg (Meaning, it's actually looking here: /Users/au/Projects/Open-Transactions/testwallet/ot_client.cfg)

For the OT server, the config file would similarly be located at: /Users/au/Projects/Open-Transactions/transaction/data_folder/../ot_server.cfg aka: /Users/au/Projects/Open-Transactions/transaction/ot_server.cfg

(The location is one level up, SO THAT you can swap out your data_folder indiscriminately, yet without losing your config file each time.)

Here are the contents of my ot_client.cfg file (located at Open-Transactions/testwallet/ot_client.cfg):

;; Open-Transactions client-side config file.



If the above logfile_path is set (as above), then the OT API will log to that file. Otherwise all of the logs are outputted to stderr.

(OT no longer logs to stdout, in preparation for upcoming command-line utilities. )

The log_level ranges from -1 (no output) to 5 (very verbose / debugging). Use 5 to see many logs. 2 or 3 should be plenty high enough for most people, with 0 and 1 preferred.

What kinds of values would YOU like to see in the config file? Let me know!