test2.py 350 B

12345678910111213141516171819
  1. from node import Node
  2. def create_node(meta):
  3. node = Node(meta)
  4. node.run()
  5. if __name__ == "__main__":
  6. ip = "localhost"
  7. node_meta = {
  8. "id": '1',
  9. "addr": ("localhost", 10001),
  10. "peers": {
  11. '0': ("localhost", 10000),
  12. '2': ("localhost", 10002),
  13. },
  14. }
  15. create_node(node_meta)