Skip to content

Commit

Permalink
feat: log address instead of using putStrLn
Browse files Browse the repository at this point in the history
  • Loading branch information
sourabhxyz committed May 2, 2024
1 parent 6595ab8 commit 3c14bc5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ The configuration values used for these environment variables in the example abo
configuration values. A MAINNET Maestro API key is needed, a payment signing key must be generated and a collateral UTxO must be provided after
sending funds to the address given by the payment signing key and the (optional) stake address.

In order to determine this address, you could use `cardano-cli address build`, but you can also just run the market maker - the address will be printed to the console in the first line of output:
In order to determine this address, you could use `cardano-cli address build`, but you can also just run the market maker - the address will be printed as the first log of "Info" severity:

```
Genius Yield Market Maker: <MARKET MAKER ADDRESS>
Expand Down
10 changes: 6 additions & 4 deletions geniusyield-market-maker/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Control.Exception (throwIO)
import GeniusYield.Api.Dex.Constants (dexInfoDefaultMainnet,
dexInfoDefaultPreprod)
import GeniusYield.GYConfig
import GeniusYield.MarketMaker.Constants (logNS)
import GeniusYield.MarketMaker.MakerBot
import GeniusYield.MarketMaker.MakerBotConfig
import GeniusYield.MarketMaker.Prices
Expand All @@ -12,6 +13,7 @@ import GeniusYield.MarketMaker.Utils (addrUser)
import GeniusYield.OrderBot.DataSource.Providers (connectDB)
import GeniusYield.Types (GYNetworkId (..),
addressToText)
import GeniusYield.Types.Providers (gyLogInfo)
import System.Environment

-----------------------------------------------------------------------
Expand Down Expand Up @@ -46,11 +48,11 @@ main = do
GYMainnet -> pure dexInfoDefaultMainnet
_ -> throwIO $ userError "Only Preprod and Mainnet are supported."

putStrLn $ "Genius Yield Market Maker: "
++ show (addressToText $ addrUser (cfgNetworkId coreCfg) $ mbUser mb)

let netId = cfgNetworkId coreCfg
withCfgProviders coreCfg "" $ \providers ->
withCfgProviders coreCfg "" $ \providers -> do
gyLogInfo providers logNS $
"Genius Yield Market Maker: "
++ show (addressToText $ addrUser (cfgNetworkId coreCfg) $ mbUser mb)
case action of
"Run" -> do
c <- connectDB netId providers
Expand Down

0 comments on commit 3c14bc5

Please sign in to comment.