Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run Nockma in an Anoma node #3128

Merged
merged 16 commits into from
Oct 29, 2024
Prev Previous commit
fix typo
janmasrovira committed Oct 29, 2024
commit bd74621d7610ae1ef2a969cefbcbd6635d47cb88
6 changes: 3 additions & 3 deletions src/Anoma/Effect/Base.hs
Original file line number Diff line number Diff line change
@@ -80,12 +80,12 @@ withSpawnAnomaClient body = do
{ std_out = CreatePipe
}

withSapwnAnomaNode ::
withSpawnAnomaNode ::
forall r a.
(Members '[EmbedIO, Logger, Error SimpleError, Process, Reader AnomaPath] r) =>
(Int -> Handle -> ProcessHandle -> Sem r a) ->
Sem r a
withSapwnAnomaNode body = withSystemTempFile "start.exs" $ \fp tmpHandle -> do
withSpawnAnomaNode body = withSystemTempFile "start.exs" $ \fp tmpHandle -> do
liftIO (B.hPutStr tmpHandle anomaStartExs)
hClose tmpHandle
cproc <- cprocess (toFilePath fp)
@@ -143,7 +143,7 @@ grpcCliProcess method = do

runAnoma :: forall r a. (Members '[Logger, EmbedIO, Error SimpleError] r) => AnomaPath -> Sem (Anoma ': r) a -> Sem r a
runAnoma anomapath body = runReader anomapath . runConcurrent . runProcess $
withSapwnAnomaNode $ \grpcport _nodeOut nodeH ->
withSpawnAnomaNode $ \grpcport _nodeOut nodeH ->
runReader (GrpcPort grpcport) $
withSpawnAnomaClient $ \_clientH -> do
(`interpret` inject body) $ \case