@@ -127,6 +127,17 @@ pub struct BitcoindConfig {
127127 pub poll_interval_secs : Duration ,
128128}
129129
130+ /// Everything we need to know for talking to coordinator
131+ #[ derive( Debug , Clone , Deserialize ) ]
132+ pub struct CoordinatorConfig {
133+ /// The Noise static public key of the sync server
134+ #[ serde( deserialize_with = "deserialize_noisepubkey" ) ]
135+ pub noise_key : NoisePubkey ,
136+ /// The host of the sync server (may be an IP or a hidden service)
137+ /// TODO: change for enum handling multiple choice.
138+ pub host : SocketAddr ,
139+ }
140+
130141#[ derive( Debug , Clone , Deserialize ) ]
131142pub struct ScriptsConfig {
132143 #[ serde( deserialize_with = "deserialize_fromstr" ) ]
@@ -149,12 +160,8 @@ pub struct Config {
149160 /// The Noise static public keys of "our" stakeholder
150161 #[ serde( deserialize_with = "deserialize_noisepubkey" ) ]
151162 pub stakeholder_noise_key : NoisePubkey ,
152- /// The host of the sync server (may be an IP or a hidden service)
153- /// TODO: change for enum handling multiple choice.
154- pub coordinator_host : SocketAddr ,
155- /// The Noise static public key of the sync server
156- #[ serde( deserialize_with = "deserialize_noisepubkey" ) ]
157- pub coordinator_noise_key : NoisePubkey ,
163+ /// Everything we need to know to talk to coordinator
164+ pub coordinator_config : Option < CoordinatorConfig > ,
158165 /// An optional custom data directory
159166 // TODO: have a default implem as in cosignerd
160167 pub data_dir : Option < PathBuf > ,
@@ -353,8 +360,9 @@ mod tests {
353360
354361 stakeholder_noise_key = "3de4539519b6baca35ad14cd5bac9a4e0875a851632112405bb0547e6fcf16f6"
355362
356- coordinator_host = "127.0.0.1:1"
357- coordinator_noise_key = "d91563973102454a7830137e92d0548bc83b4ea2799f1df04622ca1307381402"
363+ [coordinator_config]
364+ host = "127.0.0.1:1"
365+ noise_key = "d91563973102454a7830137e92d0548bc83b4ea2799f1df04622ca1307381402"
358366
359367 [scripts_config]
360368 cpfp_descriptor = "wsh(thresh(1,pk(xpub6BaZSKgpaVvibu2k78QsqeDWXp92xLHZxiu1WoqLB9hKhsBf3miBUDX7PJLgSPvkj66ThVHTqdnbXpeu8crXFmDUd4HeM4s4miQS2xsv3Qb/*)))#cwycq5xu"
@@ -385,8 +393,9 @@ mod tests {
385393
386394 stakeholder_noise_key = "3de4539519b6baca35ad14cd5bac9a4e0875a851632112405bb0547e6fcf16f6"
387395
388- coordinator_host = "127.0.0.1:1"
389- coordinator_noise_key = "d91563973102454a7830137e92d0548bc83b4ea2799f1df04622ca1307381402"
396+ [coordinator_config]
397+ host = "127.0.0.1:1"
398+ noise_key = "d91563973102454a7830137e92d0548bc83b4ea2799f1df04622ca1307381402"
390399
391400 [[plugins]]
392401 path = "src/config.rs"
@@ -417,8 +426,9 @@ mod tests {
417426
418427 stakeholder_noise_key = "3de4539519b6baca35ad14cd5bac9a4e0875a851632112405bb0547e6fcf16f6"
419428
420- coordinator_host = "127.0.0.1:1"
421- coordinator_noise_key = "d91563973102454a7830137e92d0548bc83b4ea2799f1df04622ca1307381402"
429+ [coordinator_config]
430+ host = "127.0.0.1:1"
431+ noise_key = "d91563973102454a7830137e92d0548bc83b4ea2799f1df04622ca1307381402"
422432
423433 [scripts_config]
424434 cpfp_descriptor = "wsh(thresh(1,pk(xpub6BaZSKgpaVvibu2k78QsqeDWXp92xLHZxiu1WoqLB9hKhsBf3miBUDX7PJLgSPvkj66ThVHTqdnbXpeu8crXFmDUd4HeM4s4miQS2xsv3Qb/*)))#cwycq5xu"
0 commit comments