core.config

eosfactory.core.config.abi_file(contract_dir_hint)[source]

Given the contract directory, return the ABI file path. See contract_file().

Parameters:contract_dir_hint – A directory path, may be not absolute.
Raises:core.errors.Error – If the result is not defined.
eosfactory.core.config.chain_state_db_size_mb()[source]

The size of the buffer of the local node.

The value of the option chain-state-db-size-mb in the command line for the nodeos executable.

It may be changed with EOSIO_SHARED_MEMORY_SIZE_MB entry in the config.json file, see current_config().

eosfactory.core.config.cli_exe()[source]

The path to the cleos executable.

The setting may be changed with EOSIO_CLI_EXECUTABLE entry in the config.json file, see current_config().

eosfactory.core.config.config_file()[source]

The path to the config.json file.

eosfactory.core.config.config_map()[source]

Return a JSON object read from the config.json file.

Raises:core.errors.Error – If the JSON object cannot be returned.
eosfactory.core.config.config_value(config_list)[source]

Get the first item from config_values().

Parameters:config_list (()) – A configure list tuple.
eosfactory.core.config.config_value_checked(config_list)[source]

Get the first item from config_values(). Raise an error if fails.

Parameters:config_list (tuple) – A configure list tuple.
Raises:core.errors.Error – If the result is not defined.
eosfactory.core.config.config_values(config_list)[source]

List values ascribed to the key of a hard-codded configuration list.

First, consider the config.json, next the values of the hard-codded configuration list.

Parameters:config_list (tuple) – A configure list tuple.
eosfactory.core.config.contract_dir(contract_dir_hint)[source]

Given a hint, determine the contract root directory.

The contract_dir_hint is tested to be either
  • an absolute path, or
  • a path relative to either
    • the directory given with contract_workspace(), or
    • the directory given with eosf_dir() /contracts.
Parameters:contract_dir_hint (path) – A directory path, may be not absolute.
Raises:core.errors.Error – If the result is not defined.
eosfactory.core.config.contract_source_files(contract_dir_hint)[source]

List files CPP/C and ABI files from directory given a hint.

Parameters:contract_dir_hint (str) – An argument to the function contract_dir()
Raises:core.errors.Error – If the list is empty.
eosfactory.core.config.contract_workspace_dir(dont_set_workspace=False)[source]

The absolute path to the contract workspace.

The contract workspace is a directory where automatically created projects are placed by default. It is set while EOSFactory is installed.

If not set, the projects are stored in the .config.CONTRACTS_DIR subdirectory (typically contracts/) of the EOSFActory installation, if EOSFactory is installed from its GitHub repository, otherwise, they go to a directory specified as join(.config.TMP, .config.CONTRACTS_DIR).

The setting may be changed with EOSIO_CONTRACT_WORKSPACE entry in the config.json file, see current_config().

Parameters:dont_set_workspace (bool) – If set, do not query for empty workspace directory.
eosfactory.core.config.current_config(contract_dir=None, dont_set_workspace=False)[source]

Present the current configuration.

The current configuration result from both the config.json file setting and default hard-codded setup. The config.json prevails.

Parameters:str() (contract_dir) – If set

Note

The current configuration can be seen with the bash command:

python3 -m eosfactory.core.config

eosfactory.core.config.data_dir()[source]

Directory containing runtime data of nodeos.

It may be changed with LOCAL_NODE_DATA_DIR entry in the config.json file, see current_config().

eosfactory.core.config.eosf_dir()[source]

The absolute directory of the EOSFactory installation.

eosfactory.core.config.eosfactory_data()[source]

Data directory.

For developer’s installation, data is in the root of the installation. .: wsl_root.sh config: config.ini, config.json, genesis.json, … contracts: eosio_token, hello_world, tic_tac_toe, … templates: contracts, … includes: eoside, … libs: …

eosfactory.core.config.eoside_includes_dir()[source]

The directory for contract definition includes.

It may be set with INCLUDE entry in the config.json file, see current_config().

eosfactory.core.config.eoside_libs_dir()[source]

The directory for contract links.

It may be set with LIBS entry in the config.json file, see current_config().

eosfactory.core.config.eosio_cdt_root()[source]

The path to the eosio-cpp installation directory.

The setting may be changed with EOSIO_CPP entry in the config.json file, see current_config().

eosfactory.core.config.eosio_cpp()[source]

The path to the eosio-cpp executable.

The setting may be changed with EOSIO_CPP entry in the config.json file, see current_config().

eosfactory.core.config.eosio_cpp_includes()[source]

The list of eosio-cpp includes.

The setting may be changed with EOSIO_CPP entry in the config.json file, see current_config().

eosfactory.core.config.eosio_key_private()[source]

eosio account private key.

A private key used as the value of the option signature-provider in the command line for the nodeos executable.

