Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
Message | |
|
Instances
data MessageBody #
Message body whose content depends on block type in the header.
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
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 display :: Peer -> Utf8Builder textDisplay :: Peer -> Text | |
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 toPersistValue :: Peer -> PersistValue fromPersistValue :: PersistValue -> Either Text Peer | |
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
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
BlockHashPairs | |
|
Instances
confirm_ack message
data ConfirmAckMessage #
Signed confirmation of a block or a list of block hashes
Instances
data ConfirmAckVoteBy #
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
mkVoteByHashes :: [BlockHash] -> Either String VoteByHashes #
Construct a valid VoteByHashes
(or return Left
if invalid)
bulk_pull message
data BulkPullMessage #
Bulk pull request
BulkPullMessage | |
|
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
.
Instances
frontier_req message
data FrontierReqMessage #
Request frontiers (account chain head blocks) from a remote node
Instances
node_id_handshake message
data NodeIdHandshakeMessage #
A node ID handshake request and/or response.
Instances
data NodeIdHandshakeResponse #
A node ID handshake response
NodeIdHandshakeResponse | |
|
Instances
Per-endpoint random number
Instances
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
Instances
data BulkPullAccountFlags #
Flags for pulp pull account request
BulkPullAccountFlagsPendingHashAndAmount | 0x00 |
BulkPullAccountFlagsPendingAddressOnly | 0x01 |
BulkPullAccountFlagsPendingHashAmountAndAddress | 0x02 |