| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Hydra.Options
Contents
Synopsis
- data Command
- data RunOptions = RunOptions {
- verbosity :: Verbosity
- nodeId :: NodeId
- listen :: Host
- advertise :: Maybe Host
- peers :: [Host]
- apiHost :: IP
- apiPort :: PortNumber
- tlsCertPath :: Maybe FilePath
- tlsKeyPath :: Maybe FilePath
- monitoringPort :: Maybe PortNumber
- hydraSigningKey :: FilePath
- hydraVerificationKeys :: [FilePath]
- persistenceDir :: FilePath
- persistenceRotateAfter :: Maybe (Positive Natural)
- chainConfig :: ChainConfig
- ledgerConfig :: LedgerConfig
- whichEtcd :: WhichEtcd
- apiTransactionTimeout :: ApiTransactionTimeout
- newtype BlockfrostOptions = BlockfrostOptions {}
- data CardanoChainConfig = CardanoChainConfig {
- hydraScriptsTxId :: [TxId]
- cardanoSigningKey :: FilePath
- cardanoVerificationKeys :: [FilePath]
- startChainFrom :: Maybe ChainPoint
- contestationPeriod :: ContestationPeriod
- depositPeriod :: DepositPeriod
- depositActivation :: DepositPeriod
- unsyncedPeriod :: UnsyncedPeriod
- chainBackendOptions :: ChainBackendOptions
- data ChainBackendOptions
- data DirectOptions = DirectOptions {
- networkId :: NetworkId
- nodeSocket :: SocketPath
- data OfflineChainConfig = OfflineChainConfig {
- offlineHeadSeed :: HeadSeed
- initialUTxOFile :: FilePath
- ledgerGenesisFile :: Maybe FilePath
- data ChainConfig
- newtype LedgerConfig = CardanoLedgerConfig {}
- data InvalidOptions
- newtype GenerateKeyPair = GenerateKeyPair {}
- data PublishOptions = PublishOptions {}
- toArgs :: RunOptions -> [String]
- defaultContestationPeriod :: ContestationPeriod
- defaultDepositPeriod :: DepositPeriod
- defaultBlockfrostOptions :: BlockfrostOptions
- defaultCardanoChainConfig :: CardanoChainConfig
- defaultDepositActivation :: DepositPeriod
- defaultRunOptions :: RunOptions
- validateRunOptions :: RunOptions -> Either InvalidOptions ()
- subcommandNames :: [String]
- publishScriptsName :: String
- genHydraKeyName :: String
- commandParser :: Parser Command
- runOptionsParser :: Parser RunOptions
- publishOptionsParser :: Parser PublishOptions
- outputFileParser :: Parser FilePath
- defaultDirectOptions :: DirectOptions
- chainBackendOptionsParser :: Parser ChainBackendOptions
- cardanoSigningKeyFileParser :: Parser FilePath
- defaultLedgerConfig :: LedgerConfig
- overrideField :: Eq a => a -> a -> a -> a
- verbosityParser :: Parser Verbosity
- nodeIdParser :: Parser NodeId
- listenParser :: Parser Host
- advertiseParser :: Parser Host
- peerParser :: Parser Host
- apiHostParser :: Parser IP
- apiPortParser :: Parser PortNumber
- tlsCertPathParser :: Parser FilePath
- tlsKeyPathParser :: Parser FilePath
- monitoringPortParser :: Parser PortNumber
- hydraSigningKeyFileParser :: Parser FilePath
- hydraVerificationKeyFileParser :: Parser FilePath
- persistenceDirParser :: Parser FilePath
- persistenceRotateAfterParser :: Parser (Positive Natural)
- chainConfigParser :: Parser ChainConfig
- ledgerConfigParser :: Parser LedgerConfig
- whichEtcdParser :: Parser WhichEtcd
- apiTransactionTimeoutParser :: Parser ApiTransactionTimeout
- configFileParser :: Parser FilePath
- cardanoChainConfigParser :: Parser CardanoChainConfig
- offlineChainConfigParser :: Parser OfflineChainConfig
- networkIdParser :: Parser NetworkId
- nodeSocketParser :: Parser SocketPath
- blockfrostProjectPathParser :: Parser FilePath
- cardanoLedgerProtocolParametersParser :: Parser FilePath
- defaultUnsyncedPeriod :: UnsyncedPeriod
- offlineHeadSeedParser :: Parser HeadSeed
- initialUTxOFileParser :: Parser FilePath
- ledgerGenesisFileParser :: Parser (Maybe FilePath)
- hydraScriptsTxIdsParser :: Parser [TxId]
- hydraScriptsTxIdParser :: Parser TxId
- hydraScriptsDefaultParser :: Parser [TxId]
- cardanoVerificationKeyFileParser :: Parser FilePath
- startChainFromParser :: Parser ChainPoint
- contestationPeriodParser :: Parser ContestationPeriod
- depositPeriodParser :: Parser DepositPeriod
- depositActivationParser :: Parser DepositPeriod
- unsyncedPeriodParser :: Parser UnsyncedPeriod
- defaultApiTransactionTimeout :: ApiTransactionTimeout
- hydraNodeCommand :: ParserInfo Command
- parseHydraCommandFromArgs :: [String] -> ParserResult Command
- parseHydraCommandFromArgsWith :: [String] -> IO Command
- toArgApiPort :: PortNumber -> [String]
- toArgNetworkId :: NetworkId -> [String]
- toArgNodeSocket :: SocketPath -> [String]
- data ParserResult a
- = Success a
- | Failure (ParserFailure ParserHelp)
- | CompletionInvoked CompletionResult
- renderFailure :: ParserFailure ParserHelp -> String -> (String, ExitCode)
Documentation
Constructors
| Run RunOptions | |
| Publish PublishOptions | |
| GenHydraKey GenerateKeyPair |
data RunOptions Source #
Constructors
| RunOptions | |
Fields
| |
Instances
newtype BlockfrostOptions Source #
Constructors
| BlockfrostOptions | |
Fields | |
Instances
data CardanoChainConfig Source #
Constructors
| CardanoChainConfig | |
Fields
| |
Instances
data ChainBackendOptions Source #
Constructors
| Direct DirectOptions | |
| Blockfrost BlockfrostOptions |
Instances
data DirectOptions Source #
Constructors
| DirectOptions | |
Fields
| |
Instances
data OfflineChainConfig Source #
Constructors
| OfflineChainConfig | |
Fields
| |
Instances
data ChainConfig Source #
Constructors
| Offline OfflineChainConfig | |
| Cardano CardanoChainConfig |
Instances
newtype LedgerConfig Source #
Constructors
| CardanoLedgerConfig | |
Instances
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 # | |
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 PublishOptions Source #
Constructors
| PublishOptions | |
Instances
| Generic PublishOptions Source # | |
Defined in Hydra.Options Methods from :: PublishOptions -> Rep PublishOptions x Source # to :: Rep PublishOptions x -> PublishOptions Source # | |
| Show PublishOptions Source # | |
Defined in Hydra.Options | |
| Eq PublishOptions Source # | |
Defined in Hydra.Options Methods (==) :: PublishOptions -> PublishOptions -> Bool Source # (/=) :: PublishOptions -> PublishOptions -> Bool Source # | |
| type Rep PublishOptions Source # | |
Defined in Hydra.Options type Rep PublishOptions = D1 ('MetaData "PublishOptions" "Hydra.Options" "hydra-node-2.3.0-1cgalYNmLJQC1YXlYVq7mp" 'False) (C1 ('MetaCons "PublishOptions" 'PrefixI 'True) (S1 ('MetaSel ('Just "chainBackendOptions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ChainBackendOptions) :*: S1 ('MetaSel ('Just "publishSigningKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 FilePath))) | |
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 programmatically define Options, providing
some measure of type safety, without having to juggle with strings.
defaultContestationPeriod :: ContestationPeriod Source #
Default contestation period of 12 hours, aligned with Cardano's safe zone on mainnet. The safe zone is approximately 3 * k / f where k = 2160 (security parameter) and f = 0.05 (active slot coefficient), ensuring finality guarantees. See: https://github.com/cardano-scaling/hydra/issues/2389
defaultDepositPeriod :: DepositPeriod Source #
defaultDepositActivation :: DepositPeriod Source #
defaultRunOptions :: RunOptions Source #
Default options as they should also be provided by runOptionsParser.
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)
subcommandNames :: [String] Source #
Subcommand names recognized by commandParser.
Derived from the same string literals used to register the subcommands
below, so that hs can't drift out of sync with the parser when a
new subcommand is added.
commandParser :: Parser Command Source #
runOptionsParser :: Parser RunOptions Source #
Parser for running the cardano-node with all its RunOptions.
publishOptionsParser :: Parser PublishOptions Source #
outputFileParser :: Parser FilePath Source #
chainBackendOptionsParser :: Parser ChainBackendOptions Source #
cardanoSigningKeyFileParser :: Parser FilePath Source #
overrideField :: Eq a => a -> a -> a -> a Source #
Use cli if it differs from def, otherwise keep base.
Note: if the user explicitly passes a CLI flag whose value happens to equal
the default (e.g. --api-port 4001 when 4001 is the default), the config
file value wins. This is a known limitation of inferring intent from equality
with the default; a proper fix would require tracking which flags were
explicitly set (e.g. via Maybe-wrapped parser results).
verbosityParser :: Parser Verbosity Source #
nodeIdParser :: Parser NodeId Source #
listenParser :: Parser Host Source #
advertiseParser :: Parser Host Source #
peerParser :: Parser Host Source #
apiHostParser :: Parser IP Source #
apiPortParser :: Parser PortNumber Source #
tlsCertPathParser :: Parser FilePath Source #
tlsKeyPathParser :: Parser FilePath Source #
monitoringPortParser :: Parser PortNumber Source #
hydraSigningKeyFileParser :: Parser FilePath Source #
hydraVerificationKeyFileParser :: Parser FilePath Source #
persistenceDirParser :: Parser FilePath Source #
persistenceRotateAfterParser :: Parser (Positive Natural) Source #
chainConfigParser :: Parser ChainConfig Source #
ledgerConfigParser :: Parser LedgerConfig Source #
whichEtcdParser :: Parser WhichEtcd Source #
configFileParser :: Parser FilePath Source #
cardanoChainConfigParser :: Parser CardanoChainConfig Source #
offlineChainConfigParser :: Parser OfflineChainConfig Source #
networkIdParser :: Parser NetworkId Source #
nodeSocketParser :: Parser SocketPath Source #
blockfrostProjectPathParser :: Parser FilePath Source #
cardanoLedgerProtocolParametersParser :: Parser FilePath Source #
defaultUnsyncedPeriod :: UnsyncedPeriod Source #
Default unsynced period, computed as half of the default contestation period.
offlineHeadSeedParser :: Parser HeadSeed Source #
initialUTxOFileParser :: Parser FilePath Source #
ledgerGenesisFileParser :: Parser (Maybe FilePath) Source #
hydraScriptsTxIdsParser :: Parser [TxId] Source #
hydraScriptsTxIdParser :: Parser TxId Source #
hydraScriptsDefaultParser :: Parser [TxId] Source #
cardanoVerificationKeyFileParser :: Parser FilePath Source #
startChainFromParser :: Parser ChainPoint Source #
contestationPeriodParser :: Parser ContestationPeriod Source #
depositPeriodParser :: Parser DepositPeriod Source #
depositActivationParser :: Parser DepositPeriod Source #
unsyncedPeriodParser :: Parser UnsyncedPeriod Source #
hydraNodeCommand :: ParserInfo Command Source #
parseHydraCommandFromArgs :: [String] -> ParserResult Command Source #
Pure parsing of Option from a list of arguments.
parseHydraCommandFromArgsWith :: [String] -> IO Command Source #
Parse the given list of arguments, exiting on failure.
toArgApiPort :: PortNumber -> [String] Source #
toArgNetworkId :: NetworkId -> [String] Source #
toArgNodeSocket :: SocketPath -> [String] 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) #
Orphan instances
| FromJSON a => FromJSON (Positive a) Source # | |
Methods parseJSON :: Value -> Parser (Positive a) parseJSONList :: Value -> Parser [Positive a] omittedField :: Maybe (Positive a) | |
| ToJSON a => ToJSON (Positive a) Source # | |
Methods toJSON :: Positive a -> Value toEncoding :: Positive a -> Encoding toJSONList :: [Positive a] -> Value toEncodingList :: [Positive a] -> Encoding | |