| License | Apache-2.0 |
|---|---|
| Safe Haskell | None |
| Language | GHC2021 |
Singular.Registry.Deployment.Manifest
Description
One owner for the deployment record as a file: the manifest and
reference-script values with their JSON instances, reading and writing
one, choosing one from a command line or the environment, the
txid#index spelling and its parse, an address as the exact hex bytes
the ledger serialises, the byte-rendering helper hex and the shared
error helper die the deployment family shares. Nothing here queries
a node.
This module is an internal owner behind the Deployment
facade: callers import the facade, which re-exports the unchanged public
surface. See the deployment ownership guide for the dependency direction
between the owners.
Synopsis
- data Deployment = Deployment {
- depRelease :: Text
- depLeanRevision :: Text
- depNetworkMagic :: Word32
- depSeedOutRef :: Text
- depCageToken :: Text
- depStatePolicy :: Text
- depRequestHash :: Text
- depApplicationHash :: Text
- depRepresentativePolicy :: Text
- depProcessTime :: Integer
- depRetractTime :: Integer
- depTip :: Integer
- depReferenceScripts :: [ReferenceScript]
- depBootstrapTxs :: [Text]
- data ReferenceScript = ReferenceScript {
- refRole :: Text
- refHash :: Text
- refOutRef :: Text
- refAddress :: Text
- refAddressBytes :: Text
- readDeployment :: FilePath -> IO Deployment
- writeDeployment :: FilePath -> Deployment -> IO ()
- deploymentPathFromArgs :: [String] -> Maybe FilePath
- deploymentPathFromEnvironment :: IO (Maybe FilePath)
- renderOutRef :: TxIn -> Text
- parseOutRef :: Text -> Either String TxIn
- renderAddrBytes :: Addr -> Text
- mirrorPathFor :: FilePath -> FilePath
- die :: String -> IO a
- hex :: ByteString -> String
The manifest
data Deployment Source #
A registry that exists, recorded well enough to find it again and to refuse to use the wrong one.
Constructors
| Deployment | |
Fields
| |
Instances
| FromJSON Deployment Source # | |||||
Defined in Singular.Registry.Deployment.Manifest Methods parseJSON :: Value -> Parser Deployment parseJSONList :: Value -> Parser [Deployment] omittedField :: Maybe Deployment | |||||
| ToJSON Deployment Source # | |||||
Defined in Singular.Registry.Deployment.Manifest Methods toJSON :: Deployment -> Value toEncoding :: Deployment -> Encoding toJSONList :: [Deployment] -> Value toEncodingList :: [Deployment] -> Encoding omitField :: Deployment -> Bool | |||||
| Generic Deployment Source # | |||||
Defined in Singular.Registry.Deployment.Manifest Associated Types
| |||||
| Show Deployment Source # | |||||
Defined in Singular.Registry.Deployment.Manifest Methods showsPrec :: Int -> Deployment -> ShowS Source # show :: Deployment -> String Source # showList :: [Deployment] -> ShowS Source # | |||||
| Eq Deployment Source # | |||||
Defined in Singular.Registry.Deployment.Manifest Methods (==) :: Deployment -> Deployment -> Bool Source # (/=) :: Deployment -> Deployment -> Bool Source # | |||||
| type Rep Deployment Source # | |||||
Defined in Singular.Registry.Deployment.Manifest type Rep Deployment = D1 ('MetaData "Deployment" "Singular.Registry.Deployment.Manifest" "singular-registry-0.1.0.0-Ixhbs5JE28qkUXbRQkkWU" 'False) (C1 ('MetaCons "Deployment" 'PrefixI 'True) (((S1 ('MetaSel ('Just "depRelease") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "depLeanRevision") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "depNetworkMagic") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Word32))) :*: ((S1 ('MetaSel ('Just "depSeedOutRef") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "depCageToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "depStatePolicy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "depRequestHash") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))) :*: ((S1 ('MetaSel ('Just "depApplicationHash") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "depRepresentativePolicy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "depProcessTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Integer))) :*: ((S1 ('MetaSel ('Just "depRetractTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Integer) :*: S1 ('MetaSel ('Just "depTip") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Integer)) :*: (S1 ('MetaSel ('Just "depReferenceScripts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [ReferenceScript]) :*: S1 ('MetaSel ('Just "depBootstrapTxs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Text])))))) | |||||
data ReferenceScript Source #
One reference-script output: what it carries, where it is, and the hash a node must agree it holds.
Constructors
| ReferenceScript | |
Fields
| |
Instances
| FromJSON ReferenceScript Source # | |||||
Defined in Singular.Registry.Deployment.Manifest Methods parseJSON :: Value -> Parser ReferenceScript parseJSONList :: Value -> Parser [ReferenceScript] omittedField :: Maybe ReferenceScript | |||||
| ToJSON ReferenceScript Source # | |||||
Defined in Singular.Registry.Deployment.Manifest Methods toJSON :: ReferenceScript -> Value toEncoding :: ReferenceScript -> Encoding toJSONList :: [ReferenceScript] -> Value toEncodingList :: [ReferenceScript] -> Encoding omitField :: ReferenceScript -> Bool | |||||
| Generic ReferenceScript Source # | |||||
Defined in Singular.Registry.Deployment.Manifest Associated Types
Methods from :: ReferenceScript -> Rep ReferenceScript x Source # to :: Rep ReferenceScript x -> ReferenceScript Source # | |||||
| Show ReferenceScript Source # | |||||
Defined in Singular.Registry.Deployment.Manifest Methods showsPrec :: Int -> ReferenceScript -> ShowS Source # show :: ReferenceScript -> String Source # showList :: [ReferenceScript] -> ShowS Source # | |||||
| Eq ReferenceScript Source # | |||||
Defined in Singular.Registry.Deployment.Manifest Methods (==) :: ReferenceScript -> ReferenceScript -> Bool Source # (/=) :: ReferenceScript -> ReferenceScript -> Bool Source # | |||||
| type Rep ReferenceScript Source # | |||||
Defined in Singular.Registry.Deployment.Manifest type Rep ReferenceScript = D1 ('MetaData "ReferenceScript" "Singular.Registry.Deployment.Manifest" "singular-registry-0.1.0.0-Ixhbs5JE28qkUXbRQkkWU" 'False) (C1 ('MetaCons "ReferenceScript" 'PrefixI 'True) ((S1 ('MetaSel ('Just "refRole") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "refHash") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "refOutRef") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "refAddress") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "refAddressBytes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))))) | |||||
readDeployment :: FilePath -> IO Deployment Source #
Read a manifest, naming the file when it will not parse.
writeDeployment :: FilePath -> Deployment -> IO () Source #
Write a manifest, formatted for a person to read in review.
Choosing one
deploymentPathFromArgs :: [String] -> Maybe FilePath Source #
The manifest a command line names, if any. --deployment PATH and
--deployment=PATH are both accepted; absent, the caller keeps its
existing behaviour of booting its own registry.
deploymentPathFromEnvironment :: IO (Maybe FilePath) Source #
deploymentPathFromArgs for this process, falling back to
SINGULAR_DEPLOYMENT.
Output references
renderOutRef :: TxIn -> Text Source #
txid#index, the spelling every Cardano tool prints.
parseOutRef :: Text -> Either String TxIn Source #
Parse txid#index back, naming what was wrong with it.
renderAddrBytes :: Addr -> Text Source #
An address as the manifest records it: exact bytes, in hex.
The mirror's path
mirrorPathFor :: FilePath -> FilePath Source #
Where the proof mirror for a manifest lives: the manifest's own
path with a .mirror.json extension, so the two travel together and
neither is guessed from a separate flag.