naeural-client 2.7.9__py3-none-any.whl → 2.7.11__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.
- naeural_client/_ver.py +1 -1
- naeural_client/base/generic_session.py +34 -2
- naeural_client/cli/nodes.py +35 -16
- naeural_client/const/evm_net.py +3 -3
- naeural_client/utils/config.py +12 -12
- {naeural_client-2.7.9.dist-info → naeural_client-2.7.11.dist-info}/METADATA +1 -1
- {naeural_client-2.7.9.dist-info → naeural_client-2.7.11.dist-info}/RECORD +10 -10
- {naeural_client-2.7.9.dist-info → naeural_client-2.7.11.dist-info}/WHEEL +0 -0
- {naeural_client-2.7.9.dist-info → naeural_client-2.7.11.dist-info}/entry_points.txt +0 -0
- {naeural_client-2.7.9.dist-info → naeural_client-2.7.11.dist-info}/licenses/LICENSE +0 -0
naeural_client/_ver.py
CHANGED
@@ -1063,6 +1063,37 @@ class GenericSession(BaseDecentrAIObject):
|
|
1063
1063
|
|
1064
1064
|
return
|
1065
1065
|
|
1066
|
+
|
1067
|
+
def close_pipeline(self, node_addr : str, pipeline_name : str):
|
1068
|
+
"""
|
1069
|
+
Close a pipeline created by this session.
|
1070
|
+
|
1071
|
+
Parameters
|
1072
|
+
----------
|
1073
|
+
node_addr : str
|
1074
|
+
The address of the edge node that owns the pipeline.
|
1075
|
+
|
1076
|
+
pipeline_name : str
|
1077
|
+
The name of the pipeline to close.
|
1078
|
+
"""
|
1079
|
+
pipeline : Pipeline = self._dct_online_nodes_pipelines.get(node_addr, {}).get(pipeline_name, None)
|
1080
|
+
if pipeline is not None:
|
1081
|
+
self.P(
|
1082
|
+
f"Closing known pipeline <{pipeline_name}> from <{node_addr}>",
|
1083
|
+
color='y'
|
1084
|
+
)
|
1085
|
+
pipeline.close()
|
1086
|
+
else:
|
1087
|
+
self.P(
|
1088
|
+
"No known pipeline found. Sending close to <{}> for <{}>".format(
|
1089
|
+
node_addr, pipeline_name
|
1090
|
+
),
|
1091
|
+
color='y'
|
1092
|
+
)
|
1093
|
+
self._send_command_archive_pipeline(node_addr, pipeline_name)
|
1094
|
+
return
|
1095
|
+
|
1096
|
+
|
1066
1097
|
def _connect(self) -> None:
|
1067
1098
|
"""
|
1068
1099
|
Connect to the communication server using the credentials provided when creating this instance.
|
@@ -1504,11 +1535,12 @@ class GenericSession(BaseDecentrAIObject):
|
|
1504
1535
|
----------
|
1505
1536
|
command : str
|
1506
1537
|
The command to send.
|
1538
|
+
|
1507
1539
|
worker : str
|
1508
1540
|
The name of the Naeural Edge Protocol edge node that will receive the command.
|
1509
1541
|
|
1510
|
-
Observation: this approach will be deprecated soon in favor of the direct use of
|
1511
|
-
will not require the node to be already "
|
1542
|
+
Observation: this approach will be deprecated soon in favor of the direct use of
|
1543
|
+
the address that will not require the node to be already "seen" by the session.
|
1512
1544
|
|
1513
1545
|
payload : dict
|
1514
1546
|
The payload to send.
|
naeural_client/cli/nodes.py
CHANGED
@@ -12,11 +12,19 @@ def _get_netstats(
|
|
12
12
|
supervisors_only=False,
|
13
13
|
return_session=False,
|
14
14
|
eth=False,
|
15
|
-
all_info=False
|
15
|
+
all_info=False,
|
16
|
+
wait_for_node=None
|
16
17
|
):
|
17
18
|
t1 = time()
|
18
19
|
from naeural_client import Session
|
19
20
|
sess = Session(silent=silent)
|
21
|
+
found = None
|
22
|
+
if wait_for_node:
|
23
|
+
sess.P("Waiting for node '{}' to appear...".format(wait_for_node), color='y')
|
24
|
+
found = sess.wait_for_node(wait_for_node, timeout=30)
|
25
|
+
if not found:
|
26
|
+
sess.P("Node '{}' not found.".format(wait_for_node), color='r')
|
27
|
+
|
20
28
|
dct_info = sess.get_network_known_nodes(
|
21
29
|
online_only=online_only, allowed_only=allowed_only, supervisor=supervisor,
|
22
30
|
supervisors_only=supervisors_only,
|
@@ -95,14 +103,17 @@ def get_supervisors(args):
|
|
95
103
|
log_with_color(f"{df}")
|
96
104
|
return
|
97
105
|
|
98
|
-
def _send_command_to_node(args, command):
|
106
|
+
def _send_command_to_node(args, command, ignore_not_found=False):
|
99
107
|
node = args.node
|
100
108
|
silent = not args.verbose
|
109
|
+
|
101
110
|
|
102
111
|
t1 = time()
|
103
112
|
df, _, _, _, _, sess = _get_netstats(
|
104
|
-
silent=silent, online_only=True, return_session=True
|
113
|
+
silent=silent, online_only=True, return_session=True,
|
114
|
+
wait_for_node=node
|
105
115
|
)
|
116
|
+
|
106
117
|
peered = None
|
107
118
|
selection = df.Alias == node
|
108
119
|
found = selection.any()
|
@@ -113,20 +124,28 @@ def _send_command_to_node(args, command):
|
|
113
124
|
node_addr = df_found.Address.values[0]
|
114
125
|
log_with_color(f"{df_found}")
|
115
126
|
if not found:
|
116
|
-
log_with_color(
|
117
|
-
|
127
|
+
log_with_color("Node '{}' <{}> not found in network (toal {} nodes, {} peered).".format(
|
128
|
+
node, node_addr, df.shape[0], df.Peered.sum()), color='r'
|
129
|
+
)
|
130
|
+
|
118
131
|
if not peered:
|
119
|
-
|
120
|
-
|
132
|
+
if found:
|
133
|
+
log_with_color(f"Node '{node}' <{node_addr}> is not peered.", color='r')
|
134
|
+
else:
|
135
|
+
log_with_color(f"Node '{node}' <{node_addr}> may not accept this command.", color='r')
|
136
|
+
|
121
137
|
# TODO: currently this is based on node alias, but we should be based on node address
|
122
138
|
# and maybe even node alias
|
123
|
-
if
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
139
|
+
if (found and peered) or ignore_not_found:
|
140
|
+
if ignore_not_found:
|
141
|
+
log_with_color(f"Sending blind '{command}' to node <{node}>", color='b')
|
142
|
+
if command == COMMANDS.RESTART:
|
143
|
+
sess._send_command_restart_node(node)
|
144
|
+
elif command == COMMANDS.STOP:
|
145
|
+
sess._send_command_stop_node(node)
|
146
|
+
else:
|
147
|
+
log_with_color(f"Command '{command}' not supported.", color='r')
|
148
|
+
return
|
130
149
|
elapsed = time() - t1
|
131
150
|
return
|
132
151
|
|
@@ -141,7 +160,7 @@ def restart_node(args):
|
|
141
160
|
"""
|
142
161
|
node = args.node
|
143
162
|
log_with_color(f"Attempting to restart node <{node}>", color='b')
|
144
|
-
_send_command_to_node(args, COMMANDS.RESTART)
|
163
|
+
_send_command_to_node(args, COMMANDS.RESTART, ignore_not_found=True)
|
145
164
|
return
|
146
165
|
|
147
166
|
|
@@ -156,6 +175,6 @@ def shutdown_node(args):
|
|
156
175
|
"""
|
157
176
|
node = args.node
|
158
177
|
log_with_color(f"Attempting to shutdown node <{node}>", color='b')
|
159
|
-
_send_command_to_node(args, COMMANDS.
|
178
|
+
_send_command_to_node(args, COMMANDS.STOP, ignore_not_found=True)
|
160
179
|
return
|
161
180
|
|
naeural_client/const/evm_net.py
CHANGED
@@ -33,10 +33,10 @@ EVM_NET_DATA = {
|
|
33
33
|
|
34
34
|
'devnet' : {
|
35
35
|
EvmNetData.DAUTH_URL_KEY : "https://dauth-devnet.ratio1.ai/get_auth_data",
|
36
|
-
EvmNetData.DAUTH_ND_ADDR_KEY : "
|
36
|
+
EvmNetData.DAUTH_ND_ADDR_KEY : "TO_BE_DEFINED",
|
37
37
|
EvmNetData.DAUTH_RPC_KEY : "https://base-sepolia.public.blastapi.io",
|
38
|
-
EvmNetData.EE_GENESIS_EPOCH_DATE_KEY : "2025-
|
39
|
-
EvmNetData.EE_EPOCH_INTERVALS_KEY :
|
38
|
+
EvmNetData.EE_GENESIS_EPOCH_DATE_KEY : "2025-01-11 16:00:00",
|
39
|
+
EvmNetData.EE_EPOCH_INTERVALS_KEY : 1,
|
40
40
|
EvmNetData.EE_EPOCH_INTERVAL_SECONDS_KEY : 3600,
|
41
41
|
EvmNetData.EE_SUPERVISOR_MIN_AVAIL_PRC_KEY : 0.6,
|
42
42
|
},
|
naeural_client/utils/config.py
CHANGED
@@ -179,18 +179,19 @@ def show_address(args):
|
|
179
179
|
log_with_color(f"{sess.get_client_address()}", color='b')
|
180
180
|
return
|
181
181
|
|
182
|
-
def show_version():
|
182
|
+
def show_version(silent=True):
|
183
183
|
from naeural_client import Session
|
184
184
|
sess = Session(
|
185
|
-
silent=
|
185
|
+
silent=silent
|
186
186
|
)
|
187
187
|
|
188
188
|
user_folder = get_user_folder()
|
189
189
|
|
190
|
-
log_with_color(f"
|
191
|
-
log_with_color(f"SDK
|
192
|
-
log_with_color(f"
|
193
|
-
log_with_color(f"SDK
|
190
|
+
log_with_color(f"SDK folder: {user_folder}", color='b')
|
191
|
+
log_with_color(f"SDK version: {version}", color='b')
|
192
|
+
log_with_color(f"Ratio1 network: {get_network()}", color='b')
|
193
|
+
log_with_color(f"SDK addr: {sess.get_client_address()}", color='b')
|
194
|
+
log_with_color(f"SDK ETH addr: {sess.bc_engine.eth_address}", color='b')
|
194
195
|
return
|
195
196
|
|
196
197
|
|
@@ -198,17 +199,16 @@ def show_config(args):
|
|
198
199
|
"""
|
199
200
|
Displays the current configuration from ~/.naeural/config.
|
200
201
|
"""
|
201
|
-
show_version()
|
202
|
+
show_version(silent=not args.verbose)
|
202
203
|
config_file = get_user_config_file()
|
203
204
|
if config_file.exists():
|
205
|
+
keys = []
|
204
206
|
with config_file.open("r") as file:
|
205
|
-
|
207
|
+
lines = file.readlines()
|
208
|
+
keys = [line.strip().split("=")[0] for line in lines if "=" in line]
|
209
|
+
log_with_color(f"Current config {config_file} has {len(keys)} keys: {keys}", color='d')
|
206
210
|
else:
|
207
211
|
log_with_color(f"No configuration found at {config_file}. Please run `reset_config` first.", color="r")
|
208
|
-
log_with_color("Current environment variables:", color='b')
|
209
|
-
for k in os.environ:
|
210
|
-
if k.startswith("EE_"):
|
211
|
-
log_with_color(f"{k}={os.environ[k]}", color='b')
|
212
212
|
return
|
213
213
|
|
214
214
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: naeural_client
|
3
|
-
Version: 2.7.
|
3
|
+
Version: 2.7.11
|
4
4
|
Summary: `naeural_client` is the Python SDK required for client app development for the Naeural Edge Protocol Edge Protocol framework
|
5
5
|
Project-URL: Homepage, https://github.com/NaeuralEdgeProtocol/naeural_client
|
6
6
|
Project-URL: Bug Tracker, https://github.com/NaeuralEdgeProtocol/naeural_client/issues
|
@@ -1,10 +1,10 @@
|
|
1
1
|
naeural_client/__init__.py,sha256=YimqgDbjLuywsf8zCWE0EaUXH4MBUrqLxt0TDV558hQ,632
|
2
|
-
naeural_client/_ver.py,sha256=
|
2
|
+
naeural_client/_ver.py,sha256=9fH_GG66dJFC2t8_1TezUY50f0vo3VcJj683fVJXRZg,331
|
3
3
|
naeural_client/base_decentra_object.py,sha256=C4iwZTkhKNBS4VHlJs5DfElRYLo4Q9l1V1DNVSk1fyQ,4412
|
4
4
|
naeural_client/plugins_manager_mixin.py,sha256=X1JdGLDz0gN1rPnTN_5mJXR8JmqoBFQISJXmPR9yvCo,11106
|
5
5
|
naeural_client/base/__init__.py,sha256=hACh83_cIv7-PwYMM3bQm2IBmNqiHw-3PAfDfAEKz9A,259
|
6
6
|
naeural_client/base/distributed_custom_code_presets.py,sha256=cvz5R88P6Z5V61Ce1vHVVh8bOkgXd6gve_vdESDNAsg,2544
|
7
|
-
naeural_client/base/generic_session.py,sha256=
|
7
|
+
naeural_client/base/generic_session.py,sha256=9NpJKlN7SSYvcroIgigjs9VbJUTTF-nxemHdRVighrM,110720
|
8
8
|
naeural_client/base/instance.py,sha256=kcZJmjLBtx8Bjj_ysIOx1JmLA-qSpG7E28j5rq6IYus,20444
|
9
9
|
naeural_client/base/pipeline.py,sha256=SNl0QLJTbaP_mlwVm1p9Vwxo72Q1Bp2ls3rt1WGPg7c,58828
|
10
10
|
naeural_client/base/plugin_template.py,sha256=7YAFaND2iXoZLgtunjYkFf_TBGieFr3VdNLO3vCqzmM,138795
|
@@ -23,7 +23,7 @@ naeural_client/certs/s624dbd4.ala.us-east-1.emqxsl.com.crt,sha256=y-6io0tseyx9-a
|
|
23
23
|
naeural_client/cli/README.md,sha256=WPdI_EjzAbUW1aPyj1sSR8rLydcJKZtoiaEtklQrjHo,74
|
24
24
|
naeural_client/cli/cli.py,sha256=EC7-ehOMQJ_Dq7R9TTrajpvQWwdalAOgb1JAeBGHF50,3830
|
25
25
|
naeural_client/cli/cli_commands.py,sha256=dW7br6XaejTfOaTZZeU8xDbFgg4qZPYGoRJqz_Afsno,3195
|
26
|
-
naeural_client/cli/nodes.py,sha256=
|
26
|
+
naeural_client/cli/nodes.py,sha256=53-Ht42Xiq3rJEVA2ErZHLLC9OUjh6-rNGrc2RA-U8o,5733
|
27
27
|
naeural_client/cli/oracles.py,sha256=Y_PzHshfSERS_Utjjtw5d_BsQRdGr6P4L6uW8yTdA0M,4809
|
28
28
|
naeural_client/code_cheker/__init__.py,sha256=pwkdeZGVL16ZA4Qf2mRahEhoOvKhL7FyuQbMFLr1E5M,33
|
29
29
|
naeural_client/code_cheker/base.py,sha256=lT5DRIFO5rqzsMNCmdMRfkAeevmezozehyfgmhnKpuI,19074
|
@@ -37,7 +37,7 @@ naeural_client/const/apps.py,sha256=ePBiJXLuPfFOKuw-LJrT9OWbaodU7QApfDurIPNDoB4,
|
|
37
37
|
naeural_client/const/base.py,sha256=uq1HrxBsrFFiMP0yL0TcDANuxiSPafSx1Yh5ZyxRubE,5633
|
38
38
|
naeural_client/const/comms.py,sha256=La6JXWHexH8CfcBCKyT4fCIoeaoZlcm7KtZ57ab4ZgU,2201
|
39
39
|
naeural_client/const/environment.py,sha256=RpdDhDgB8NgRoFTk28eODigf9y0WcT9lul6mBOD029w,879
|
40
|
-
naeural_client/const/evm_net.py,sha256=
|
40
|
+
naeural_client/const/evm_net.py,sha256=CGzHXRtqfhWow6AQbyaj6kFjtIIfLgNrCg4GnBMti3A,2568
|
41
41
|
naeural_client/const/formatter.py,sha256=AW3bWlqf39uaqV4BBUuW95qKYfF2OkkU4f9hy3kSVhM,200
|
42
42
|
naeural_client/const/heartbeat.py,sha256=xHZBX_NzHTklwA2_AEKR0SGdlbavMT4nirqjQg8WlTU,2550
|
43
43
|
naeural_client/const/misc.py,sha256=VDCwwpf5bl9ltx9rzT2WPVP8B3mZFRufU1tSS5MO240,413
|
@@ -82,11 +82,11 @@ naeural_client/logging/tzlocal/win32.py,sha256=zBoj0vFVrGhnCm_f7xmYzGym4-fV-4Ij2
|
|
82
82
|
naeural_client/logging/tzlocal/windows_tz.py,sha256=Sv9okktjZJfRGGUOOppsvQuX_eXyXUxkSKCAFmWT9Hw,34203
|
83
83
|
naeural_client/utils/__init__.py,sha256=mAnke3-MeRzz3nhQvhuHqLnpaaCSmDxicd7Ck9uwpmI,77
|
84
84
|
naeural_client/utils/comm_utils.py,sha256=4cS9llRr_pK_3rNgDcRMCQwYPO0kcNU7AdWy_LtMyCY,1072
|
85
|
-
naeural_client/utils/config.py,sha256=
|
85
|
+
naeural_client/utils/config.py,sha256=XX3CxzA7resB33hodyNAcj6AyKiLF94NwnY3rqCVTPw,7473
|
86
86
|
naeural_client/utils/dotenv.py,sha256=_AgSo35n7EnQv5yDyu7C7i0kHragLJoCGydHjvOkrYY,2008
|
87
87
|
naeural_client/utils/oracle_sync/oracle_tester.py,sha256=GmZwu2JM9_UB2K-4rKB3o0RgWLqM-7Im6HwBnQLXmHI,25312
|
88
|
-
naeural_client-2.7.
|
89
|
-
naeural_client-2.7.
|
90
|
-
naeural_client-2.7.
|
91
|
-
naeural_client-2.7.
|
92
|
-
naeural_client-2.7.
|
88
|
+
naeural_client-2.7.11.dist-info/METADATA,sha256=qyrVvcuLJ1ySRP8UMezroxvuPNofli9mMWj6RUsuAGs,12354
|
89
|
+
naeural_client-2.7.11.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
90
|
+
naeural_client-2.7.11.dist-info/entry_points.txt,sha256=CTua17GUrRa4aXeafezGC9TiWKGKQzwTjQmB2jyj22g,91
|
91
|
+
naeural_client-2.7.11.dist-info/licenses/LICENSE,sha256=cvOsJVslde4oIaTCadabXnPqZmzcBO2f2zwXZRmJEbE,11311
|
92
|
+
naeural_client-2.7.11.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|