Zeth - Zerocash on Ethereum  0.8
Reference implementation of the Zeth protocol by Clearmatics
Functions | Variables
zeth.helper.eth_gen_network_config Namespace Reference

Functions

None eth_gen_network_config (str eth_network, Optional[str] eth_rpc_endpoint, Optional[str] eth_rpc_certificate, bool eth_rpc_insecure, str output_file)
 

Variables

 default
 
 help
 
 is_flag
 

Function Documentation

◆ eth_gen_network_config()

None zeth.helper.eth_gen_network_config.eth_gen_network_config ( str  eth_network,
Optional[str]  eth_rpc_endpoint,
Optional[str]  eth_rpc_certificate,
bool  eth_rpc_insecure,
str  output_file 
)
Generate a network config file. ETH_NETWORK is a network name or
pre-existing network config file.

Examples:

\b
    # Write default config for "ganache" to the default file
    $ zeth-helper eth-gen-network-config ganache

\b
    # Write "geth" config with a custom endpoint to default file
    $ zeth-helper eth-gen-network-config geth \\
        --eth-rpc-endpoint http://localhost:8080

\b
    # Write a custom https endpoint to file, specifying the certificate
    $ zeth-helper eth-gen-network-config \\
        my-network \\
        --eth-rpc-endpoint https://rpc.my-network.io:8545 \\
        --eth-rpc-certificate rpc.my-network.io.crt

\b
    # Write default network and endpoint to file "default-network"
    $ zeth-helper eth-gen-network-config --output-file default-network

Definition at line 27 of file eth_gen_network_config.py.

28  eth_network: str,
29  eth_rpc_endpoint: Optional[str],
30  eth_rpc_certificate: Optional[str],
31  eth_rpc_insecure: bool,
32  output_file: str) -> None:
33  """
34  Generate a network config file. ETH_NETWORK is a network name or
35  pre-existing network config file.
36 
37  Examples:
38 
39  \b
40  # Write default config for "ganache" to the default file
41  $ zeth-helper eth-gen-network-config ganache
42 
43  \b
44  # Write "geth" config with a custom endpoint to default file
45  $ zeth-helper eth-gen-network-config geth \\
46  --eth-rpc-endpoint http://localhost:8080
47 
48  \b
49  # Write a custom https endpoint to file, specifying the certificate
50  $ zeth-helper eth-gen-network-config \\
51  my-network \\
52  --eth-rpc-endpoint https://rpc.my-network.io:8545 \\
53  --eth-rpc-certificate rpc.my-network.io.crt
54 
55  \b
56  # Write default network and endpoint to file "default-network"
57  $ zeth-helper eth-gen-network-config --output-file default-network
58  """
59 
60  if eth_rpc_endpoint is not None:
61  network = NetworkConfig(
62  name=eth_network,
63  endpoint=eth_rpc_endpoint,
64  certificate=eth_rpc_certificate,
65  insecure=eth_rpc_insecure)
66  else:
67  network = get_eth_network(eth_network)
68 
69  network_json = network.to_json()
70  print(f"network: {network_json}")
71 
72  with open(output_file, "w") as eth_network_f:
73  eth_network_f.write(network_json)
74  print(f"written to \"{output_file}\"")
Here is the call graph for this function:

Variable Documentation

◆ default

zeth.helper.eth_gen_network_config.default

Definition at line 14 of file eth_gen_network_config.py.

◆ help

zeth.helper.eth_gen_network_config.help

Definition at line 15 of file eth_gen_network_config.py.

◆ is_flag

zeth.helper.eth_gen_network_config.is_flag

Definition at line 21 of file eth_gen_network_config.py.

zeth.cli.utils.get_eth_network
NetworkConfig get_eth_network(Optional[str] eth_network)
Definition: utils.py:84
zeth.helper.eth_gen_network_config.eth_gen_network_config
None eth_gen_network_config(str eth_network, Optional[str] eth_rpc_endpoint, Optional[str] eth_rpc_certificate, bool eth_rpc_insecure, str output_file)
Definition: eth_gen_network_config.py:27