Remove 0MQ Python client

This commit is contained in:
Roman Zeyde 2018-05-23 22:50:31 +03:00
parent 77573fdd19
commit 4cebd1e25f
No known key found for this signature in database
GPG key ID: 87CAE5FA46917CBB

View file

@ -1,19 +0,0 @@
import struct
import zmq
def main():
ctx = zmq.Context()
sub = ctx.socket(zmq.SUB)
sub.setsockopt_string(zmq.SUBSCRIBE, 'hashblock')
sub.setsockopt_string(zmq.SUBSCRIBE, 'hashtx')
sub.connect('tcp://localhost:28332')
while True:
topic, msg, count = sub.recv_multipart()
topic = topic.decode('ascii')
count, = struct.unpack('<L', count)
msg = msg.hex()
print('{} {}: {}'.format(topic, msg, count))
if __name__ == '__main__':
main()