mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2026-08-24 10:05:29 -05:00
Add testnet11 constants to config if missing when configuring to run 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
This commit is contained in:
@@ -4,9 +4,11 @@ from pathlib import Path
|
||||
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,
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user