Skip to content

Commit 0ce347b

Browse files
committed
default solver peer
1 parent f308a2d commit 0ce347b

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

chia/server/resolve_peer_info.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
PEER_INFO_MAPPING: dict[NodeType, str] = {
1212
NodeType.FULL_NODE: "full_node_peer",
1313
NodeType.FARMER: "farmer_peer",
14+
NodeType.SOLVER: "solver_peer",
1415
}
1516

1617

@@ -21,6 +22,10 @@ def get_unresolved_peer_infos(service_config: dict[str, Any], peer_type: NodeTyp
2122
if peer_info is not None:
2223
peer_infos.append(peer_info)
2324

25+
# Default solver peer if none configured
26+
if peer_type == NodeType.SOLVER and not peer_infos:
27+
peer_infos = [{"host": "localhost", "port": 8666}]
28+
2429
return {UnresolvedPeerInfo(host=peer["host"], port=peer["port"]) for peer in peer_infos}
2530

2631

chia/util/initial-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,11 @@ farmer:
209209
- host: *self_hostname
210210
port: 8444
211211

212+
# The farmer will attempt to connect to these solvers for V2 plot solving
213+
solver_peers:
214+
- host: *self_hostname
215+
port: 8666
216+
212217
pool_public_keys: !!set {}
213218

214219
# Replace this with a real receive address
@@ -636,6 +641,10 @@ solver:
636641
# Enable or disable UPnP port forwarding
637642
enable_upnp: False
638643

644+
# Node IDs of trusted solver peers, only these can connect by default
645+
trusted_peers:
646+
0ThisisanexampleNodeID7ff9d60f1c3fa270c213c0ad0cb89c01274634a7c3cb7: Does_not_matter
647+
639648
# Logging configuration
640649
logging: *logging
641650

0 commit comments

Comments
 (0)