diff --git a/.gitignore b/.gitignore index ddfcba6..7605bb8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .stack-work/ *.dump-hi +dist-newstyle/* *~ diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ccc437..a992460 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # `chainweb-miner` Changelog -## 1.0.2 (2019-11-??) +## 1.0.2 (2019-11-21) #### New Features diff --git a/chainweb-miner.cabal b/chainweb-miner.cabal index 8a2d680..95c5c8b 100644 --- a/chainweb-miner.cabal +++ b/chainweb-miner.cabal @@ -1,7 +1,7 @@ cabal-version: 2.2 name: chainweb-miner -version: 1.0.1 +version: 1.0.2 description: Official mining software for the Kadena Public Blockchain. homepage: https://github.com/kadena-io/chainweb-miner author: Kadena Developers diff --git a/exec/Miner.hs b/exec/Miner.hs index 250ad91..bb68c95 100644 --- a/exec/Miner.hs +++ b/exec/Miner.hs @@ -115,7 +115,7 @@ work cmd cargs = do lopts <- setLogMinLevel (ll cargs) . setLogUseLoc False <$> logOptionsHandle stderr True withLogFunc lopts $ \logFunc -> do g <- MWC.createSystemRandom - m <- newManager (mkManagerSettings ss Nothing) + m <- newManager (mkManagerSettings tlsSettings Nothing) euvs <- sequence <$> traverse (nodeVer m) (coordinators cargs) case euvs of Left e -> throwString $ show e diff --git a/exec/Miner/Balance.hs b/exec/Miner/Balance.hs index 6417434..5a80efd 100644 --- a/exec/Miner/Balance.hs +++ b/exec/Miner/Balance.hs @@ -24,7 +24,7 @@ import Chainweb.ChainId (chainIdFromText) import Chainweb.Pact.RestAPI.Client (pactLocalApiClient) import Chainweb.RestAPI.NodeInfo (NodeInfo(..), NodeInfoApi) import Chainweb.Utils (sshow) -import Miner.Types (ss) +import Miner.Types (tlsSettings) import Pact.ApiReq import qualified Pact.Types.Command as P (CommandResult(..), PactResult(..)) import Pact.Types.Exp (Literal(..)) @@ -32,7 +32,7 @@ import Pact.Types.PactValue (PactValue(..)) getBalances :: BaseUrl -> Text -> IO () getBalances url mi = do - balanceStmts <- newManager (mkManagerSettings ss Nothing) >>= go . cenv + balanceStmts <- newManager (mkManagerSettings tlsSettings Nothing) >>= go . cenv case balanceStmts of These errors balances -> do printf "-- Retrieved Balances -- \n" diff --git a/exec/Miner/Types.hs b/exec/Miner/Types.hs index 2347469..0531f63 100644 --- a/exec/Miner/Types.hs +++ b/exec/Miner/Types.hs @@ -16,7 +16,7 @@ module Miner.Types , GPUEnv(..) , OtherCommand(..) -- * miscellaneous - , ss + , tlsSettings ) where import Chainweb.Utils (textOption) @@ -181,5 +181,5 @@ balancesOpts = Balance <$> pUrl <*> pMinerName -- | This allows this code to accept the self-signed certificates from -- `chainweb-node`. -- -ss :: TLSSettings -ss = TLSSettingsSimple True True True +tlsSettings :: TLSSettings +tlsSettings = TLSSettingsSimple True True True diff --git a/exec/Utils.hs b/exec/Utils.hs deleted file mode 100644 index b405abd..0000000 --- a/exec/Utils.hs +++ /dev/null @@ -1,45 +0,0 @@ -module Utils where - -import Options.Applicative - -import Network.Connection - -import RIO - -import Servant.Client - --- chainweb imports - -import Chainweb.HostAddress -import Chainweb.Utils - -data LocalCmdError - = Client ClientError - | LookupError Text - | PactResponseError Text - -data OtherCommand = - Keys | Balance BaseUrl Text - -keysOpts :: Parser OtherCommand -keysOpts = pure Keys - -balancesOpts :: Parser OtherCommand -balancesOpts = Balance <$> pUrl <*> pMinerName - where - pMinerName = - textOption (long "miner-account" <> help "Coin Contract account name of Miner") - -pUrl :: Parser BaseUrl -pUrl = hostAddressToBaseUrl Https <$> hadd - where - hadd :: Parser HostAddress - hadd = textOption - (long "node" <> metavar "" - <> help "Remote address of Chainweb Node to send mining results to") - --- | This allows this code to accept the self-signed certificates from --- `chainweb-node`. --- -ss :: TLSSettings -ss = TLSSettingsSimple True True True