Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Hydra.Options
Synopsis
- data InvalidOptions
- data ChainConfig = DirectChainConfig {
- networkId :: NetworkId
- nodeSocket :: SocketPath
- cardanoSigningKey :: FilePath
- cardanoVerificationKeys :: [FilePath]
- startChainFrom :: Maybe ChainPoint
- contestationPeriod :: ContestationPeriod
- newtype LedgerConfig = CardanoLedgerConfig {}
- newtype GenerateKeyPair = GenerateKeyPair {}
- data RunOptions = RunOptions {
- verbosity :: Verbosity
- nodeId :: NodeId
- host :: IP
- port :: PortNumber
- peers :: [Host]
- apiHost :: IP
- apiPort :: PortNumber
- monitoringPort :: Maybe PortNumber
- hydraSigningKey :: FilePath
- hydraVerificationKeys :: [FilePath]
- hydraScriptsTxId :: TxId
- persistenceDir :: FilePath
- chainConfig :: ChainConfig
- ledgerConfig :: LedgerConfig
- data PublishOptions = PublishOptions {
- publishNetworkId :: NetworkId
- publishNodeSocket :: SocketPath
- publishSigningKey :: FilePath
- data Command
- data ParamMismatch
- commandParser :: Parser Command
- publishOptionsParser :: Parser PublishOptions
- runOptionsParser :: Parser RunOptions
- genHydraKeyParser :: Parser GenerateKeyPair
- outputFileParser :: Parser FilePath
- defaultLedgerConfig :: LedgerConfig
- ledgerConfigParser :: Parser LedgerConfig
- cardanoLedgerProtocolParametersParser :: Parser FilePath
- defaultChainConfig :: ChainConfig
- chainConfigParser :: Parser ChainConfig
- networkIdParser :: Parser NetworkId
- nodeSocketParser :: Parser SocketPath
- cardanoSigningKeyFileParser :: Parser FilePath
- cardanoVerificationKeyFileParser :: Parser FilePath
- hydraSigningKeyFileParser :: Parser FilePath
- hydraVerificationKeyFileParser :: Parser FilePath
- peerParser :: Parser Host
- nodeIdParser :: Parser NodeId
- verbosityParser :: Parser Verbosity
- hostParser :: Parser IP
- portParser :: Parser PortNumber
- apiHostParser :: Parser IP
- apiPortParser :: Parser PortNumber
- monitoringPortParser :: Parser PortNumber
- startChainFromParser :: Parser ChainPoint
- hydraScriptsTxIdParser :: Parser TxId
- persistenceDirParser :: Parser FilePath
- hydraNodeCommand :: ParserInfo Command
- hydraNodeVersion :: Version
- defaultContestationPeriod :: ContestationPeriod
- contestationPeriodParser :: Parser ContestationPeriod
- explain :: InvalidOptions -> String
- validateRunOptions :: RunOptions -> Either InvalidOptions ()
- parseHydraCommand :: IO Command
- parseHydraCommandFromArgs :: [String] -> ParserResult Command
- toArgs :: RunOptions -> [String]
- defaultRunOptions :: RunOptions
- toArgNetworkId :: NetworkId -> [String]
- genFilePath :: String -> Gen FilePath
- genDirPath :: Gen FilePath
- genChainPoint :: Gen ChainPoint
- data ParserResult a
- = Success a
- | Failure (ParserFailure ParserHelp)
- | CompletionInvoked CompletionResult
- renderFailure :: ParserFailure ParserHelp -> String -> (String, ExitCode)
Documentation
data InvalidOptions Source #
Instances
Show InvalidOptions Source # | |
Defined in Hydra.Options | |
Eq InvalidOptions Source # | |
Defined in Hydra.Options Methods (==) :: InvalidOptions -> InvalidOptions -> Bool Source # (/=) :: InvalidOptions -> InvalidOptions -> Bool Source # |
data ChainConfig Source #
Constructors
DirectChainConfig | |
Fields
|
Instances
newtype LedgerConfig Source #
Constructors
CardanoLedgerConfig | |
Instances
newtype GenerateKeyPair Source #
Constructors
GenerateKeyPair | |
Fields |
Instances
Show GenerateKeyPair Source # | |
Defined in Hydra.Options | |
Eq GenerateKeyPair Source # | |
Defined in Hydra.Options Methods (==) :: GenerateKeyPair -> GenerateKeyPair -> Bool Source # (/=) :: GenerateKeyPair -> GenerateKeyPair -> Bool Source # |
data RunOptions Source #
Constructors
RunOptions | |
Fields
|
Instances
data PublishOptions Source #
Constructors
PublishOptions | |
Fields
|
Instances
Show PublishOptions Source # | |
Defined in Hydra.Options | |
Eq PublishOptions Source # | |
Defined in Hydra.Options Methods (==) :: PublishOptions -> PublishOptions -> Bool Source # (/=) :: PublishOptions -> PublishOptions -> Bool Source # |
Constructors
Run RunOptions | |
Publish PublishOptions | |
GenHydraKey GenerateKeyPair |
data ParamMismatch Source #
Constructors
ContestationPeriodMismatch | |
Fields | |
PartiesMismatch | |
Fields
|
Instances
commandParser :: Parser Command Source #
publishOptionsParser :: Parser PublishOptions Source #
runOptionsParser :: Parser RunOptions Source #
genHydraKeyParser :: Parser GenerateKeyPair Source #
outputFileParser :: Parser FilePath Source #
ledgerConfigParser :: Parser LedgerConfig Source #
cardanoLedgerProtocolParametersParser :: Parser FilePath Source #
chainConfigParser :: Parser ChainConfig Source #
networkIdParser :: Parser NetworkId Source #
nodeSocketParser :: Parser SocketPath Source #
cardanoSigningKeyFileParser :: Parser FilePath Source #
cardanoVerificationKeyFileParser :: Parser FilePath Source #
hydraSigningKeyFileParser :: Parser FilePath Source #
hydraVerificationKeyFileParser :: Parser FilePath Source #
peerParser :: Parser Host Source #
nodeIdParser :: Parser NodeId Source #
verbosityParser :: Parser Verbosity Source #
hostParser :: Parser IP Source #
portParser :: Parser PortNumber Source #
apiHostParser :: Parser IP Source #
apiPortParser :: Parser PortNumber Source #
monitoringPortParser :: Parser PortNumber Source #
startChainFromParser :: Parser ChainPoint Source #
hydraScriptsTxIdParser :: Parser TxId Source #
persistenceDirParser :: Parser FilePath Source #
hydraNodeCommand :: ParserInfo Command Source #
contestationPeriodParser :: Parser ContestationPeriod Source #
explain :: InvalidOptions -> String Source #
validateRunOptions :: RunOptions -> Either InvalidOptions () Source #
Validate cmd line arguments for hydra-node and check if they make sense before actually running the node.
Rules we apply:
- Check if number of parties is bigger than our hardcoded limit
(by looking at loaded hydra or cardano keys and comparing it to the maximumNumberOfParties
)
- Check that number of loaded hydra keys match with the number of loaded cardano keys
(by comparing lengths of the two lists)
parseHydraCommand :: IO Command Source #
Parse command-line arguments into a Option
or exit with failure and error message.
parseHydraCommandFromArgs :: [String] -> ParserResult Command Source #
Pure parsing of Option
from a list of arguments.
toArgs :: RunOptions -> [String] Source #
Convert an Options
instance into the corresponding list of command-line arguments.
This is useful in situations where one wants to programatically define Options
, providing
some measure of type safety, without having to juggle with strings.
toArgNetworkId :: NetworkId -> [String] Source #
genFilePath :: String -> Gen FilePath Source #
genDirPath :: Gen FilePath Source #
genChainPoint :: Gen ChainPoint Source #
data ParserResult a #
Constructors
Success a | |
Failure (ParserFailure ParserHelp) | |
CompletionInvoked CompletionResult |
Instances
Applicative ParserResult | |
Defined in Options.Applicative.Types Methods pure :: a -> ParserResult a Source # (<*>) :: ParserResult (a -> b) -> ParserResult a -> ParserResult b Source # liftA2 :: (a -> b -> c) -> ParserResult a -> ParserResult b -> ParserResult c Source # (*>) :: ParserResult a -> ParserResult b -> ParserResult b Source # (<*) :: ParserResult a -> ParserResult b -> ParserResult a Source # | |
Functor ParserResult | |
Defined in Options.Applicative.Types Methods fmap :: (a -> b) -> ParserResult a -> ParserResult b Source # (<$) :: a -> ParserResult b -> ParserResult a Source # | |
Monad ParserResult | |
Defined in Options.Applicative.Types Methods (>>=) :: ParserResult a -> (a -> ParserResult b) -> ParserResult b Source # (>>) :: ParserResult a -> ParserResult b -> ParserResult b Source # return :: a -> ParserResult a Source # | |
Show a => Show (ParserResult a) | |
Defined in Options.Applicative.Types |
renderFailure :: ParserFailure ParserHelp -> String -> (String, ExitCode) #