How to use the octobot.constants.CONFIG_FILE_SCHEMA function in OctoBot

To help you get started, we’ve selected a few OctoBot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Drakkar-Software / OctoBot / octobot / cli.py View on Github external
except Exception as e:
            logger.error(f"Impossible to identify the current running environment: {e}")

        # _check_public_announcements(logger)

        logger.info("Loading config files...")

        # configuration loading
        config = load_config(error=False, fill_missing_fields=True)

        if config is None and is_config_empty_or_missing():
            logger.info("No configuration found creating default...")
            init_config()
            config = load_config(error=False)
        else:
            is_valid, e = validate_config_file(config=config, schema_file=CONFIG_FILE_SCHEMA)
            if not is_valid:
                logger.error("OctoBot can't repair your config.json file: invalid format: " + str(e))
                raise ConfigError
            config_health_check(config)

        if config is None:
            raise ConfigError

        # Handle utility methods before bot initializing if possible
        if args.encrypter:
            exchange_keys_encrypter()
            return

        # Add tentacles folder to Python path
        sys.path.append(os.path.realpath(os.getcwd()))
github Drakkar-Software / OctoBot-Tentacles / Services / Interfaces / web_interface / models / configuration.py View on Github external
def update_global_config(new_config, delete=False):
    current_edited_config = get_edited_config()
    if not delete:
        _handle_special_fields(new_config)
    config_manager.update_global_config(new_config,
                                        current_edited_config,
                                        CONFIG_FILE_SCHEMA,
                                        is_backtesting_enabled(current_edited_config),
                                        UPDATED_CONFIG_SEPARATOR,
                                        update_input=True,
                                        delete=delete)
    return True
github Drakkar-Software / OctoBot-Tentacles / Services / Interfaces / web_interface / models / interface_settings.py View on Github external
def _save_edition():
    config_manager.simple_save_config_update(get_edited_config(), schema_file=CONFIG_FILE_SCHEMA)
    return True