It may be changed with EOSIO_KEY_PRIVATE entry in the config.json file, see current_config().

eosfactory.core.config.eosio_key_public()[source]

eosio account public key.

A public key used as the value of the option signature-provider in the command line for the nodeos executable.

It may be changed with EOSIO_KEY_PUBLIC entry in the config.json file, see current_config().

eosfactory.core.config.first_valid_path(config_list, find_file=None, raise_error=True)[source]

Given a key to the config list, get a valid file system path.

Applicable if the config_list argument refers to a file path. The path may be absolute or relative to the root of the EOSFactory installation.

Also, the path may be relative to the HOME environment variable.

Parameters:
  • config_list (tuple) – A configure list tuple.
  • find_file (str) – If set, the given file has to exist.
  • raise_error (bool) – If set, raise an error on failure.
Raises:

core.errors.Error – If the raise_error argument is set and the result is not defined.

eosfactory.core.config.first_valid_which(config_list, find_file=None, raise_error=True)[source]

Given a key to the config list, get a valid file system path.

Applicable if the config_list argument refers to a file path. The path may be absolute or relative to the root of the EOSFactory installation.

Also, the path may be relative to the HOME environment variable.

Parameters:
  • config_list (tuple) – A configure list tuple.
  • find_file (str) – If set, the given file has to exist.
  • raise_error (bool) – If set, raise an error on failure.
Raises:

core.errors.Error – If the raise_error argument is set and the result is not defined.

eosfactory.core.config.genesis_json()[source]

File to read Genesis State from.

It may be changed with EOSIO_GENESIS_JSON entry in the config.json file, see current_config().

eosfactory.core.config.http_server_address()[source]

The http/https URL where local nodeos is running.

The setting may be changed with LOCAL_NODE_ADDRESS entry in the config.json file, see current_config().

eosfactory.core.config.http_wallet_address()[source]

The http/https URL where keosd is running.

The setting may be changed with WALLET_MANAGER_ADDRESS entry in the config.json file, see current_config().

eosfactory.core.config.installation_dependencies(config_map)[source]

Verify whether ‘eosio’ and ‘eosio.cpp’ packages are properly installed.

eosfactory.core.config.keosd_exe()[source]

The path to the keosd executable.

The setting may be changed with KEOSD_EXECUTABLE entry in the config.json file, see current_config().

eosfactory.core.config.keosd_wallet_dir(raise_error=True)[source]

The path to the local wallet directory.

The path is hard-coded in the keosd wallet manager.

Parameters:raise_error (bool) – If set, rise an error if the path is invalid.
Raises:core.errors.Error – If the directory does not exist.
eosfactory.core.config.main()[source]
usage: config.py [-h] [–wsl_root] [–dependencies] [–json]
[–workspace WORKSPACE]

Show the configuration of EOSFactory or set contract workspace.

Parameters:
  • --help Show this help message and exit (-h,) –
  • Show set the root of the WSL and exit. (--wsl_root) –
  • List dependencies of EOSFactory and exit. (--dependencies) –
  • Ignore empty workspace directory. (--dont_set_workspace) –
  • Bare config JSON and exit. (--json) –
  • WORKSPACE Set contract workspace and exit. (--workspace) –
eosfactory.core.config.node_exe()[source]

The path to the nodeos executable.

The setting may be changed with LOCAL_NODE_EXECUTABLE entry in the config.json file, see current_config().

eosfactory.core.config.nodeos_config_dir()[source]

Directory containing configuration files such as config.ini.

It may be changed with LOCAL_NODE_CONFIG_DIR entry in the config.json file, see current_config().

eosfactory.core.config.nodeos_stdout()[source]

Set stdout file for the stdout stream of the local node.

If the value of NODEOS_STDOUT entry in the config.json file is set, the local node logs to the specified file its output, see current_config().

Note

The same may be achieved with the nodeos_stdout argument in the function core.manager.resume().

eosfactory.core.config.source_files(search_dir, extensions, recursively=False)[source]

List files CPP/C and ABI files from the given directory

eosfactory.core.config.wasm_file(contract_dir_hint)[source]

Given the contract directory, return the WASM file path. See contract_file().

Parameters:contract_dir_hint – A directory path, may be not absolute.
Raises:core.errors.Error – If the result is not defined.
eosfactory.core.config.write_config_map(map)[source]

Write the given json object to config.json.

Parameters:map (json) – The json object to be saved.
Raises:core.errors.Error – If the JSON object cannot be saved.
eosfactory.core.config.wsl_root()[source]

The root directory of the Windows WSL.

The root directory of the Ubuntu file system, owned by the installation, if any, of the Windows Subsystem Linux (WSL).

It may be changed with WSL_ROOT entry in the config.json file, see current_config().