Safe Haskell | None |
---|---|
Language | Haskell2010 |
Bcc.Node.Protocol.Cole
Contents
Synopsis
- mkSomeConsensusProtocolCole ∷ NodeColeProtocolConfiguration → Maybe ProtocolFilepaths → ExceptT ColeProtocolInstantiationError IO SomeConsensusProtocol
- data ColeProtocolInstantiationError
- = CanonicalDecodeFailure !FilePath !Text
- | GenesisHashMismatch !GenesisHash !GenesisHash
- | DelegationCertificateFilepathNotSpecified
- | GenesisConfigurationError !FilePath !ConfigurationError
- | GenesisReadError !FilePath !GenesisDataError
- | CredentialsError !ColeLeaderCredentialsError
- | SigningKeyDeserialiseFailure !FilePath
- | SigningKeyFilepathNotSpecified
- readGenesis ∷ GenesisFile → Maybe GenesisHash → RequiresNetworkMagic → ExceptT ColeProtocolInstantiationError IO Config
- readLeaderCredentials ∷ Config → Maybe ProtocolFilepaths → ExceptT ColeProtocolInstantiationError IO (Maybe ColeLeaderCredentials)
Documentation
mkSomeConsensusProtocolCole ∷ NodeColeProtocolConfiguration → Maybe ProtocolFilepaths → ExceptT ColeProtocolInstantiationError IO SomeConsensusProtocol Source #
Make SomeConsensusProtocol
using the Cole 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 ColeProtocolInstantiationError Source #
Constructors
CanonicalDecodeFailure !FilePath !Text | |
GenesisHashMismatch !GenesisHash !GenesisHash | |
DelegationCertificateFilepathNotSpecified | |
GenesisConfigurationError !FilePath !ConfigurationError | |
GenesisReadError !FilePath !GenesisDataError | |
CredentialsError !ColeLeaderCredentialsError | |
SigningKeyDeserialiseFailure !FilePath | |
SigningKeyFilepathNotSpecified |
Instances
Show ColeProtocolInstantiationError Source # | |
Defined in Bcc.Node.Protocol.Cole | |
Error ColeProtocolInstantiationError Source # | |
Defined in Bcc.Node.Protocol.Cole Methods displayError ∷ ColeProtocolInstantiationError → String Source # |
Reusable parts
readGenesis ∷ GenesisFile → Maybe GenesisHash → RequiresNetworkMagic → ExceptT ColeProtocolInstantiationError IO Config Source #
readLeaderCredentials ∷ Config → Maybe ProtocolFilepaths → ExceptT ColeProtocolInstantiationError IO (Maybe ColeLeaderCredentials) Source #