-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode.py
More file actions
22 lines (17 loc) · 760 Bytes
/
Copy pathnode.py
File metadata and controls
22 lines (17 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# node.py - Main Entry Point
import argparse
from tui import NodeApp
def main():
"""
Parses command-line arguments and launches the Textual application.
"""
parser = argparse.ArgumentParser(description="Run a MeshMate node.")
parser.add_argument("--port", type=int, required=True, help="Port for this node to listen on.")
parser.add_argument("--peers", type=str, default="", help="Comma-separated list of peer ports to connect to.")
args = parser.parse_args()
peer_ports = [int(p) for p in args.peers.split(',') if p]
# Create an instance of our Textual app and run it
app = NodeApp(host="127.0.0.1", port=args.port, peers=peer_ports)
app.run()
if __name__ == "__main__":
main()