Skip to content

Commit

Permalink
Fix production kupo conf (#57)
Browse files Browse the repository at this point in the history
* use local config for prod

* rebuild dists

* use public url for kupo
  • Loading branch information
olgaklimenko authored Aug 10, 2023
1 parent 51077fa commit f053221
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion dist/535.index.js

Large diffs are not rendered by default.

25 changes: 11 additions & 14 deletions src/Shared/TestnetConfig.purs
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,6 @@ mkNetworkWalletConfig (NetworkWallet { networkId, walletType }) = do
(Eternl /\ TestnetId) -> pure $ testnetEternlConfig host secure
_ -> throw "Wallet/network configuration not implemented"

kupoProdConfig :: String -> Boolean -> ServerConfig
kupoProdConfig host secure =
let
port = if secure then 443 else 80
in
{ port: UInt.fromInt port
, host: host
, secure: secure
, path: Just "kupo"
}

ogmiosProdWsConfig :: ServerConfig
ogmiosProdWsConfig =
{ port: UInt.fromInt 443
Expand All @@ -53,10 +42,18 @@ ogmiosProdWsConfig =
, path: Nothing
}

kupoProdConfig :: ServerConfig
kupoProdConfig =
{ port: UInt.fromInt 443
, host: "kupo.donat-pool.io"
, secure: true
, path: Nothing
}

kupoConfig :: ServerConfig
kupoConfig =
{ port: UInt.fromInt 1442
, host: "localhost"
, host: "0.0.0.0"
, secure: false
, path: Nothing
}
Expand All @@ -68,9 +65,9 @@ testnetWalletConfig host secure = testnetConfig
}

backParams :: String -> Boolean -> QueryBackendParams
backParams host secure = mkCtlBackendParams
backParams host _ = mkCtlBackendParams
{ ogmiosConfig: if isProduction then ogmiosProdWsConfig else defaultOgmiosWsConfig
, kupoConfig: if isProduction then kupoProdConfig host secure else kupoConfig
, kupoConfig: if isProduction then kupoProdConfig else kupoConfig
}
where
isProduction = not $ host == "localhost"
Expand Down

0 comments on commit f053221

Please sign in to comment.