@@ -1096,6 +1096,48 @@ threeNodesNoErrorsOnOpen tracer tmpDir node@RunningNode{nodeSocket} hydraScripts
1096
1096
Right _headIsOpen ->
1097
1097
pure ()
1098
1098
1099
+ -- | Hydra nodes ABC run on ABC cluster and connect to each other.
1100
+ -- Hydra nodes BC shut down.
1101
+ -- Hydra nodes BC run on BC cluster and connect to each other.
1102
+ -- Hydra nodes BC shut down.
1103
+ -- Hydra nodes BC run and connect ABC cluster again.
1104
+ nodeCanSupportMultipleEtcdClusters :: Tracer IO EndToEndLog -> FilePath -> RunningNode -> [TxId ] -> IO ()
1105
+ nodeCanSupportMultipleEtcdClusters tracer workDir RunningNode {networkId, nodeSocket} hydraScriptsTxId = do
1106
+ let contestationPeriod = UnsafeContestationPeriod 2
1107
+ let depositDeadline = UnsafeDepositDeadline 50
1108
+
1109
+ aliceChainConfig <-
1110
+ chainConfigFor Alice workDir nodeSocket hydraScriptsTxId [Bob , Carol ] contestationPeriod depositDeadline
1111
+ <&> setNetworkId networkId
1112
+ bobChainConfig <-
1113
+ chainConfigFor Bob workDir nodeSocket hydraScriptsTxId [Alice , Carol ] contestationPeriod depositDeadline
1114
+ <&> setNetworkId networkId
1115
+ carolChainConfig <-
1116
+ chainConfigFor Carol workDir nodeSocket hydraScriptsTxId [Alice , Bob ] contestationPeriod depositDeadline
1117
+ <&> setNetworkId networkId
1118
+
1119
+ let hydraTracer = contramap FromHydraNode tracer
1120
+
1121
+ withHydraNode hydraTracer aliceChainConfig workDir 1 aliceSk [bobVk, carolVk] [1 , 2 , 3 ] $ \ n1 -> do
1122
+ withHydraNode hydraTracer bobChainConfig workDir 2 bobSk [aliceVk, carolVk] [1 , 2 , 3 ] $ \ n2 -> do
1123
+ withHydraNode hydraTracer carolChainConfig workDir 3 carolSk [aliceVk, bobVk] [1 , 2 , 3 ] $ \ n3 -> do
1124
+ waitForNodesConnected hydraTracer 30 $ n1 :| [n2, n3]
1125
+
1126
+ bobChainConfig' <-
1127
+ chainConfigFor Bob workDir nodeSocket hydraScriptsTxId [Carol ] contestationPeriod depositDeadline
1128
+ <&> setNetworkId networkId
1129
+ carolChainConfig' <-
1130
+ chainConfigFor Carol workDir nodeSocket hydraScriptsTxId [Bob ] contestationPeriod depositDeadline
1131
+ <&> setNetworkId networkId
1132
+
1133
+ withHydraNode hydraTracer bobChainConfig' workDir 2 bobSk [carolVk] [2 , 3 ] $ \ n2 -> do
1134
+ withHydraNode hydraTracer carolChainConfig' workDir 3 carolSk [bobVk] [2 , 3 ] $ \ n3 -> do
1135
+ waitForNodesConnected hydraTracer 30 $ n2 :| [n3]
1136
+
1137
+ withHydraNode hydraTracer bobChainConfig workDir 2 bobSk [aliceVk, carolVk] [1 , 2 , 3 ] $ \ n2 -> do
1138
+ withHydraNode hydraTracer carolChainConfig workDir 3 carolSk [aliceVk, bobVk] [1 , 2 , 3 ] $ \ n3 -> do
1139
+ waitForNodesConnected hydraTracer 30 $ n1 :| [n2, n3]
1140
+
1099
1141
-- | Two hydra node setup where Alice is wrongly configured to use Carol's
1100
1142
-- cardano keys instead of Bob's which will prevent him to be notified the
1101
1143
-- `HeadIsInitializing` but he should still receive some notification.
0 commit comments