NetworksYML

Handle operations around networks.yml

Example File

# networks.yml
---
dev:
  type: auto
  autodeploy_allowed: true
  use_default_account: true

infura-mainnet:
  type: websocket
  url: wss://mainnet.infura.io/ws

geth:
  type: ipc
  file: ~/.ethereum/geth.ipc

test:
  type: eth_tester
  autodeploy_allowed: true
  use_default_account: true
class solidbyte.common.networks.NetworksYML(project_dir: Union[pathlib.Path, str, bytes] = None, no_load: bool = False)[source]

Object representation of the networks.yml file

__init__(project_dir: Union[pathlib.Path, str, bytes] = None, no_load: bool = False) → None[source]

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

autodeploy_allowed(name: str) → bool[source]

Check if autodeploy is allowed on this network. It must be explicitly allowed.

get_network_config(name: str) → Dict[str, Dict[str, Any]][source]

Return the config for a specific network

is_eth_tester(name: str) → bool[source]

Check if autodeploy is allowed on this network. It must be explicitly allowed.

load_configuration(config_file: Union[pathlib.Path, str, bytes] = None) → None[source]

Load the configuration from networks.yml

network_config_exists(name: str) → bool[source]

Check and see if we have configuration for name

use_default_account(name: str) → bool[source]

Check if this network is allowed to use the default account for most operations.

solidbyte.common.networks.config_exists(f: Callable) → Callable[source]

NetworksYML method decorator to check if a config exists

methods must have name as first argument after self.

@config_exists
def method(self, name):
    pass