| Copyright | No rights reserved |
|---|---|
| License | MIT |
| Maintainer | jprupp@protonmail.ch |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | None |
| Language | Haskell2010 |
Haskoin.Network.Common
Contents
Description
Common functions and data types related to peer-to-peer network.
Synopsis
- newtype Addr = Addr {
- list :: [NetworkAddressTime]
- type NetworkAddressTime = (Word32, NetworkAddress)
- data Alert = Alert {}
- newtype GetData = GetData {}
- newtype Inv = Inv {}
- data InvVector = InvVector {}
- data InvType
- data HostAddress
- hostToSockAddr :: HostAddress -> SockAddr
- sockToHostAddress :: SockAddr -> HostAddress
- data NetworkAddress = NetworkAddress {
- services :: !Word64
- address :: !HostAddress
- newtype NotFound = NotFound {}
- newtype Ping = Ping {}
- newtype Pong = Pong {}
- data Reject = Reject {
- message :: !MessageCommand
- code :: !RejectCode
- reason :: !VarString
- extra :: !ByteString
- data RejectCode
- newtype VarInt = VarInt {}
- newtype VarString = VarString {
- get :: ByteString
- data Version = Version {}
- data MessageCommand
- reject :: MessageCommand -> RejectCode -> ByteString -> Reject
- nodeNone :: Word64
- nodeNetwork :: Word64
- nodeGetUTXO :: Word64
- nodeBloom :: Word64
- nodeWitness :: Word64
- nodeXThin :: Word64
- commandToString :: MessageCommand -> ByteString
- stringToCommand :: ByteString -> MessageCommand
- putVarInt :: (MonadPut m, Integral a) => a -> m ()
Network Data Types
Provides information about known nodes in the bitcoin network. An Addr
type is sent inside a Message as a response to a GetAddr message.
Constructors
| Addr | |
Fields
| |
Instances
| Generic Addr Source # | |||||
Defined in Haskoin.Network.Common Associated Types
| |||||
| Show Addr Source # | |||||
| Binary Addr Source # | |||||
| Serial Addr Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Serialize Addr Source # | |||||
| NFData Addr Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Eq Addr Source # | |||||
| type Rep Addr Source # | |||||
Defined in Haskoin.Network.Common type Rep Addr = D1 ('MetaData "Addr" "Haskoin.Network.Common" "haskoin-core-1.2.2-IqsPTB3lyDG9ChtLlvwlSX" 'True) (C1 ('MetaCons "Addr" 'PrefixI 'True) (S1 ('MetaSel ('Just "list") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [NetworkAddressTime]))) | |||||
type NetworkAddressTime = (Word32, NetworkAddress) Source #
Network address with a timestamp.
Data type describing signed messages that can be sent between bitcoin nodes to display important notifications to end users about the health of the network.
Constructors
| Alert | |
Instances
The GetData type is used to retrieve information on a specific object
(Block or Tx) identified by the objects hash. The payload of a GetData
request is a list of InvVector which represent all the hashes of objects
that a node wants. The response to a GetBlock message will be either a
Block or a Tx message depending on the type of the object referenced by
the hash. Usually, GetData messages are sent after a node receives an Inv
message that contains unknown object hashes.
Instances
| Generic GetData Source # | |||||
Defined in Haskoin.Network.Common Associated Types
| |||||
| Show GetData Source # | |||||
| Binary GetData Source # | |||||
| Serial GetData Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Serialize GetData Source # | |||||
| NFData GetData Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Eq GetData Source # | |||||
| type Rep GetData Source # | |||||
Defined in Haskoin.Network.Common | |||||
Inv messages are used by nodes to advertise their knowledge of new
objects by publishing a list of hashes to a peer. Inv messages can be sent
unsolicited or in response to a GetBlocks message.
Instances
| Generic Inv Source # | |||||
Defined in Haskoin.Network.Common Associated Types
| |||||
| Show Inv Source # | |||||
| Binary Inv Source # | |||||
| Serial Inv Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Serialize Inv Source # | |||||
| NFData Inv Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Eq Inv Source # | |||||
| type Rep Inv Source # | |||||
Defined in Haskoin.Network.Common | |||||
Invectory vectors represent hashes identifying objects such as a Block or
a Tx. They notify other peers about new data or data they have otherwise
requested.
Constructors
| InvVector | |
Instances
| Generic InvVector Source # | |||||
Defined in Haskoin.Network.Common Associated Types
| |||||
| Show InvVector Source # | |||||
| Binary InvVector Source # | |||||
| Serial InvVector Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Serialize InvVector Source # | |||||
| NFData InvVector Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Eq InvVector Source # | |||||
| type Rep InvVector Source # | |||||
Defined in Haskoin.Network.Common type Rep InvVector = D1 ('MetaData "InvVector" "Haskoin.Network.Common" "haskoin-core-1.2.2-IqsPTB3lyDG9ChtLlvwlSX" 'False) (C1 ('MetaCons "InvVector" 'PrefixI 'True) (S1 ('MetaSel ('Just "invType") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 InvType) :*: S1 ('MetaSel ('Just "invHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Hash256))) | |||||
Data type identifying the type of an inventory vector. SegWit types are
only used in GetData messages, not Inv.
Constructors
| InvError | error |
| InvTx | transaction |
| InvBlock | block |
| InvMerkleBlock | filtered block |
| InvWitnessTx | segwit transaction |
| InvWitnessBlock | segwit block |
| InvWitnessMerkleBlock | segwit filtered block |
| InvType Word32 | unknown inv type |
Instances
| Generic InvType Source # | |||||
Defined in Haskoin.Network.Common Associated Types
| |||||
| Read InvType Source # | |||||
| Show InvType Source # | |||||
| Binary InvType Source # | |||||
| Serial InvType Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Serialize InvType Source # | |||||
| NFData InvType Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Eq InvType Source # | |||||
| type Rep InvType Source # | |||||
Defined in Haskoin.Network.Common type Rep InvType = D1 ('MetaData "InvType" "Haskoin.Network.Common" "haskoin-core-1.2.2-IqsPTB3lyDG9ChtLlvwlSX" 'False) (((C1 ('MetaCons "InvError" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "InvTx" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "InvBlock" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "InvMerkleBlock" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "InvWitnessTx" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "InvWitnessBlock" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "InvWitnessMerkleBlock" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "InvType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32))))) | |||||
data HostAddress Source #
Instances
| Generic HostAddress Source # | |||||
Defined in Haskoin.Network.Common Associated Types
| |||||
| Show HostAddress Source # | |||||
Defined in Haskoin.Network.Common Methods showsPrec :: Int -> HostAddress -> ShowS # show :: HostAddress -> String # showList :: [HostAddress] -> ShowS # | |||||
| Binary HostAddress Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Serial HostAddress Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Serialize HostAddress Source # | |||||
Defined in Haskoin.Network.Common | |||||
| NFData HostAddress Source # | |||||
Defined in Haskoin.Network.Common Methods rnf :: HostAddress -> () # | |||||
| Eq HostAddress Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Ord HostAddress Source # | |||||
Defined in Haskoin.Network.Common Methods compare :: HostAddress -> HostAddress -> Ordering # (<) :: HostAddress -> HostAddress -> Bool # (<=) :: HostAddress -> HostAddress -> Bool # (>) :: HostAddress -> HostAddress -> Bool # (>=) :: HostAddress -> HostAddress -> Bool # max :: HostAddress -> HostAddress -> HostAddress # min :: HostAddress -> HostAddress -> HostAddress # | |||||
| type Rep HostAddress Source # | |||||
Defined in Haskoin.Network.Common type Rep HostAddress = D1 ('MetaData "HostAddress" "Haskoin.Network.Common" "haskoin-core-1.2.2-IqsPTB3lyDG9ChtLlvwlSX" 'True) (C1 ('MetaCons "HostAddress" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString))) | |||||
hostToSockAddr :: HostAddress -> SockAddr Source #
data NetworkAddress Source #
Data type describing a bitcoin network address. Addresses are stored in IPv6 format. IPv4 addresses are mapped to IPv6 using IPv4 mapped IPv6 addresses: http://en.wikipedia.org/wiki/IPv6#IPv4-mapped_IPv6_addresses.
Constructors
| NetworkAddress | |
Fields
| |
Instances
| Generic NetworkAddress Source # | |||||
Defined in Haskoin.Network.Common Associated Types
Methods from :: NetworkAddress -> Rep NetworkAddress x # to :: Rep NetworkAddress x -> NetworkAddress # | |||||
| Show NetworkAddress Source # | |||||
Defined in Haskoin.Network.Common Methods showsPrec :: Int -> NetworkAddress -> ShowS # show :: NetworkAddress -> String # showList :: [NetworkAddress] -> ShowS # | |||||
| Binary NetworkAddress Source # | |||||
Defined in Haskoin.Network.Common Methods put :: NetworkAddress -> Put # get :: Get NetworkAddress # putList :: [NetworkAddress] -> Put # | |||||
| Serial NetworkAddress Source # | |||||
Defined in Haskoin.Network.Common Methods serialize :: MonadPut m => NetworkAddress -> m () # deserialize :: MonadGet m => m NetworkAddress # | |||||
| Serialize NetworkAddress Source # | |||||
Defined in Haskoin.Network.Common | |||||
| NFData NetworkAddress Source # | |||||
Defined in Haskoin.Network.Common Methods rnf :: NetworkAddress -> () # | |||||
| Eq NetworkAddress Source # | |||||
Defined in Haskoin.Network.Common Methods (==) :: NetworkAddress -> NetworkAddress -> Bool # (/=) :: NetworkAddress -> NetworkAddress -> Bool # | |||||
| type Rep NetworkAddress Source # | |||||
Defined in Haskoin.Network.Common type Rep NetworkAddress = D1 ('MetaData "NetworkAddress" "Haskoin.Network.Common" "haskoin-core-1.2.2-IqsPTB3lyDG9ChtLlvwlSX" 'False) (C1 ('MetaCons "NetworkAddress" 'PrefixI 'True) (S1 ('MetaSel ('Just "services") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64) :*: S1 ('MetaSel ('Just "address") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 HostAddress))) | |||||
A NotFound message is returned as a response to a GetData message
whe one of the requested objects could not be retrieved. This could happen,
for example, if a tranasaction was requested and was not available in the
memory pool of the receiving node.
Instances
| Generic NotFound Source # | |||||
Defined in Haskoin.Network.Common Associated Types
| |||||
| Show NotFound Source # | |||||
| Binary NotFound Source # | |||||
| Serial NotFound Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Serialize NotFound Source # | |||||
| NFData NotFound Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Eq NotFound Source # | |||||
| type Rep NotFound Source # | |||||
Defined in Haskoin.Network.Common | |||||
A Ping message is sent to bitcoin peers to check if a connection is still
open.
Constructors
| Ping | |
Instances
| Generic Ping Source # | |||||
Defined in Haskoin.Network.Common Associated Types
| |||||
| Read Ping Source # | |||||
| Show Ping Source # | |||||
| Binary Ping Source # | |||||
| Serial Ping Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Serialize Ping Source # | |||||
| NFData Ping Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Eq Ping Source # | |||||
| type Rep Ping Source # | |||||
Defined in Haskoin.Network.Common | |||||
A Pong message is sent as a response to a ping message.
Instances
| Generic Pong Source # | |||||
Defined in Haskoin.Network.Common Associated Types
| |||||
| Read Pong Source # | |||||
| Show Pong Source # | |||||
| Binary Pong Source # | |||||
| Serial Pong Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Serialize Pong Source # | |||||
| NFData Pong Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Eq Pong Source # | |||||
| type Rep Pong Source # | |||||
Defined in Haskoin.Network.Common | |||||
The Reject message is sent when messages are rejected by a peer.
Constructors
| Reject | |
Fields
| |
Instances
| Generic Reject Source # | |||||
Defined in Haskoin.Network.Common Associated Types
| |||||
| Read Reject Source # | |||||
| Show Reject Source # | |||||
| Binary Reject Source # | |||||
| Serial Reject Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Serialize Reject Source # | |||||
| NFData Reject Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Eq Reject Source # | |||||
| type Rep Reject Source # | |||||
Defined in Haskoin.Network.Common type Rep Reject = D1 ('MetaData "Reject" "Haskoin.Network.Common" "haskoin-core-1.2.2-IqsPTB3lyDG9ChtLlvwlSX" 'False) (C1 ('MetaCons "Reject" 'PrefixI 'True) ((S1 ('MetaSel ('Just "message") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 MessageCommand) :*: S1 ('MetaSel ('Just "code") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 RejectCode)) :*: (S1 ('MetaSel ('Just "reason") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 VarString) :*: S1 ('MetaSel ('Just "extra") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ByteString)))) | |||||
data RejectCode Source #
Rejection code associated to the Reject message.
Constructors
| RejectMalformed | |
| RejectInvalid | |
| RejectObsolete | |
| RejectDuplicate | |
| RejectNonStandard | |
| RejectDust | |
| RejectInsufficientFee | |
| RejectCheckpoint |
Instances
| Generic RejectCode Source # | |||||
Defined in Haskoin.Network.Common Associated Types
| |||||
| Read RejectCode Source # | |||||
Defined in Haskoin.Network.Common Methods readsPrec :: Int -> ReadS RejectCode # readList :: ReadS [RejectCode] # readPrec :: ReadPrec RejectCode # readListPrec :: ReadPrec [RejectCode] # | |||||
| Show RejectCode Source # | |||||
Defined in Haskoin.Network.Common Methods showsPrec :: Int -> RejectCode -> ShowS # show :: RejectCode -> String # showList :: [RejectCode] -> ShowS # | |||||
| Binary RejectCode Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Serial RejectCode Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Serialize RejectCode Source # | |||||
Defined in Haskoin.Network.Common | |||||
| NFData RejectCode Source # | |||||
Defined in Haskoin.Network.Common Methods rnf :: RejectCode -> () # | |||||
| Eq RejectCode Source # | |||||
Defined in Haskoin.Network.Common | |||||
| type Rep RejectCode Source # | |||||
Defined in Haskoin.Network.Common type Rep RejectCode = D1 ('MetaData "RejectCode" "Haskoin.Network.Common" "haskoin-core-1.2.2-IqsPTB3lyDG9ChtLlvwlSX" 'False) (((C1 ('MetaCons "RejectMalformed" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "RejectInvalid" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "RejectObsolete" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "RejectDuplicate" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "RejectNonStandard" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "RejectDust" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "RejectInsufficientFee" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "RejectCheckpoint" 'PrefixI 'False) (U1 :: Type -> Type)))) | |||||
Data type representing a variable-length integer. The VarInt type
usually precedes an array or a string that can vary in length.
Instances
| Generic VarInt Source # | |||||
Defined in Haskoin.Network.Common Associated Types
| |||||
| Read VarInt Source # | |||||
| Show VarInt Source # | |||||
| Binary VarInt Source # | |||||
| Serial VarInt Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Serialize VarInt Source # | |||||
| NFData VarInt Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Eq VarInt Source # | |||||
| type Rep VarInt Source # | |||||
Defined in Haskoin.Network.Common | |||||
Data type for serialization of variable-length strings.
Constructors
| VarString | |
Fields
| |
Instances
| Generic VarString Source # | |||||
Defined in Haskoin.Network.Common Associated Types
| |||||
| Read VarString Source # | |||||
| Show VarString Source # | |||||
| Binary VarString Source # | |||||
| Serial VarString Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Serialize VarString Source # | |||||
| NFData VarString Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Eq VarString Source # | |||||
| type Rep VarString Source # | |||||
Defined in Haskoin.Network.Common type Rep VarString = D1 ('MetaData "VarString" "Haskoin.Network.Common" "haskoin-core-1.2.2-IqsPTB3lyDG9ChtLlvwlSX" 'True) (C1 ('MetaCons "VarString" 'PrefixI 'True) (S1 ('MetaSel ('Just "get") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString))) | |||||
When a bitcoin node creates an outgoing connection to another node,
the first message it will send is a Version message. The other node
will similarly respond with it's own Version message.
Constructors
| Version | |
Fields
| |
Instances
| Generic Version Source # | |||||
Defined in Haskoin.Network.Common Associated Types
| |||||
| Show Version Source # | |||||
| Binary Version Source # | |||||
| Serial Version Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Serialize Version Source # | |||||
| NFData Version Source # | |||||
Defined in Haskoin.Network.Common | |||||
| Eq Version Source # | |||||
| type Rep Version Source # | |||||
Defined in Haskoin.Network.Common type Rep Version = D1 ('MetaData "Version" "Haskoin.Network.Common" "haskoin-core-1.2.2-IqsPTB3lyDG9ChtLlvwlSX" 'False) (C1 ('MetaCons "Version" 'PrefixI 'True) (((S1 ('MetaSel ('Just "version") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Just "services") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64)) :*: (S1 ('MetaSel ('Just "timestamp") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64) :*: S1 ('MetaSel ('Just "addrRecv") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NetworkAddress))) :*: ((S1 ('MetaSel ('Just "addrSend") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NetworkAddress) :*: S1 ('MetaSel ('Just "nonce") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64)) :*: (S1 ('MetaSel ('Just "userAgent") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 VarString) :*: (S1 ('MetaSel ('Just "startHeight") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Just "relay") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool)))))) | |||||
data MessageCommand Source #
A MessageCommand is included in a MessageHeader in order to identify
the type of message present in the payload. This allows the message
de-serialization code to know how to decode a particular message payload.
Every valid Message constructor has a corresponding MessageCommand
constructor.
Constructors
| MCVersion | |
| MCVerAck | |
| MCAddr | |
| MCInv | |
| MCGetData | |
| MCNotFound | |
| MCGetBlocks | |
| MCGetHeaders | |
| MCTx | |
| MCBlock | |
| MCMerkleBlock | |
| MCHeaders | |
| MCGetAddr | |
| MCFilterLoad | |
| MCFilterAdd | |
| MCFilterClear | |
| MCPing | |
| MCPong | |
| MCAlert | |
| MCMempool | |
| MCReject | |
| MCSendHeaders | |
| MCOther ByteString |
Instances
| IsString MessageCommand Source # | |||||
Defined in Haskoin.Network.Common Methods fromString :: String -> MessageCommand # | |||||
| Generic MessageCommand Source # | |||||
Defined in Haskoin.Network.Common Associated Types
Methods from :: MessageCommand -> Rep MessageCommand x # to :: Rep MessageCommand x -> MessageCommand # | |||||
| Read MessageCommand Source # | |||||
Defined in Haskoin.Network.Common Methods readsPrec :: Int -> ReadS MessageCommand # readList :: ReadS [MessageCommand] # | |||||
| Show MessageCommand Source # | |||||
Defined in Haskoin.Network.Common Methods showsPrec :: Int -> MessageCommand -> ShowS # show :: MessageCommand -> String # showList :: [MessageCommand] -> ShowS # | |||||
| Binary MessageCommand Source # | |||||
Defined in Haskoin.Network.Common Methods put :: MessageCommand -> Put # get :: Get MessageCommand # putList :: [MessageCommand] -> Put # | |||||
| Serial MessageCommand Source # | |||||
Defined in Haskoin.Network.Common Methods serialize :: MonadPut m => MessageCommand -> m () # deserialize :: MonadGet m => m MessageCommand # | |||||
| Serialize MessageCommand Source # | |||||
Defined in Haskoin.Network.Common | |||||
| NFData MessageCommand Source # | |||||
Defined in Haskoin.Network.Common Methods rnf :: MessageCommand -> () # | |||||
| Eq MessageCommand Source # | |||||
Defined in Haskoin.Network.Common Methods (==) :: MessageCommand -> MessageCommand -> Bool # (/=) :: MessageCommand -> MessageCommand -> Bool # | |||||
| type Rep MessageCommand Source # | |||||
Defined in Haskoin.Network.Common type Rep MessageCommand = D1 ('MetaData "MessageCommand" "Haskoin.Network.Common" "haskoin-core-1.2.2-IqsPTB3lyDG9ChtLlvwlSX" 'False) ((((C1 ('MetaCons "MCVersion" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MCVerAck" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "MCAddr" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MCInv" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MCGetData" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "MCNotFound" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MCGetBlocks" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MCGetHeaders" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "MCTx" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MCBlock" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MCMerkleBlock" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "MCHeaders" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MCGetAddr" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MCFilterLoad" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "MCFilterAdd" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MCFilterClear" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MCPing" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "MCPong" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MCAlert" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MCMempool" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "MCReject" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MCSendHeaders" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MCOther" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString))))))) | |||||
reject :: MessageCommand -> RejectCode -> ByteString -> Reject Source #
Convenience function to build a Reject message.
nodeNetwork :: Word64 Source #
Services indicate node is a full node that can serve full blocks.
nodeGetUTXO :: Word64 Source #
Services indicate node allows to request UTXO set.
nodeWitness :: Word64 Source #
Services indicate SegWit-capable node.
commandToString :: MessageCommand -> ByteString Source #
Convert a MessageCommand to its string representation.
stringToCommand :: ByteString -> MessageCommand Source #
Read a MessageCommand from its string representation.