Skip to content

Commit

Permalink
Clean up ChainwebConfiguration (#697)
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel Denloye-Ito authored and fosskers committed Nov 13, 2019
1 parent d7451df commit 4feba5c
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions tools/genconf/GenConf.hs
Expand Up @@ -20,10 +20,7 @@ import System.Process
-- chainweb imports
import Chainweb.Chainweb
import Chainweb.HostAddress
import Chainweb.Mempool.P2pConfig
import Chainweb.Miner.Config
import Chainweb.NodeId
import Chainweb.Utils
import Chainweb.Version

import P2P.Node.Configuration
Expand Down Expand Up @@ -73,21 +70,10 @@ getConf = do
host <- getUserInput (hostMsg ip) (Just hostname) (const $ return Nothing) Nothing
port <- getUserInput portMsg (Just 443) (return . portFromText) Nothing
coord <- getUserInput mineCoordMsg (Just True) (return . yesorno2Bool) Nothing
return ChainwebConfiguration
{ _configChainwebVersion = Mainnet01
, _configNodeId = NodeId 0 -- FIXME
, _configCuts = defaultCutConfig
, _configMining = defaultMining & miningCoordination . coordinationEnabled .~ coord
, _configHeaderStream = False
, _configReintroTxs = True
, _configP2p = defaultP2pConfiguration
& p2pConfigPeer . peerConfigAddr
.~ HostAddress host port
, _configTransactionIndex = defaultEnableConfig defaultTransactionIndexConfig
, _configThrottling = defaultThrottlingConfig
, _configMempoolP2p = defaultEnableConfig defaultMempoolP2pConfig
, _configBlockGasLimit = 100000
}
return $
defaultChainwebConfiguration Mainnet01
& configMining . miningCoordination . coordinationEnabled .~ coord
& configP2p . p2pConfigPeer . peerConfigAddr .~ HostAddress host port
where
hostMsg ip = "What is your publicly reachable domain name / IP address (default: " <> T.unpack ip <> ")?"
portMsg = "Which port would you like to use (default: 443)?"
Expand Down

0 comments on commit 4feba5c

Please sign in to comment.