-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
31 lines (25 loc) · 903 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import os
import sys
from networking.zmq_handler.zmq_sub import ZMQHandler
from networking.zmq_handler.zmq_handlers import PrintHandler, WriteToFileHandler, MultiHandler, RebidHandler
# Get the directory of the current script
current_dir = os.path.dirname(os.path.abspath(__file__))
# Default file name
default_file_name = "data/mempool_drop.txt"
# Check if a different path was provided as an argument
if len(sys.argv) > 1:
dump_file_path = sys.argv[1]
else:
dump_file_path = os.path.join(current_dir, default_file_name)
if __name__ == '__main__':
#message_handler = MultiHandler([
# PrintHandler(),
# WriteToFileHandler(dump_file_path)
#])
message_handler = RebidHandler(current_dir)
print("Starting ZMQHandler")
zmqHandler = ZMQHandler(
message_handler=message_handler,
sub_topic=["rawtx","hashblock"]
)
zmqHandler.start()