Safe Haskell | None |
---|---|
Language | Haskell2010 |
Cardano.Node.Protocol.Shelley
Synopsis
- mkConsensusProtocolShelley :: NodeShelleyProtocolConfiguration -> Maybe ProtocolFilepaths -> ExceptT ShelleyProtocolInstantiationError IO (Protocol IO (ShelleyBlockHFC StandardShelley) ProtocolShelley)
- mkSomeConsensusProtocolShelley :: NodeShelleyProtocolConfiguration -> Maybe ProtocolFilepaths -> ExceptT ShelleyProtocolInstantiationError IO SomeConsensusProtocol
- data ShelleyProtocolInstantiationError
- renderShelleyProtocolInstantiationError :: ShelleyProtocolInstantiationError -> Text
- readGenesis :: GenesisFile -> Maybe GenesisHash -> ExceptT ShelleyProtocolInstantiationError IO (ShelleyGenesis StandardShelley, GenesisHash)
- readLeaderCredentials :: Maybe ProtocolFilepaths -> ExceptT ShelleyProtocolInstantiationError IO (Maybe (TPraosLeaderCredentials StandardCrypto))
- genesisHashToPraosNonce :: GenesisHash -> Nonce
Protocol exposing the specific type
Use this when you need the specific instance
mkConsensusProtocolShelley :: NodeShelleyProtocolConfiguration -> Maybe ProtocolFilepaths -> ExceptT ShelleyProtocolInstantiationError IO (Protocol IO (ShelleyBlockHFC StandardShelley) ProtocolShelley) Source #
Instantiate Protocol
for Shelley specifically.
Use this when you need to run the consensus with this specific protocol.
Protocols hiding the specific type
Use this when you want to handle protocols generically
mkSomeConsensusProtocolShelley :: NodeShelleyProtocolConfiguration -> Maybe ProtocolFilepaths -> ExceptT ShelleyProtocolInstantiationError IO SomeConsensusProtocol Source #
Make SomeConsensusProtocol
using the Shelley 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 ShelleyProtocolInstantiationError Source #
Constructors
Instances
Show ShelleyProtocolInstantiationError Source # | |
Defined in Cardano.Node.Protocol.Shelley Methods showsPrec :: Int -> ShelleyProtocolInstantiationError -> ShowS # |
Reusable parts
readGenesis :: GenesisFile -> Maybe GenesisHash -> ExceptT ShelleyProtocolInstantiationError IO (ShelleyGenesis StandardShelley, GenesisHash) Source #