| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Gini.Core.Protocol.Types.Message
Contents
Description
UDP Messages
Synopsis
- data Message = Message {}
- data MessageBody
- = MessageBodyKeepAlive !KeepAliveMessage
- | MessageBodyPublish !SignedBlock
- | MessageBodyConfirmReq !ConfirmReqMessage
- | MessageBodyConfirmAck !ConfirmAckMessage
- | MessageBodyBulkPull !BulkPullMessage
- | MessageBodyBulkPush !BulkPushMessage
- | MessageBodyFrontierReq !FrontierReqMessage
- | MessageBodyBulkPullBlocks
- | MessageBodyNodeIdHandshake !NodeIdHandshakeMessage
- | MessageBodyBulkPullAccount !BulkPullAccountMessage
- data NetworkId
- data KeepAliveMessage
- data Peer
- keepAliveMessagePeers :: KeepAliveMessage -> [Peer]
- mkKeepAliveMessage :: [Peer] -> Either String KeepAliveMessage
- maxKeepAliveMessagePeers :: Int
- mkPeer :: HostAddress6 -> PortNumber -> Either String Peer
- peerHost :: Peer -> HostAddress6
- peerPort :: Peer -> PortNumber
- data ConfirmReqMessage
- newtype BlockHashPairs = BlockHashPairs {
- unBlockHashPairs :: [(BlockHash, BlockHash)]
- data ConfirmAckMessage = ConfirmAckMessage {}
- data ConfirmAckVoteBy
- data VoteByHashes
- mkVoteByHashes :: [BlockHash] -> Either String VoteByHashes
- data BulkPullMessage = BulkPullMessage {}
- newtype BulkPushMessage = BulkPushMessage {}
- data FrontierReqMessage = FrontierReqMessage {}
- data NodeIdHandshakeMessage = NodeIdHandshakeMessage {}
- data NodeIdHandshakeResponse = NodeIdHandshakeResponse {}
- data Cookie
- cookieToByteString :: Cookie -> ByteString
- generateRandomCookie :: MonadRandom m => m Cookie
- data BulkPullAccountMessage = BulkPullAccountMessage {}
- data BulkPullAccountFlags
Message
Constructors
| Message | |
Fields
| |
Instances
data MessageBody #
Message body whose content depends on block type in the header.
Constructors
| MessageBodyKeepAlive !KeepAliveMessage | A list of 8 peers, some of which may be all-zero. |
| MessageBodyPublish !SignedBlock | Publish the given block |
| MessageBodyConfirmReq !ConfirmReqMessage | Requests confirmation of the given block or list of root/hash pairs |
| MessageBodyConfirmAck !ConfirmAckMessage | Signed confirmation of a block or a list of block hashes |
| MessageBodyBulkPull !BulkPullMessage | Bulk pull request. |
| MessageBodyBulkPush !BulkPushMessage | A bulk push is equivalent to an unsolicited bulk pull response. If a node knows about an account a peer doesn't, the node sends its local blocks for that account to the peer. The stream of blocks ends with a sentinel block of type enum_blocktype::not_a_block. |
| MessageBodyFrontierReq !FrontierReqMessage | Request frontiers (account chain head blocks) from a remote node |
| MessageBodyBulkPullBlocks | Deprecated. The server will respond with a single enum_blocktype::not_a_block byte. |
| MessageBodyNodeIdHandshake !NodeIdHandshakeMessage | A node ID handshake request and/or response. |
| MessageBodyBulkPullAccount !BulkPullAccountMessage | Bulk pull account request |
Instances
Network ID A, B or C for test, beta or live network respectively
Constructors
| NetworkIdTest | Network ID |
| NetworkIdBeta | Network ID |
| NetworkIdLive | Network ID |
Instances
keepalive message
data KeepAliveMessage #
A list of 8 peers, some of which may be all-zero.
Instances
A peer entry in the keepalive message
Instances
| Eq Peer # | |
| Ord Peer # | |
| Show Peer # | |
| Generic Peer # | |
| Display Peer # | |
Defined in Gini.Core.Protocol.Types.Message.Internal | |
| Validity Peer # | |
Defined in Gini.Core.Protocol.Types.Message.Internal | |
| Persist Peer # | |
Defined in Gini.Core.Protocol.Types.Message.Internal | |
| PersistField Peer # | |
Defined in Gini.Core.Protocol.Types.Message.Internal | |
| PersistFieldSql Peer # | |
Defined in Gini.Core.Protocol.Types.Message.Internal | |
| type Rep Peer # | |
Defined in Gini.Core.Protocol.Types.Message.Internal | |
keepAliveMessagePeers :: KeepAliveMessage -> [Peer] #
Access peers in keepalive message.
mkKeepAliveMessage :: [Peer] -> Either String KeepAliveMessage #
Construct a valid KeepAliveMessage (or return Left if invalid).
mkPeer :: HostAddress6 -> PortNumber -> Either String Peer #
Make a valid peer. The host and port must be non-zero.
peerHost :: Peer -> HostAddress6 #
ipv6 address, or ipv6-mapped ipv4 address.
peerPort :: Peer -> PortNumber #
confirm_req message
data ConfirmReqMessage #
Requests confirmation of the given block or list of root/hash pairs
Constructors
| ConfirmReqMessageByHash !BlockHashPairs | If _root.header.block_type == enum_blocktype::not_a_block |
| ConfirmReqMessageBlock !SignedBlock | If _root.header.block_type != enum_blocktype::not_a_block |
Instances
newtype BlockHashPairs #
A sequence of hash,root pairs
Constructors
| BlockHashPairs | |
Fields
| |
Instances
confirm_ack message
data ConfirmAckMessage #
Signed confirmation of a block or a list of block hashes
Constructors
| ConfirmAckMessage | |
Instances
data ConfirmAckVoteBy #
Constructors
| ConfirmAckVoteByHashes !VoteByHashes | If _root.header.block_type == enum_blocktype::not_a_block |
| ConfirmAckVoteByBlock !SignedBlock | If _root.header.block_type != enum_blocktype::not_a_block |
Instances
data VoteByHashes #
A sequence of up to 12 hashes, terminated by EOF.
Instances
| Eq VoteByHashes # | |
Defined in Gini.Core.Protocol.Types.Message.Internal | |
| Show VoteByHashes # | |
Defined in Gini.Core.Protocol.Types.Message.Internal Methods showsPrec :: Int -> VoteByHashes -> ShowS # show :: VoteByHashes -> String # showList :: [VoteByHashes] -> ShowS # | |
| Generic VoteByHashes # | |
Defined in Gini.Core.Protocol.Types.Message.Internal Associated Types type Rep VoteByHashes :: * -> * # | |
| Validity VoteByHashes # | |
Defined in Gini.Core.Protocol.Types.Message.Internal Methods validate :: VoteByHashes -> Validation | |
| Persist VoteByHashes # | |
Defined in Gini.Core.Protocol.Types.Message.Internal | |
| type Rep VoteByHashes # | |
Defined in Gini.Core.Protocol.Types.Message.Internal type Rep VoteByHashes = D1 (MetaData "VoteByHashes" "Gini.Core.Protocol.Types.Message.Internal" "gini-core-0.1.0.0-CYC9q60CJ5rDf5hHcbgY0V" True) (C1 (MetaCons "VoteByHashes" PrefixI True) (S1 (MetaSel (Just "unVoteByHashes") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [BlockHash]))) | |
mkVoteByHashes :: [BlockHash] -> Either String VoteByHashes #
Construct a valid VoteByHashes (or return Left if invalid)
bulk_pull message
data BulkPullMessage #
Bulk pull request
Constructors
| BulkPullMessage | |
Fields
| |
Instances
bulk_push message
newtype BulkPushMessage #
A bulk push is equivalent to an unsolicited bulk pull response.
| If a node knows about an account a peer doesn't, the node sends
| its local blocks for that account to the peer. The stream of
| blocks ends with a sentinel block of type BlockTypeNotABlock.
Constructors
| BulkPushMessage | |
Fields | |
Instances
frontier_req message
data FrontierReqMessage #
Request frontiers (account chain head blocks) from a remote node
Constructors
| FrontierReqMessage | |
Fields | |
Instances
node_id_handshake message
data NodeIdHandshakeMessage #
A node ID handshake request and/or response.
Constructors
| NodeIdHandshakeMessage | |
Instances
data NodeIdHandshakeResponse #
A node ID handshake response
Constructors
| NodeIdHandshakeResponse | |
Fields
| |
Instances
Per-endpoint random number
Instances
| Eq Cookie # | |
| Show Cookie # | |
| IsString Cookie # | |
Defined in Gini.Core.Protocol.Types.Message.Internal Methods fromString :: String -> Cookie # | |
| Generic Cookie # | |
| Display Cookie # | |
Defined in Gini.Core.Protocol.Types.Message.Internal | |
| Validity Cookie # | |
Defined in Gini.Core.Protocol.Types.Message.Internal | |
| Persist Cookie # | |
Defined in Gini.Core.Protocol.Types.Message.Internal | |
| PersistField Cookie # | |
Defined in Gini.Core.Protocol.Types.Message.Internal Methods toPersistValue :: Cookie -> PersistValue fromPersistValue :: PersistValue -> Either Text Cookie | |
| PersistFieldSql Cookie # | |
Defined in Gini.Core.Protocol.Types.Message.Internal | |
| type Rep Cookie # | |
Defined in Gini.Core.Protocol.Types.Message.Internal type Rep Cookie = D1 (MetaData "Cookie" "Gini.Core.Protocol.Types.Message.Internal" "gini-core-0.1.0.0-CYC9q60CJ5rDf5hHcbgY0V" True) (C1 (MetaCons "Cookie" PrefixI True) (S1 (MetaSel (Just "unCookie") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Raw32ByteValue))) | |
cookieToByteString :: Cookie -> ByteString #
Extract bytestring from cookie
generateRandomCookie :: MonadRandom m => m Cookie #
Generate a cryptographically random cookie value
bulk_pull_account message
data BulkPullAccountMessage #
Bulk pull account request
Constructors
| BulkPullAccountMessage | |
Instances
data BulkPullAccountFlags #
Flags for pulp pull account request
Constructors
| BulkPullAccountFlagsPendingHashAndAmount | 0x00 |
| BulkPullAccountFlagsPendingAddressOnly | 0x01 |
| BulkPullAccountFlagsPendingHashAmountAndAddress | 0x02 |
