Skip to content

Commit

Permalink
Make changes required after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
intricate committed Feb 26, 2020
1 parent 751296f commit 91cd6ac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
23 changes: 13 additions & 10 deletions cardano-node/src/Cardano/CLI/Ops.hs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import Ouroboros.Consensus.Mempool.API (ApplyTxErr)
import Ouroboros.Consensus.NodeNetwork (ProtocolCodecs(..), protocolCodecs)
import Ouroboros.Consensus.Node.NetworkProtocolVersion
(NodeToClientVersion, mostRecentNetworkProtocolVersion)
import Ouroboros.Consensus.Node.ProtocolInfo (ProtocolInfo(..), protocolInfo)
import Ouroboros.Consensus.Node.ProtocolInfo (ProtocolInfo(..))
import Ouroboros.Consensus.Node.Run
(RunNode(..))
import Ouroboros.Consensus.Util.Condense (Condense(..))
Expand All @@ -64,9 +64,9 @@ import Ouroboros.Network.Codec (Codec)
import Ouroboros.Network.Mux
(AppType(InitiatorApp), OuroborosApplication(..))
import Ouroboros.Network.NodeToClient
(NetworkConnectTracers(..), NodeToClientProtocols(..), NodeToClientVersionData(..)
, NodeToClientVersion(NodeToClientV_1), connectTo, localTxSubmissionClientNull
, nodeToClientCodecCBORTerm)
(AssociateWithIOCP, NetworkConnectTracers(..), NodeToClientProtocols(..)
, NodeToClientVersionData(..), NodeToClientVersion(NodeToClientV_1), connectTo
, localTxSubmissionClientNull, nodeToClientCodecCBORTerm)
import Ouroboros.Network.Protocol.ChainSync.Client
(ChainSyncClient(..), ClientStIdle(..), ClientStNext(..)
, chainSyncClientPeer, recvMsgRollForward)
Expand All @@ -77,6 +77,7 @@ import Ouroboros.Network.Protocol.LocalTxSubmission.Type
(LocalTxSubmission)
import Ouroboros.Network.Protocol.LocalTxSubmission.Client
(localTxSubmissionClientPeer)
import Ouroboros.Network.Snocket (socketSnocket)

import Cardano.Common.LocalSocket
import Cardano.Config.Protocol
Expand Down Expand Up @@ -274,9 +275,10 @@ withRealPBFT gHash genFile nMagic sigThresh delCertFp sKeyFp update ptcl action
getLocalTip
:: ConfigYamlFilePath
-> GenesisFile
-> AssociateWithIOCP
-> SocketPath
-> IO ()
getLocalTip configFp genFp sockPath = do
getLocalTip configFp genFp iocp sockPath = do
nc <- parseNodeConfigurationFP $ unConfigPath configFp

eGenHash <- runExceptT $ getGenesisHash genFp
Expand Down Expand Up @@ -304,22 +306,23 @@ getLocalTip configFp genFp sockPath = do
Left err -> do putTextLn . toS $ show err
exitFailure

createNodeConnection (Proxy) p sockPath
createNodeConnection (Proxy) p iocp sockPath


createNodeConnection
:: forall blk . (Condense (HeaderHash blk), RunNode blk)
=> Proxy blk
-> Consensus.Protocol blk
-> AssociateWithIOCP
-> SocketPath
-> IO ()
createNodeConnection proxy ptcl socketPath = do
addr <- localSocketAddrInfo socketPath
let ProtocolInfo{pInfoConfig} = protocolInfo ptcl
createNodeConnection proxy ptcl iocp socketPath = do
addr <- localSocketPath socketPath
let ProtocolInfo{pInfoConfig} = Consensus.protocolInfo ptcl
connectTo
(socketSnocket iocp)
(NetworkConnectTracers nullTracer nullTracer)
(localInitiatorNetworkApplication proxy pInfoConfig)
Nothing
addr
`catch` handleMuxError

Expand Down
5 changes: 2 additions & 3 deletions cardano-node/src/Cardano/CLI/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,13 @@ data ClientCommand
deriving Show



runCommand :: ClientCommand -> ExceptT CliError IO ()
runCommand (Genesis outDir params ptcl) = do
gen <- mkGenesis params
dumpGenesis ptcl outDir `uncurry` gen

runCommand (GetLocalNodeTip configFp gFile sockPath) = do
liftIO $ getLocalTip configFp gFile sockPath
runCommand (GetLocalNodeTip configFp gFile sockPath) = withIOManagerE $ \iocp ->
liftIO $ getLocalTip configFp gFile iocp sockPath

runCommand (PrettySigningKeyPublic ptcl skF) = do
sK <- readSigningKey ptcl skF
Expand Down

0 comments on commit 91cd6ac

Please sign in to comment.