unaiverse 0.1.12__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. unaiverse/__init__.py +19 -0
  2. unaiverse/agent.py +2226 -0
  3. unaiverse/agent_basics.py +2389 -0
  4. unaiverse/clock.py +234 -0
  5. unaiverse/dataprops.py +1282 -0
  6. unaiverse/hsm.py +2471 -0
  7. unaiverse/modules/__init__.py +18 -0
  8. unaiverse/modules/cnu/__init__.py +17 -0
  9. unaiverse/modules/cnu/cnus.py +536 -0
  10. unaiverse/modules/cnu/layers.py +261 -0
  11. unaiverse/modules/cnu/psi.py +60 -0
  12. unaiverse/modules/hl/__init__.py +15 -0
  13. unaiverse/modules/hl/hl_utils.py +411 -0
  14. unaiverse/modules/networks.py +1509 -0
  15. unaiverse/modules/utils.py +748 -0
  16. unaiverse/networking/__init__.py +16 -0
  17. unaiverse/networking/node/__init__.py +18 -0
  18. unaiverse/networking/node/connpool.py +1332 -0
  19. unaiverse/networking/node/node.py +2752 -0
  20. unaiverse/networking/node/profile.py +446 -0
  21. unaiverse/networking/node/tokens.py +79 -0
  22. unaiverse/networking/p2p/__init__.py +188 -0
  23. unaiverse/networking/p2p/go.mod +127 -0
  24. unaiverse/networking/p2p/go.sum +548 -0
  25. unaiverse/networking/p2p/golibp2p.py +18 -0
  26. unaiverse/networking/p2p/golibp2p.pyi +136 -0
  27. unaiverse/networking/p2p/lib.go +2765 -0
  28. unaiverse/networking/p2p/lib_types.py +311 -0
  29. unaiverse/networking/p2p/message_pb2.py +50 -0
  30. unaiverse/networking/p2p/messages.py +360 -0
  31. unaiverse/networking/p2p/mylogger.py +78 -0
  32. unaiverse/networking/p2p/p2p.py +900 -0
  33. unaiverse/networking/p2p/proto-go/message.pb.go +846 -0
  34. unaiverse/stats.py +1506 -0
  35. unaiverse/streamlib/__init__.py +15 -0
  36. unaiverse/streamlib/streamlib.py +210 -0
  37. unaiverse/streams.py +804 -0
  38. unaiverse/utils/__init__.py +16 -0
  39. unaiverse/utils/lone_wolf.json +28 -0
  40. unaiverse/utils/misc.py +441 -0
  41. unaiverse/utils/sandbox.py +292 -0
  42. unaiverse/world.py +384 -0
  43. unaiverse-0.1.12.dist-info/METADATA +366 -0
  44. unaiverse-0.1.12.dist-info/RECORD +47 -0
  45. unaiverse-0.1.12.dist-info/WHEEL +5 -0
  46. unaiverse-0.1.12.dist-info/licenses/LICENSE +177 -0
  47. unaiverse-0.1.12.dist-info/top_level.txt +1 -0
