Skip to content

Commit

Permalink
Add testnet11 constants to config if missing when configuring to run …
Browse files Browse the repository at this point in the history
…on testnet (#17568)

* If missing, add testnet11 constants to config file

* Run isort

* Be specific about which parts are missing when updating config

* Run black
  • Loading branch information
cmmarslender authored Feb 15, 2024
1 parent 3742b22 commit f499f9d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions chia/cmds/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
from typing import Optional

import click
import yaml

from chia.server.outbound_message import NodeType
from chia.util.config import (
initial_config_file,
load_defaults_for_missing_services,
lock_and_load_config,
save_config,
Expand Down Expand Up @@ -103,6 +105,24 @@ def configure(
if testnet:
if testnet == "true" or testnet == "t":
print("Setting Testnet")
# check if network_overrides.constants.testnet11 exists
if (
"testnet11" not in config["network_overrides"]["constants"]
or "testnet11" not in config["network_overrides"]["config"]
):
print("Testnet11 constants missing. Adding to config...")
initial_config_str: str = initial_config_file("config.yaml")
initial_config = yaml.safe_load(initial_config_str)
if "testnet11" not in config["network_overrides"]["constants"]:
config["network_overrides"]["constants"]["testnet11"] = initial_config["network_overrides"][
"constants"
]["testnet11"]

if "testnet11" not in config["network_overrides"]["config"]:
config["network_overrides"]["config"]["testnet11"] = initial_config["network_overrides"][
"config"
]["testnet11"]

testnet_port = "58444"
testnet_introducer = "introducer-testnet11.chia.net"
testnet_dns_introducer = "dns-introducer-testnet11.chia.net"
Expand Down

0 comments on commit f499f9d

Please sign in to comment.