Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- mkSomeConsensusProtocolSophie ∷ NodeSophieProtocolConfiguration → Maybe ProtocolFilepaths → ExceptT SophieProtocolInstantiationError IO SomeConsensusProtocol
- data SophieProtocolInstantiationError
- data GenesisReadError
- newtype GenesisValidationError = GenesisValidationErrors [ValidationErr]
- data OptimumLeaderCredentialsError
- readGenesis ∷ GenesisFile → Maybe GenesisHash → ExceptT GenesisReadError IO (SophieGenesis StandardSophie, GenesisHash)
- readGenesisAny ∷ FromJSON genesis ⇒ GenesisFile → Maybe GenesisHash → ExceptT GenesisReadError IO (genesis, GenesisHash)
- readLeaderCredentials ∷ Maybe ProtocolFilepaths → ExceptT OptimumLeaderCredentialsError IO [TOptimumLeaderCredentials StandardCrypto]
- genesisHashToOptimumNonce ∷ GenesisHash → Nonce
- validateGenesis ∷ SophieGenesis StandardSophie → ExceptT GenesisValidationError IO ()
Documentation
mkSomeConsensusProtocolSophie ∷ NodeSophieProtocolConfiguration → Maybe ProtocolFilepaths → ExceptT SophieProtocolInstantiationError IO SomeConsensusProtocol Source #
Make SomeConsensusProtocol
using the Sophie instance.
This lets us handle multiple protocols in a generic way.
This also serves a purpose as a sanity check that we have all the necessary type class instances available.
Errors
data SophieProtocolInstantiationError Source #
GenesisReadError GenesisReadError | |
GenesisValidationError GenesisValidationError | |
OptimumLeaderCredentialsError OptimumLeaderCredentialsError |
data GenesisReadError Source #
GenesisReadFileError !FilePath !IOException | |
GenesisHashMismatch !GenesisHash !GenesisHash | |
GenesisDecodeError !FilePath !String |
Instances
Show GenesisReadError Source # | |
Defined in Bcc.Node.Protocol.Sophie | |
Error GenesisReadError Source # | |
Defined in Bcc.Node.Protocol.Sophie |
newtype GenesisValidationError Source #
GenesisValidationErrors [ValidationErr] |
Instances
Show GenesisValidationError Source # | |
Defined in Bcc.Node.Protocol.Sophie | |
Error GenesisValidationError Source # | |
Defined in Bcc.Node.Protocol.Sophie |
data OptimumLeaderCredentialsError Source #
CredentialsReadError !FilePath !IOException | |
EnvelopeParseError !FilePath !String | |
FileError !(FileError TextEnvelopeError) | |
OCertNotSpecified | |
VRFKeyNotSpecified | |
KESKeyNotSpecified |
Instances
Reusable parts
readGenesis ∷ GenesisFile → Maybe GenesisHash → ExceptT GenesisReadError IO (SophieGenesis StandardSophie, GenesisHash) Source #
readGenesisAny ∷ FromJSON genesis ⇒ GenesisFile → Maybe GenesisHash → ExceptT GenesisReadError IO (genesis, GenesisHash) Source #
readLeaderCredentials ∷ Maybe ProtocolFilepaths → ExceptT OptimumLeaderCredentialsError IO [TOptimumLeaderCredentials StandardCrypto] Source #
genesisHashToOptimumNonce ∷ GenesisHash → Nonce Source #
validateGenesis ∷ SophieGenesis StandardSophie → ExceptT GenesisValidationError IO () Source #