pigy-genetics
Safe HaskellNone
LanguageHaskell2010

Pigy.Types

Description

Types for the pig-image service.

Synopsis

Documentation

data Configuration Source #

The service configuration.

Constructors

Configuration 

Fields

  • socketPath :: FilePath

    The path for the Cardano node's socket.

  • magic :: Maybe Word32

    The magic number for the Cardano network, unless using mainnet.

  • epochSlots :: Word64

    The number of slots per epoch.

  • policyId :: String

    The policy ID of the payment token.

  • assetName :: String

    The asset name of the payment token.

  • keyInfo :: KeyInfo

    The service's key.

  • ipfsScript :: FilePath

    The path to the IPFS pinning script.

  • imageFolder :: FilePath

    The path to the folder of images.

  • mode :: Mode

    The operational mode.

  • quiet :: Bool

    The verbosity.

Instances

Instances details
Read Configuration Source # 
Instance details

Defined in Pigy.Types

Methods

readsPrec :: Int -> ReadS Configuration

readList :: ReadS [Configuration]

readPrec :: ReadPrec Configuration

readListPrec :: ReadPrec [Configuration]

Show Configuration Source # 
Instance details

Defined in Pigy.Types

Methods

showsPrec :: Int -> Configuration -> ShowS

show :: Configuration -> String

showList :: [Configuration] -> ShowS

data Mode Source #

The operational mode.

Constructors

Strict

Only accept requests as single transactions.

Lenient

Accept split transactions, processing when idle.

Aggressive

Accept split transactions, processing as soon as possible.

Instances

Instances details
Eq Mode Source # 
Instance details

Defined in Pigy.Types

Methods

(==) :: Mode -> Mode -> Bool

(/=) :: Mode -> Mode -> Bool

Ord Mode Source # 
Instance details

Defined in Pigy.Types

Methods

compare :: Mode -> Mode -> Ordering

(<) :: Mode -> Mode -> Bool

(<=) :: Mode -> Mode -> Bool

(>) :: Mode -> Mode -> Bool

(>=) :: Mode -> Mode -> Bool

max :: Mode -> Mode -> Mode

min :: Mode -> Mode -> Mode

Read Mode Source # 
Instance details

Defined in Pigy.Types

Methods

readsPrec :: Int -> ReadS Mode

readList :: ReadS [Mode]

readPrec :: ReadPrec Mode

readListPrec :: ReadPrec [Mode]

Show Mode Source # 
Instance details

Defined in Pigy.Types

Methods

showsPrec :: Int -> Mode -> ShowS

show :: Mode -> String

showList :: [Mode] -> ShowS

data KeyInfo Source #

Key information.

Constructors

KeyInfo 

Fields

Instances

Instances details
Read KeyInfo Source # 
Instance details

Defined in Pigy.Types

Methods

readsPrec :: Int -> ReadS KeyInfo

readList :: ReadS [KeyInfo]

readPrec :: ReadPrec KeyInfo

readListPrec :: ReadPrec [KeyInfo]

Show KeyInfo Source # 
Instance details

Defined in Pigy.Types

Methods

showsPrec :: Int -> KeyInfo -> ShowS

show :: KeyInfo -> String

showList :: [KeyInfo] -> ShowS

data Context Source #

The contetual parameters for the service.

Constructors

Context 

Fields

  • socket :: FilePath

    The path for the Cardano node's socket.

  • protocol :: ConsensusModeParams CardanoMode

    The Cardano consensus mode.

  • network :: NetworkId

    The Cardano network.

  • pparams :: ProtocolParameters

    The Cardano protocol.

  • token :: AssetId

    The asset ID for the payment token.

  • keyedAddress :: KeyedAddress

    The service address.

  • gRandom :: IOGenM StdGen

    The random-number generator.

  • ipfsPin :: FilePath

    The path to the IPFS script for pinning images.

  • images :: FilePath

    The path to the folder for images.

  • operation :: Mode

    The operational mode.

  • verbose :: Bool

    The verbosity.

data KeyedAddress Source #

A key and it hashes.

Constructors

KeyedAddress 

Fields

  • keyAddress :: AddressInEra MaryEra

    The address.

  • verificationHash :: Hash PaymentKey

    The hash of the verification key.

  • verification :: SomePaymentVerificationKey

    The verification key.

  • signing :: SigningKey PaymentExtendedKey

    The signing key.

Instances

Instances details
Show KeyedAddress Source # 
Instance details

Defined in Pigy.Types

Methods

showsPrec :: Int -> KeyedAddress -> ShowS

show :: KeyedAddress -> String

showList :: [KeyedAddress] -> ShowS

readConfiguration Source #

Arguments

:: MonadIO m 
=> FilePath

The path to the configuration file.

-> MantisM m Configuration

The action returning the configuration.

Read a configuration file.

makeContext Source #

Arguments

:: MonadFail m 
=> MonadIO m 
=> Configuration

The configuration.

-> MantisM m Context

The action returning the context.

Convert a configuration into a service context.

readKeyedAddress Source #

Arguments

:: MonadIO m 
=> KeyInfo

The key information.

-> MantisM m KeyedAddress

The key and its hashes.

Read a key.