ratio1 3.4.104__py3-none-any.whl → 3.4.106__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.
- ratio1/_ver.py +1 -1
- ratio1/cli/cli_commands.py +1 -0
- ratio1/cli/oracles.py +89 -35
- {ratio1-3.4.104.dist-info → ratio1-3.4.106.dist-info}/METADATA +1 -1
- {ratio1-3.4.104.dist-info → ratio1-3.4.106.dist-info}/RECORD +8 -8
- {ratio1-3.4.104.dist-info → ratio1-3.4.106.dist-info}/WHEEL +0 -0
- {ratio1-3.4.104.dist-info → ratio1-3.4.106.dist-info}/entry_points.txt +0 -0
- {ratio1-3.4.104.dist-info → ratio1-3.4.106.dist-info}/licenses/LICENSE +0 -0
ratio1/_ver.py
CHANGED
ratio1/cli/cli_commands.py
CHANGED
|
@@ -148,6 +148,7 @@ CLI_COMMANDS = {
|
|
|
148
148
|
"params": {
|
|
149
149
|
"--skip-seeds": "Skip the seed nodes in the rollout (flag)",
|
|
150
150
|
"--skip-oracles": "Skip the oracle nodes in the rollout (flag)",
|
|
151
|
+
"--skip-workers": "Skip the remaining edge worker nodes in the rollout (flag)",
|
|
151
152
|
"--no-timeout": "Do not wait between nodes restarts (flag)",
|
|
152
153
|
}
|
|
153
154
|
},
|
ratio1/cli/oracles.py
CHANGED
|
@@ -221,7 +221,36 @@ if True:
|
|
|
221
221
|
silent = not args.verbose
|
|
222
222
|
skip_seeds = args.skip_seeds
|
|
223
223
|
skip_oracles = args.skip_oracles
|
|
224
|
+
skip_workers = getattr(args, "skip_workers", False)
|
|
224
225
|
no_timeout = args.no_timeout
|
|
226
|
+
run_seed_nodes = not skip_seeds
|
|
227
|
+
run_oracle_nodes = not skip_oracles
|
|
228
|
+
run_edge_nodes = not skip_workers
|
|
229
|
+
|
|
230
|
+
# Adjust these values to tweak pauses and restart pacing across node groups.
|
|
231
|
+
pause_after_seed_seconds = 60
|
|
232
|
+
pause_after_oracle_seconds = 60
|
|
233
|
+
worker_timeout_min_seconds = 5
|
|
234
|
+
worker_timeout_max_seconds = 25
|
|
235
|
+
|
|
236
|
+
restart_groups = []
|
|
237
|
+
if run_seed_nodes:
|
|
238
|
+
restart_groups.append("Seed Nodes")
|
|
239
|
+
if run_oracle_nodes:
|
|
240
|
+
restart_groups.append("Oracle Nodes")
|
|
241
|
+
if run_edge_nodes:
|
|
242
|
+
restart_groups.append("Worker Edge Nodes")
|
|
243
|
+
skipped_groups = []
|
|
244
|
+
if not run_seed_nodes:
|
|
245
|
+
skipped_groups.append("Seed Nodes")
|
|
246
|
+
if not run_oracle_nodes:
|
|
247
|
+
skipped_groups.append("Oracle Nodes")
|
|
248
|
+
if not run_edge_nodes:
|
|
249
|
+
skipped_groups.append("Worker Edge Nodes")
|
|
250
|
+
|
|
251
|
+
if not restart_groups:
|
|
252
|
+
log_with_color("All node groups were skipped; nothing to restart.", color='y')
|
|
253
|
+
return
|
|
225
254
|
|
|
226
255
|
log_with_color("======================================================", color='b')
|
|
227
256
|
log_with_color("Starting Oracle Rollout...", color='g')
|
|
@@ -232,15 +261,24 @@ if True:
|
|
|
232
261
|
current_network = session.bc_engine.current_evm_network
|
|
233
262
|
session.close()
|
|
234
263
|
|
|
264
|
+
restart_plan_display = " -> ".join(restart_groups)
|
|
265
|
+
confirmation_keyword = "RESTART ALL" if len(restart_groups) == 3 else f"RESTART {', '.join(restart_groups)}"
|
|
266
|
+
confirmation_phrase = f"{confirmation_keyword} on {current_network}"
|
|
267
|
+
|
|
235
268
|
log_with_color(f"ATTENTION! Current network: {current_network}", color='y')
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
269
|
+
if len(restart_groups) == 3:
|
|
270
|
+
log_with_color(f"Are you sure you want to restart ALL node groups on the network {current_network}?", color='b')
|
|
271
|
+
else:
|
|
272
|
+
log_with_color(
|
|
273
|
+
f"Are you sure you want to restart the following node groups on {current_network}: {restart_plan_display}?",
|
|
274
|
+
color='b'
|
|
275
|
+
)
|
|
276
|
+
log_with_color(f"Planned restart sequence: {restart_plan_display}", color='b')
|
|
277
|
+
if skipped_groups:
|
|
278
|
+
log_with_color(f"Explicitly skipped groups: {', '.join(skipped_groups)}", color='y')
|
|
279
|
+
user_confirmation = input(f"Write down '{confirmation_phrase}' in order to proceed...\n >")
|
|
280
|
+
|
|
281
|
+
if user_confirmation != confirmation_phrase:
|
|
244
282
|
log_with_color("Aborted by user...", color='y')
|
|
245
283
|
return
|
|
246
284
|
|
|
@@ -257,17 +295,28 @@ if True:
|
|
|
257
295
|
if node['address'] not in seed_nodes_addresses
|
|
258
296
|
]
|
|
259
297
|
|
|
260
|
-
|
|
298
|
+
restarted_seed_nodes_count = 0
|
|
299
|
+
restarted_oracle_nodes_count = 0
|
|
300
|
+
restarted_edge_nodes_count = 0
|
|
301
|
+
|
|
302
|
+
if run_seed_nodes:
|
|
261
303
|
# 1. Send restart command to Seed Nodes.
|
|
262
304
|
log_with_color(f"Sending restart commands to {len(seed_nodes_addresses)} seed nodes: {seed_nodes_addresses}",
|
|
263
305
|
color='b')
|
|
264
306
|
_send_restart_command(session=session, nodes=seed_nodes_addresses)
|
|
307
|
+
restarted_seed_nodes_count = len(seed_nodes_addresses)
|
|
265
308
|
|
|
266
309
|
# Remove seed node addresses from all_nodes_addresses
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
310
|
+
if run_oracle_nodes or run_edge_nodes:
|
|
311
|
+
if pause_after_seed_seconds > 0:
|
|
312
|
+
log_with_color(
|
|
313
|
+
f"Seed nodes restarted. Waiting {pause_after_seed_seconds} seconds before sending restart commands to the next group of nodes.",
|
|
314
|
+
color='g')
|
|
315
|
+
sleep(pause_after_seed_seconds)
|
|
316
|
+
else:
|
|
317
|
+
log_with_color(
|
|
318
|
+
"Seed nodes restarted. Continuing without wait before the next group of nodes.",
|
|
319
|
+
color='g')
|
|
271
320
|
else:
|
|
272
321
|
log_with_color("Skipping Seed Nodes restart as per user request.", color='y')
|
|
273
322
|
|
|
@@ -278,12 +327,23 @@ if True:
|
|
|
278
327
|
if node['oracle'] == True
|
|
279
328
|
]
|
|
280
329
|
|
|
281
|
-
if
|
|
330
|
+
if run_oracle_nodes:
|
|
282
331
|
log_with_color(
|
|
283
332
|
f"Sending restart commands to {len(oracle_nodes_addresses)} Non-Seed Oracle nodes, except seed nodes: {remaining_nodes}",
|
|
284
333
|
color='b')
|
|
285
334
|
|
|
286
335
|
_send_restart_command(session=session, nodes=oracle_nodes_addresses)
|
|
336
|
+
restarted_oracle_nodes_count = len(oracle_nodes_addresses)
|
|
337
|
+
if run_edge_nodes:
|
|
338
|
+
if pause_after_oracle_seconds > 0:
|
|
339
|
+
log_with_color(
|
|
340
|
+
f"Oracle nodes restarted. Waiting {pause_after_oracle_seconds} seconds before sending restart commands to remaining edge nodes.",
|
|
341
|
+
color='g')
|
|
342
|
+
sleep(pause_after_oracle_seconds)
|
|
343
|
+
else:
|
|
344
|
+
log_with_color(
|
|
345
|
+
"Oracle nodes restarted. Continuing without wait before remaining edge nodes.",
|
|
346
|
+
color='g')
|
|
287
347
|
else:
|
|
288
348
|
log_with_color("Skipping Oracle Nodes restart as per user request.", color='y')
|
|
289
349
|
|
|
@@ -294,29 +354,23 @@ if True:
|
|
|
294
354
|
if node['address'] not in oracle_nodes_addresses
|
|
295
355
|
]
|
|
296
356
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
color='
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
357
|
+
if run_edge_nodes:
|
|
358
|
+
# 3. Send restart command to all remaining edge nodes.
|
|
359
|
+
log_with_color(f"Sending restart commands to {len(remaining_nodes_addresses)} remaining edge nodes: {remaining_nodes_addresses}", color='b')
|
|
360
|
+
|
|
361
|
+
timeout_min = 0
|
|
362
|
+
timeout_max = 0
|
|
363
|
+
if not no_timeout:
|
|
364
|
+
timeout_min = worker_timeout_min_seconds
|
|
365
|
+
timeout_max = worker_timeout_max_seconds
|
|
366
|
+
_send_restart_command(session=session, nodes=remaining_nodes_addresses, timeout_min=timeout_min, timeout_max=timeout_max)
|
|
367
|
+
restarted_edge_nodes_count = len(remaining_nodes_addresses)
|
|
368
|
+
else:
|
|
369
|
+
log_with_color("Skipping Edge Nodes restart as per user request.", color='y')
|
|
304
370
|
|
|
305
|
-
timeout_min = 0
|
|
306
|
-
timeout_max = 0
|
|
307
|
-
if not no_timeout:
|
|
308
|
-
timeout_min = 5
|
|
309
|
-
timeout_max = 25
|
|
310
|
-
_send_restart_command(session=session, nodes=remaining_nodes_addresses, timeout_min=timeout_min, timeout_max=timeout_max)
|
|
311
|
-
restarted_seed_nodes_count = 0
|
|
312
|
-
restarted_oracle_nodes_count = 0
|
|
313
|
-
if not (skip_seeds or skip_oracles):
|
|
314
|
-
restarted_seed_nodes_count = len(seed_nodes_addresses)
|
|
315
|
-
if not skip_oracles:
|
|
316
|
-
restarted_oracle_nodes_count = len(oracle_nodes_addresses)
|
|
317
|
-
restarted_edge_nodes_count = len(remaining_nodes_addresses)
|
|
318
371
|
total_restarted_nodes_count = restarted_seed_nodes_count + restarted_oracle_nodes_count + restarted_edge_nodes_count
|
|
319
|
-
|
|
372
|
+
completion_msg = "All node groups restarted successfully." if len(restart_groups) == 3 else "Selected node groups restarted successfully."
|
|
373
|
+
log_with_color(completion_msg, color='g')
|
|
320
374
|
log_with_color("======================================================", color='b')
|
|
321
375
|
log_with_color(f"Total restarted {total_restarted_nodes_count} Nodes", color='b')
|
|
322
376
|
log_with_color(f"Restarted {restarted_seed_nodes_count} Seed Oracle Nodes", color='b')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ratio1
|
|
3
|
-
Version: 3.4.
|
|
3
|
+
Version: 3.4.106
|
|
4
4
|
Summary: `ratio1` or Ration1 SDK is the Python SDK required for client app development for the Ratio1 ecosystem
|
|
5
5
|
Project-URL: Homepage, https://github.com/Ratio1/ratio1_sdk
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/Ratio1/ratio1_sdk/issues
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
ratio1/__init__.py,sha256=YimqgDbjLuywsf8zCWE0EaUXH4MBUrqLxt0TDV558hQ,632
|
|
2
|
-
ratio1/_ver.py,sha256=
|
|
2
|
+
ratio1/_ver.py,sha256=y8KCFvH3bq-nBTxAYnmG3uMdgKdHLmuP_PRfYryodaw,332
|
|
3
3
|
ratio1/base_decentra_object.py,sha256=iXvAAf6wPnGWzeeiRfwLojVoan-m1e_VsyPzjUQuENo,4492
|
|
4
4
|
ratio1/plugins_manager_mixin.py,sha256=X1JdGLDz0gN1rPnTN_5mJXR8JmqoBFQISJXmPR9yvCo,11106
|
|
5
5
|
ratio1/base/__init__.py,sha256=hACh83_cIv7-PwYMM3bQm2IBmNqiHw-3PAfDfAEKz9A,259
|
|
@@ -31,9 +31,9 @@ ratio1/certs/r9092118.ala.eu-central-1.emqxsl.com.crt,sha256=y-6io0tseyx9-a4Pmde
|
|
|
31
31
|
ratio1/certs/s624dbd4.ala.us-east-1.emqxsl.com.crt,sha256=y-6io0tseyx9-a4Pmde1z1gPULtJNSYUpG_YFkYaMKU,1337
|
|
32
32
|
ratio1/cli/README.md,sha256=YsT23YcZBRyTKReNZPxD762YqstSWKWz4iZe_UJELPc,73
|
|
33
33
|
ratio1/cli/cli.py,sha256=D8UCtdTQKi1IqB_PAi3k2FfaM-rnfxmlrOzM4OJBOsA,4352
|
|
34
|
-
ratio1/cli/cli_commands.py,sha256=
|
|
34
|
+
ratio1/cli/cli_commands.py,sha256=p2VQOdl2V0NuYPOfUZv6cRkH6falqMMBCG0nYJooZ0o,6706
|
|
35
35
|
ratio1/cli/nodes.py,sha256=VkqjKef8ByWNyO7zr3nBEWUZrAlaDQ_9yMgChQPschE,13942
|
|
36
|
-
ratio1/cli/oracles.py,sha256=
|
|
36
|
+
ratio1/cli/oracles.py,sha256=yWzyQl0j1wa6Ob2anII9yanjKmAWlsNYI9mTJN9sejM,14519
|
|
37
37
|
ratio1/cli/package_update.py,sha256=uRMPW5XV3fBdB_eZfoQDA1SKnJzTJvyfpRJA6T3ZZlQ,4000
|
|
38
38
|
ratio1/code_cheker/__init__.py,sha256=pwkdeZGVL16ZA4Qf2mRahEhoOvKhL7FyuQbMFLr1E5M,33
|
|
39
39
|
ratio1/code_cheker/base.py,sha256=GrvKyb8uVKChtnXp2drQ62kdqIj3jZZZ7jaOCfsEOLc,19068
|
|
@@ -109,8 +109,8 @@ ratio1/utils/comm_utils.py,sha256=4cS9llRr_pK_3rNgDcRMCQwYPO0kcNU7AdWy_LtMyCY,10
|
|
|
109
109
|
ratio1/utils/config.py,sha256=Elfkl7W4aDMvB5WZLiYlPXrecBncgTxb4hcKhQedMzI,10111
|
|
110
110
|
ratio1/utils/dotenv.py,sha256=_AgSo35n7EnQv5yDyu7C7i0kHragLJoCGydHjvOkrYY,2008
|
|
111
111
|
ratio1/utils/oracle_sync/oracle_tester.py,sha256=aJOPcZhtbw1XPqsFG4qYpfv2Taj5-qRXbwJzrPyeXDE,27465
|
|
112
|
-
ratio1-3.4.
|
|
113
|
-
ratio1-3.4.
|
|
114
|
-
ratio1-3.4.
|
|
115
|
-
ratio1-3.4.
|
|
116
|
-
ratio1-3.4.
|
|
112
|
+
ratio1-3.4.106.dist-info/METADATA,sha256=TkflNCPVG-aE-rKVG9NYqetf6l5Mp97E0YaT4q00Bg0,12256
|
|
113
|
+
ratio1-3.4.106.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
114
|
+
ratio1-3.4.106.dist-info/entry_points.txt,sha256=DR_olREzU1egwmgek3s4GfQslBi-KR7lXsd4ap0TFxE,46
|
|
115
|
+
ratio1-3.4.106.dist-info/licenses/LICENSE,sha256=cvOsJVslde4oIaTCadabXnPqZmzcBO2f2zwXZRmJEbE,11311
|
|
116
|
+
ratio1-3.4.106.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|