@@ -0,0 +1,136 @@
1
+ from typing import List
2
+
3
+
4
+ class GoLibP2P:
5
+ def InitializeLibrary(self, max_instances: int, max_num_channels: int, max_queue_per_channel: int, max_msg_size: int, log_config: bytes) -> None:
6
+ """
7
+ InitializeLibrary(max_instances: int, max_queue_per_channel: int, max_num_channels: int, max_msg_size: int, enable_logging: int) -> bytes
8
+
9
+ Configures the P2P library.
10
+ """
11
+ ...
12
+
13
+ def CreateNode(self, instance: int, node_config_json: bytes) -> int:
14
+ """
15
+ CreateNode(instance: int, node_config_json: bytes) -> bytes
16
+
17
+ Creates a node in the P2P network and returns a JSON string with node information.
18
+ """
19
+ ...
20
+
21
+ def ConnectTo(self, instance: int, multiaddrs_json: bytes) -> int:
22
+ """
23
+ ConnectTo(instance: int, multiaddrs_json: bytes) -> bytes
24
+
25
+ Connects to a peer using the provided multiaddress. Returns a JSON string with the result.
26
+ """
27
+ ...
28
+
29
+ def StartStaticRelay(self, instance: int, relay_info_json: bytes) -> int:
30
+ """
31
+ EnableStaticRelay(instance: int, relay_info_json: bytes) -> bytes
32
+
33
+ Enables (or switches to) a static AutoRelay service for the given relay info.
34
+ Returns a JSON result.
35
+ """
36
+ ...
37
+
38
+ def DisconnectFrom(self, instance: int, peer_id: bytes) -> int:
39
+ """
40
+ DisconnectFrom(instance: int, peer_id: bytes) -> bytes
41
+
42
+ Disconnects from the given peer id. Returns a JSON result.
43
+ """
44
+ ...
45
+
46
+ def GetConnectedPeers(self, instance: int) -> int:
47
+ """
48
+ GetConnectedPeers(instance: int) -> bytes
49
+
50
+ Returns a JSON string listing connected peers.
51
+ """
52
+ ...
53
+
54
+ def GetRendezvousPeers(self, instance: int) -> int:
55
+ """
56
+ GetRendezvousPeers(instance: int) -> bytes
57
+
58
+ Returns a JSON string listing rendezvous peers.
59
+ """
60
+ ...
61
+
62
+ def GetNodeAddresses(self, instance: int, arg: bytes) -> int:
63
+ """
64
+ GetNodeAddresses(instance: int, arg: bytes) -> bytes
65
+
66
+ Returns the node addresses in a JSON string.
67
+ """
68
+ ...
69
+
70
+ def SendMessageToPeer(
71
+ self,
72
+ instance: int,
73
+ channel: bytes,
74
+ data: bytes,
75
+ data_len: int,
76
+ ) -> int:
77
+ """
78
+ SendMessageToPeer(instance: int, channel: bytes, data: bytes, data_len: int) -> bytes
79
+ """
80
+ ...
81
+
82
+ def SubscribeToTopic(self, instance: int, topic_composite_key: bytes) -> int:
83
+ """
84
+ SubscribeToTopic(instance: int, topic_composite_key: bytes) -> bytes
85
+
86
+ Subscribes to a topic and returns a JSON string with the result.
87
+ """
88
+ ...
89
+
90
+ def UnsubscribeFromTopic(self, instance: int, topic_composite_key: bytes) -> int:
91
+ """
92
+ UnsubscribeFromTopic(instance: int, topic_composite_key: bytes) -> bytes
93
+
94
+ Unsubscribe from a topic and returns a JSON string with the result.
95
+ """
96
+ ...
97
+
98
+ def MessageQueueLength(self, instance: int) -> int:
99
+ """
100
+ MessageQueueLength(instance: int) -> int
101
+
102
+ Returns the current length of the message queue.
103
+ """
104
+ ...
105
+
106
+ def PopMessages(self, instance: int) -> int:
107
+ """
108
+ PopNMessages(instance: int) -> bytes
109
+
110
+ Pops the first message in each channel queue and returns them as a list.
111
+ """
112
+ ...
113
+
114
+ def CloseNode(self, instance: int) -> int:
115
+ """
116
+ CloseNode(instance: int) -> bytes
117
+
118
+ Closes the node and frees all resources.
119
+ """
120
+ ...
121
+
122
+ def FreeString(self, arg: bytes) -> None:
123
+ """
124
+ FreeString(arg: bytes) -> None
125
+
126
+ Frees a string previously allocated by the shared library.
127
+ """
128
+ ...
129
+
130
+ def FreeInt(self, arg: int) -> None:
131
+ """
132
+ FreeInt(arg: int) -> None
133
+
134
+ Frees an integer previously allocated by the shared library.
135
+ """
136
+ ...