Sha256: 5cc685488da02dbc99c98931205fec4643ca2334f8e3b4ed4e65d67d4b331e23
Contents?: true
Size: 513 Bytes
Versions: 10
Compression:
Stored size: 513 Bytes
Contents
module Tapyrus module Message # ping message class # https://bitcoin.org/en/developer-reference#ping class Ping < Base COMMAND = 'ping' attr_accessor :nonce def initialize(nonce = SecureRandom.random_number(0xffffffff)) @nonce = nonce end def self.parse_from_payload(payload) new(payload.unpack('Q').first) end def to_payload [nonce].pack('Q') end def to_response Pong.new(nonce) end end end end
Version data entries
10 entries across 10 versions & 1 rubygems