From 82f3b06051782e3a946e48d6d3823e47d048b0bb Mon Sep 17 00:00:00 2001 From: Felix Brucker Date: Wed, 24 Jan 2024 01:00:54 +0700 Subject: [PATCH] Add support for defining a list of full node peers to connect to (#17369) --- chia/server/start_full_node.py | 3 ++- chia/util/initial-config.yaml | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/chia/server/start_full_node.py b/chia/server/start_full_node.py index 2fd94ecb494f..63cfa95c2b73 100644 --- a/chia/server/start_full_node.py +++ b/chia/server/start_full_node.py @@ -16,7 +16,7 @@ from chia.server.outbound_message import NodeType from chia.server.start_service import RpcInfo, Service, async_run from chia.types.aliases import FullNodeService from chia.util.chia_logging import initialize_service_logging -from chia.util.config import load_config, load_config_cli +from chia.util.config import get_unresolved_peer_infos, load_config, load_config_cli from chia.util.default_root import DEFAULT_ROOT_PATH from chia.util.ints import uint16 from chia.util.misc import SignalHandlers @@ -61,6 +61,7 @@ async def create_full_node_service( advertised_port=service_config["port"], service_name=SERVICE_NAME, upnp_ports=upnp_list, + connect_peers=get_unresolved_peer_infos(service_config, NodeType.FULL_NODE), on_connect_callback=full_node.on_connect, network_id=network_id, rpc_info=rpc_info, diff --git a/chia/util/initial-config.yaml b/chia/util/initial-config.yaml index fa351891832e..02b8f05f6cd4 100644 --- a/chia/util/initial-config.yaml +++ b/chia/util/initial-config.yaml @@ -353,6 +353,8 @@ timelord: full_node: # The full node server (if run) will run on this port port: 8444 + # The full node will attempt to connect to these full nodes + full_node_peers: [] # controls the sync-to-disk behavior of the database connection. Can be one of: # "on" enables syncing to disk, minimizes risk of corrupting the DB in