Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- data NodeLog
- = MsgNodeCmdSpec { }
- | MsgCLI [Text]
- | MsgCLIStatus Text Text
- | MsgCLIRetry Text
- | MsgCLIRetryResult Text Int
- | MsgNodeStarting { }
- | MsgSocketIsReady SocketPath
- | MsgSynchronizing {
- percentDone :: Centi
- | MsgQueryGenesisParametersFailed { }
- type Port = Int
- newtype NodeId = NodeId Int
- data DevnetConfig = DevnetConfig {}
- data CardanoNodeArgs = CardanoNodeArgs {
- nodeSocket :: FilePath
- nodeConfigFile :: FilePath
- nodeByronGenesisFile :: FilePath
- nodeShelleyGenesisFile :: FilePath
- nodeAlonzoGenesisFile :: FilePath
- nodeConwayGenesisFile :: FilePath
- nodeTopologyFile :: FilePath
- nodeDatabaseDir :: FilePath
- nodeDlgCertFile :: Maybe FilePath
- nodeSignKeyFile :: Maybe FilePath
- nodeOpCertFile :: Maybe FilePath
- nodeKesKeyFile :: Maybe FilePath
- nodeVrfKeyFile :: Maybe FilePath
- nodePort :: Maybe Port
- defaultCardanoNodeArgs :: CardanoNodeArgs
- data PortsConfig = PortsConfig {}
- getCardanoNodeVersion :: IO String
- findRunningCardanoNode :: Tracer IO NodeLog -> FilePath -> KnownNetwork -> IO (Maybe RunningNode)
- findRunningCardanoNode' :: Tracer IO NodeLog -> NetworkId -> SocketPath -> IO (Maybe RunningNode)
- withCardanoNodeDevnet :: Tracer IO NodeLog -> FilePath -> (RunningNode -> IO a) -> IO a
- withCardanoNodeOnKnownNetwork :: Tracer IO NodeLog -> FilePath -> KnownNetwork -> (RunningNode -> IO a) -> IO a
- setupCardanoDevnet :: FilePath -> IO CardanoNodeArgs
- withCardanoNode :: Tracer IO NodeLog -> FilePath -> CardanoNodeArgs -> (RunningNode -> IO a) -> IO a
- computeBlockTime :: NominalDiffTime -> Rational -> NominalDiffTime
- waitForFullySynchronized :: Tracer IO NodeLog -> RunningNode -> IO ()
- waitForSocket :: SocketPath -> IO ()
- cardanoNodeProcess :: Maybe FilePath -> CardanoNodeArgs -> CreateProcess
- initSystemStart :: IO UTCTime
- refreshSystemStart :: FilePath -> CardanoNodeArgs -> IO ()
- mkTopology :: [Port] -> Value
- generateCardanoKey :: IO (VerificationKey PaymentKey, SigningKey PaymentKey)
- data ProcessHasExited = ProcessHasExited Text ExitCode
- cliQueryProtocolParameters :: SocketPath -> NetworkId -> IO Value
- withObject :: (Object -> Object) -> Value -> Value
- unsafeDecodeJson :: FromJSON a => ByteString -> IO a
- unsafeDecodeJsonFile :: FromJSON a => FilePath -> IO a
Documentation
Instances
Instances
FromJSON NodeId Source # | |
Defined in CardanoNode parseJSON :: Value -> Parser NodeId parseJSONList :: Value -> Parser [NodeId] | |
ToJSON NodeId Source # | |
Defined in CardanoNode toEncoding :: NodeId -> Encoding toJSONList :: [NodeId] -> Value toEncodingList :: [NodeId] -> Encoding | |
Num NodeId Source # | |
Show NodeId Source # | |
Eq NodeId Source # | |
data DevnetConfig Source #
Configuration parameters for a single node devnet
DevnetConfig | |
|
Instances
data CardanoNodeArgs Source #
Arguments given to the 'cardano-node' command-line to run a node.
data PortsConfig Source #
Configuration of ports from the perspective of a peer in the context of a fully sockected topology.
Instances
findRunningCardanoNode :: Tracer IO NodeLog -> FilePath -> KnownNetwork -> IO (Maybe RunningNode) Source #
Tries to find an communicate with an existing cardano-node running in given
work directory. NOTE: This is using the default node socket name as defined
by defaultCardanoNodeArgs
.
findRunningCardanoNode' :: Tracer IO NodeLog -> NetworkId -> SocketPath -> IO (Maybe RunningNode) Source #
Tries to find an communicate with an existing cardano-node running in given network id and socket path.
withCardanoNodeDevnet Source #
:: Tracer IO NodeLog | |
-> FilePath | State directory in which credentials, db & logs are persisted. |
-> (RunningNode -> IO a) | |
-> IO a |
Start a single cardano-node devnet using the config from config/ and
credentials from configcredentials. Only the Faucet
actor will receive
"initialFunds". Use seedFromFaucet
to distribute funds other wallets.
withCardanoNodeOnKnownNetwork Source #
:: Tracer IO NodeLog | |
-> FilePath | State directory in which node db & logs are persisted. |
-> KnownNetwork | A well-known Cardano network to connect to. |
-> (RunningNode -> IO a) | |
-> IO a |
Run a cardano-node as normal network participant on a known network.
setupCardanoDevnet :: FilePath -> IO CardanoNodeArgs Source #
Setup the cardano-node to run a local devnet producing blocks. This copies
the appropriate files and prepares CardanoNodeArgs
for withCardanoNode
.
withCardanoNode :: Tracer IO NodeLog -> FilePath -> CardanoNodeArgs -> (RunningNode -> IO a) -> IO a Source #
computeBlockTime :: NominalDiffTime -> Rational -> NominalDiffTime Source #
Compute the block time (expected time between blocks) given a slot length as diff time and active slot coefficient.
waitForFullySynchronized :: Tracer IO NodeLog -> RunningNode -> IO () Source #
Wait until the node is fully caught up with the network. This can take a while!
waitForSocket :: SocketPath -> IO () Source #
Wait for the node socket file to become available.
cardanoNodeProcess :: Maybe FilePath -> CardanoNodeArgs -> CreateProcess Source #
Generate command-line arguments for launching cardano-node
.
initSystemStart :: IO UTCTime Source #
Initialize the system start time to now (modulo a small offset needed to give time to the system to bootstrap correctly).
:: FilePath | Working directory in which paths of |
-> CardanoNodeArgs | |
-> IO () |
Re-generate configuration and genesis files with fresh system start times.
mkTopology :: [Port] -> Value Source #
Generate a topology file from a list of peers.
generateCardanoKey :: IO (VerificationKey PaymentKey, SigningKey PaymentKey) Source #
data ProcessHasExited Source #
Instances
Exception ProcessHasExited Source # | |
Defined in CardanoNode | |
Show ProcessHasExited Source # | |
Defined in CardanoNode |
cliQueryProtocolParameters :: SocketPath -> NetworkId -> IO Value Source #
Cardano-cli wrapper to query protocol parameters. While we have also client functions in Hydra.Chain.CardanoClient and Hydra.Cluster.CardanoClient, sometimes we deliberately want to use the cardano-cli to ensure compatibility.
withObject :: (Object -> Object) -> Value -> Value Source #
Do something with an a JSON object. Fails if the given JSON value isn't an object.
unsafeDecodeJson :: FromJSON a => ByteString -> IO a Source #
unsafeDecodeJsonFile :: FromJSON a => FilePath -> IO a Source #