Skip to content

Commit a0b681d

Browse files
committed
fix: setting socket path env
- setting CARDANO_NODE_SOCKET_PATH env during bot interface setup - fix debug waiting
1 parent 457490d commit a0b681d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

example/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ main = do
3939
runContract testWallet DebugContract.getUtxosThrowsEx
4040
>>= report
4141

42-
putStrLn "Done. Debug awaiting - interrupt to exit" >> forever (waitSeconds 60)
42+
liftIO $ putStrLn "Done. Debug awaiting - interrupt to exit" >> forever (waitSeconds 60)
4343
where
4444
debugWallets ws = do
4545
cEnv <- ask

src/BotInterface/Setup.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ module BotInterface.Setup (
88
) where
99

1010
import Data.Aeson (encodeFile)
11-
import LocalCluster.Types (ClusterEnv (supportDir))
11+
import LocalCluster.Types (ClusterEnv (supportDir), nodeSocket)
1212
import System.Directory (createDirectoryIfMissing, doesDirectoryExist)
13+
import System.Environment (setEnv)
1314
import System.FilePath ((</>))
1415
import Tools.CardanoApi (queryProtocolParams)
1516

@@ -30,7 +31,10 @@ runSetup :: ClusterEnv -> IO ()
3031
runSetup cEnv = do
3132
createRequiredDirs
3233
saveProtocolParams
34+
setSocketPathEnv
3335
where
36+
setSocketPathEnv =
37+
setEnv "CARDANO_NODE_SOCKET_PATH" (nodeSocketFile $ nodeSocket cEnv)
3438
createRequiredDirs =
3539
mapM_
3640
(createDirectoryIfMissing True . ($ cEnv))

0 commit comments

Comments
 (0)