core.config

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

Given a contract directory hint, 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()[source]

usage: config.py [-h] [–json]

Show the configuration of EOSFactory.

Parameters:
  • --json – Print bare JSON only.
  • -h – Show help message and exit.
eosfactory.core.config.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.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
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_file(contract_dir_hint, contract_file_hint)[source]

Given contract directory and contract file hints, determine a contract file.

The contract directory is determined with the function contract_dir(), basing on the contract_dir_hint argument.

Contract files are ABI or WASM ones. Contract file hint is an absolute path to a contract file, or it is relative to the contract dir, ir it is a file extension.

Any contract directory considered to be structured according to one of the following patterns:

  • all the files in the contract directory,
  • contract files in the build subdirectory.
Parameters:
  • contract_dir_hint (path) – A directory path, may be not absolute.
  • contract_file_hint (str or path) – A file extension, or file 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 with 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()[source]

The absolute path to the contract workspace of the user.

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

If not set, the projects are stored in the contracts directory of the EOSFActory installation.

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

eosfactory.core.config.current_config(contract_dir=None)[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.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_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.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.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.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_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(source_dir)[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.wast_file(contract_dir_hint)[source]

Given the contract directory, return the WAST 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().