pybitmessage.protocol module¶
Low-level protocol-related functions.
-
assembleErrorMessage
(fatal=0, banTime=0, inventoryVector='', errorText='')[source]¶ Construct the payload of an error message, return the resultng bytes of running CreatePacket() on it
-
assembleVersionMessage
(remoteHost, remotePort, participatingStreams, server=False, nodeid=None)[source]¶ Construct the payload of a version message, return the resultng bytes of running CreatePacket() on it
-
checkIPAddress
(host, private=False)[source]¶ Returns hostStandardFormat if it is a valid IP address, otherwise returns False
-
checkIPv4Address
(host, hostStandardFormat, private=False)[source]¶ Returns hostStandardFormat if it is an IPv4 address, otherwise returns False
-
checkIPv6Address
(host, hostStandardFormat, private=False)[source]¶ Returns hostStandardFormat if it is an IPv6 address, otherwise returns False
-
decryptAndCheckPubkeyPayload
(data, address)[source]¶ Version 4 pubkeys are encrypted. This function is run when we already have the address to which we want to try to send a message. The ‘data’ may come either off of the wire or we might have had it already in our inventory when we tried to send a msg to this particular address.
-
haveSSL
(server=False)[source]¶ Predicate to check if ECDSA server support is required and available
python < 2.7.9’s ssl library does not support ECDSA server due to missing initialisation of available curves, but client works ok
-
isProofOfWorkSufficient
(data, nonceTrialsPerByte=0, payloadLengthExtraBytes=0, recvTime=0)[source]¶ Validate an object’s Proof of Work using method described in: https://bitmessage.org/wiki/Proof_of_work
Parameters: Returns: True if PoW valid and sufficient, False in all other cases