solitude module

class solitude.Factory(cfg)[source]

Bases: object

Create a Factory object

The Factory object can be used to create pre-configured objects from a solitude configuration dictionary.

Parameters:cfg – solitude configuration dictionary
__init__(cfg)[source]

Initialize self. See help(type(self)) for accurate signature.

create_client(endpoint=None) → ETHClient[source]

Create a ETHClient object, used to interact with an ethereum node.

Parameters:endpoint – if set, it overrides the Client.Endpoint setting in the configuration
create_compiler() → Compiler[source]
create_linter(add_contract_dir=False) → Linter[source]

Create a Linter object, used to invoke solium.

Parameters:add_contract_dir – whether to load contracts from the directory specified in Compiler.ContractDir or not
create_server() → ETHTestServer[source]

Create a ETHTestServer object, used to start a ganache test node.

get_objectlist() → ContractObjectList[source]
get_project_name()[source]
get_required()[source]
get_sourcelist() → ContractSourceList[source]
solitude.read_config_file(url: str) → dict[source]

Read a solitude configuration from YAML or JSON.

Parameters:url – URL or path of configuration; if url ends with ‘.yaml’, the configuration file is interpreted as YAML, otherwise it is assumed to be JSON.
Returns:configuration dictionary
solitude.write_config_file(cfg: dict, path: str) → None[source]

Write configuration dictionary to file. If the file exists, it will be overwritten.

Parameters:
  • cfg – solitude configuration dictionary.
  • path – destination path.
solitude.make_default_config() → dict[source]

Create a default solitude configuration.

Returns:a configuration dictionary