GanacheLaunch

Documentation for eth_defi.provider.ganache.GanacheLaunch Python class.

class GanacheLaunch

Bases: object

Control ganache-cli processes launched on background.

Comes with a helpful close() method when it is time to put Ganache rest.

Attributes summary

Methods summary

__init__(port, cmd, json_rpc_url, process)

close([verbose, block, block_timeout])

Kill the ganache-cli process.

__init__(port, cmd, json_rpc_url, process)
Parameters
  • port (int) –

  • cmd (List[str]) –

  • json_rpc_url (str) –

  • process (psutil.Popen) –

Return type

None

close(verbose=False, block=True, block_timeout=30)

Kill the ganache-cli process.

Ganache is pretty hard to kill, so keep killing it until it dies and the port is free again.

Parameters
  • block – Block the execution until Ganache has terminated

  • block_timeout – How long we give for Ganache to clean up after itself

  • verbose – If set, dump anything in Ganache stdout to the Python logging using level INFO.