@@ -155,6 +155,12 @@ defaultDirectBackend =
155
155
, nodeSocket = " node.socket"
156
156
}
157
157
158
+ defaultCardanoBackend :: ChainBackend
159
+ defaultCardanoBackend =
160
+ BlockfrostBackend
161
+ { projectPath = " /home/v0d1ch/code/hydra/blockfrost-project.txt"
162
+ }
163
+
158
164
data ChainBackend
159
165
= DirectBackend
160
166
{ networkId :: NetworkId
@@ -282,6 +288,7 @@ runOptionsParser =
282
288
chainConfigParser :: Parser ChainConfig
283
289
chainConfigParser =
284
290
Direct <$> directChainConfigParser
291
+ <|> Cardano <$> cardanoChainConfigParser
285
292
<|> Offline <$> offlineChainConfigParser
286
293
287
294
chainBackendParser :: Parser ChainBackend
@@ -393,6 +400,18 @@ data CardanoChainConfig = CardanoChainConfig
393
400
deriving stock (Eq , Show , Generic )
394
401
deriving anyclass (ToJSON , FromJSON )
395
402
403
+ defaultCardanoChainConfig :: CardanoChainConfig
404
+ defaultCardanoChainConfig =
405
+ CardanoChainConfig
406
+ { hydraScriptsTxId = []
407
+ , cardanoSigningKey = " cardano.sk"
408
+ , cardanoVerificationKeys = []
409
+ , startChainFrom = Nothing
410
+ , contestationPeriod = defaultContestationPeriod
411
+ , depositDeadline = defaultDepositDeadline
412
+ , chainBackend = defaultCardanoBackend
413
+ }
414
+
396
415
data DirectChainConfig = DirectChainConfig
397
416
{ networkId :: NetworkId
398
417
-- ^ Network identifer to which we expect to connect.
@@ -436,6 +455,14 @@ data BlockfrostChainConfig = BlockfrostChainConfig
436
455
}
437
456
deriving stock (Eq , Show , Generic )
438
457
458
+ defaultBlockfrostChainConfig :: BlockfrostChainConfig
459
+ defaultBlockfrostChainConfig =
460
+ BlockfrostChainConfig
461
+ { projectPath = " /home/v0d1ch/code/hydra/blockfrost-project.txt"
462
+ , hydraScriptsTxId = []
463
+ , cardanoSigningKey = " cardano.sk"
464
+ }
465
+
439
466
instance Arbitrary ChainConfig where
440
467
arbitrary =
441
468
oneof
@@ -525,6 +552,17 @@ directChainConfigParser =
525
552
<*> contestationPeriodParser
526
553
<*> depositDeadlineParser
527
554
555
+ cardanoChainConfigParser :: Parser CardanoChainConfig
556
+ cardanoChainConfigParser =
557
+ CardanoChainConfig
558
+ <$> (hydraScriptsTxIdsParser <|> many hydraScriptsTxIdParser)
559
+ <*> cardanoSigningKeyFileParser
560
+ <*> many cardanoVerificationKeyFileParser
561
+ <*> optional startChainFromParser
562
+ <*> contestationPeriodParser
563
+ <*> depositDeadlineParser
564
+ <*> chainBackendParser
565
+
528
566
blockfrostProjectPathParser :: Parser FilePath
529
567
blockfrostProjectPathParser =
530
568
strOption
0 commit comments