neuronum 7.0.3__tar.gz → 7.0.4__tar.gz
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.
Potentially problematic release.
This version of neuronum might be problematic. Click here for more details.
- {neuronum-7.0.3/neuronum.egg-info → neuronum-7.0.4}/PKG-INFO +4 -4
- {neuronum-7.0.3 → neuronum-7.0.4}/README.md +3 -3
- {neuronum-7.0.3 → neuronum-7.0.4}/cli/main.py +365 -26
- {neuronum-7.0.3 → neuronum-7.0.4/neuronum.egg-info}/PKG-INFO +4 -4
- {neuronum-7.0.3 → neuronum-7.0.4}/setup.py +1 -1
- {neuronum-7.0.3 → neuronum-7.0.4}/LICENSE.md +0 -0
- {neuronum-7.0.3 → neuronum-7.0.4}/cli/__init__.py +0 -0
- {neuronum-7.0.3 → neuronum-7.0.4}/neuronum/__init__.py +0 -0
- {neuronum-7.0.3 → neuronum-7.0.4}/neuronum/neuronum.py +0 -0
- {neuronum-7.0.3 → neuronum-7.0.4}/neuronum.egg-info/SOURCES.txt +0 -0
- {neuronum-7.0.3 → neuronum-7.0.4}/neuronum.egg-info/dependency_links.txt +0 -0
- {neuronum-7.0.3 → neuronum-7.0.4}/neuronum.egg-info/entry_points.txt +0 -0
- {neuronum-7.0.3 → neuronum-7.0.4}/neuronum.egg-info/requires.txt +0 -0
- {neuronum-7.0.3 → neuronum-7.0.4}/neuronum.egg-info/top_level.txt +0 -0
- {neuronum-7.0.3 → neuronum-7.0.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: neuronum
|
|
3
|
-
Version: 7.0.
|
|
3
|
+
Version: 7.0.4
|
|
4
4
|
Summary: Official client library to interact with the Neuronum Network
|
|
5
5
|
Home-page: https://neuronum.net
|
|
6
6
|
Author: Neuronum Cybernetics
|
|
@@ -128,7 +128,7 @@ ping.html: A static HTML file used to render web-based responses.
|
|
|
128
128
|
|
|
129
129
|
Change into Node folder
|
|
130
130
|
```sh
|
|
131
|
-
cd
|
|
131
|
+
cd Test App_<your_node_id>
|
|
132
132
|
```
|
|
133
133
|
|
|
134
134
|
Start your Node:
|
|
@@ -154,7 +154,7 @@ cell = neuronum.Cell( # set Cell connection
|
|
|
154
154
|
async def main():
|
|
155
155
|
|
|
156
156
|
TX = "id::tx" # select the Transmitter TX
|
|
157
|
-
data = {"
|
|
157
|
+
data = {"ping": "node"}
|
|
158
158
|
tx_response = await cell.activate_tx(TX, data) # activate TX - > get response back
|
|
159
159
|
print(tx_response) # print tx response
|
|
160
160
|
|
|
@@ -163,7 +163,7 @@ asyncio.run(main())
|
|
|
163
163
|
|
|
164
164
|
#### **CLI-based**
|
|
165
165
|
```sh
|
|
166
|
-
neuronum activate --tx id::tx '
|
|
166
|
+
neuronum activate --tx id::tx 'ping:node'
|
|
167
167
|
```
|
|
168
168
|
|
|
169
169
|
#### **Cellai (in Testing)**
|
|
@@ -94,7 +94,7 @@ ping.html: A static HTML file used to render web-based responses.
|
|
|
94
94
|
|
|
95
95
|
Change into Node folder
|
|
96
96
|
```sh
|
|
97
|
-
cd
|
|
97
|
+
cd Test App_<your_node_id>
|
|
98
98
|
```
|
|
99
99
|
|
|
100
100
|
Start your Node:
|
|
@@ -120,7 +120,7 @@ cell = neuronum.Cell( # set Cell connection
|
|
|
120
120
|
async def main():
|
|
121
121
|
|
|
122
122
|
TX = "id::tx" # select the Transmitter TX
|
|
123
|
-
data = {"
|
|
123
|
+
data = {"ping": "node"}
|
|
124
124
|
tx_response = await cell.activate_tx(TX, data) # activate TX - > get response back
|
|
125
125
|
print(tx_response) # print tx response
|
|
126
126
|
|
|
@@ -129,7 +129,7 @@ asyncio.run(main())
|
|
|
129
129
|
|
|
130
130
|
#### **CLI-based**
|
|
131
131
|
```sh
|
|
132
|
-
neuronum activate --tx id::tx '
|
|
132
|
+
neuronum activate --tx id::tx 'ping:node'
|
|
133
133
|
```
|
|
134
134
|
|
|
135
135
|
#### **Cellai (in Testing)**
|
|
@@ -249,14 +249,15 @@ def delete_cell():
|
|
|
249
249
|
|
|
250
250
|
|
|
251
251
|
@click.command()
|
|
252
|
-
|
|
252
|
+
@click.option('--blank', is_flag=True, help="Generate a Node Template without Stream and Transmitter")
|
|
253
|
+
def init_node(blank):
|
|
253
254
|
descr = click.prompt("Node description: Type up to 25 characters").strip()
|
|
254
255
|
if descr and len(descr) > 25:
|
|
255
256
|
click.echo("Description too long. Max 25 characters allowed.")
|
|
256
257
|
return
|
|
257
|
-
asyncio.run(async_init_node(descr))
|
|
258
|
+
asyncio.run(async_init_node(blank, descr))
|
|
258
259
|
|
|
259
|
-
async def async_init_node(descr):
|
|
260
|
+
async def async_init_node(blank, descr):
|
|
260
261
|
credentials_folder_path = Path.home() / ".neuronum"
|
|
261
262
|
env_path = credentials_folder_path / ".env"
|
|
262
263
|
|
|
@@ -312,21 +313,359 @@ async def async_init_node(descr):
|
|
|
312
313
|
env_path = project_path / ".env"
|
|
313
314
|
await asyncio.to_thread(env_path.write_text, f"NODE={nodeID}\nHOST={host}\nPASSWORD={password}\nNETWORK={network}\nSYNAPSE={synapse}\n")
|
|
314
315
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
316
|
+
if blank is False:
|
|
317
|
+
stx_descr = f"{nodeID} App"
|
|
318
|
+
partners = ["private"]
|
|
319
|
+
stxID = await cell.create_stx(stx_descr, partners)
|
|
320
|
+
|
|
321
|
+
tx_descr = f"Greet {nodeID}"
|
|
322
|
+
key_values = {
|
|
323
|
+
"ping": "pong",
|
|
324
|
+
}
|
|
325
|
+
STX = stxID
|
|
326
|
+
label = "ping:pong"
|
|
327
|
+
partners = ["private"]
|
|
328
|
+
txID = await cell.create_tx(tx_descr, key_values, STX, label, partners)
|
|
329
|
+
|
|
330
|
+
app_path = project_path / "app.py"
|
|
331
|
+
app_path.write_text(f"""\
|
|
332
|
+
import asyncio
|
|
333
|
+
import neuronum
|
|
334
|
+
import os
|
|
335
|
+
import json
|
|
336
|
+
from dotenv import load_dotenv
|
|
337
|
+
from jinja2 import Environment, FileSystemLoader
|
|
318
338
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
339
|
+
env = Environment(loader=FileSystemLoader('.'))
|
|
340
|
+
template = env.get_template('ping.html')
|
|
341
|
+
|
|
342
|
+
with open('config.json', 'r') as f:
|
|
343
|
+
data = json.load(f)
|
|
344
|
+
terms_url = data['legals']['terms']
|
|
345
|
+
privacy_url = data['legals']['privacy_policy']
|
|
346
|
+
last_update = data['legals']['last_update']
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
load_dotenv()
|
|
350
|
+
host = os.getenv("HOST")
|
|
351
|
+
password = os.getenv("PASSWORD")
|
|
352
|
+
network = os.getenv("NETWORK")
|
|
353
|
+
synapse = os.getenv("SYNAPSE")
|
|
354
|
+
|
|
355
|
+
cell = neuronum.Cell(
|
|
356
|
+
host=host,
|
|
357
|
+
password=password,
|
|
358
|
+
network=network,
|
|
359
|
+
synapse=synapse
|
|
360
|
+
)
|
|
361
|
+
|
|
362
|
+
async def main():
|
|
363
|
+
STX = "{stxID}"
|
|
364
|
+
async for operation in cell.sync(STX):
|
|
365
|
+
txID = operation.get("txID")
|
|
366
|
+
client = operation.get("operator")
|
|
367
|
+
ts = operation.get("time")
|
|
368
|
+
data = operation.get("data")
|
|
369
|
+
operation_id = operation.get("operationID")
|
|
370
|
+
|
|
371
|
+
if txID == "{txID}":
|
|
372
|
+
|
|
373
|
+
def render_html_template(client, ts, data, operation_id, terms_url, privacy_url, last_update):
|
|
374
|
+
return template.render(client=client, ts=ts, data=data, operation_id=operation_id, terms_url=terms_url, privacy_url=privacy_url, last_update=last_update)
|
|
375
|
+
|
|
376
|
+
html_content = render_html_template(client, ts, data, operation_id, terms_url, privacy_url, last_update)
|
|
377
|
+
|
|
378
|
+
data = {{
|
|
379
|
+
"json": f"{{operation_id}} - Reply from {nodeID}: Pinged by {{client}} at {{ts}} with data: {{data}}",
|
|
380
|
+
"html": html_content
|
|
381
|
+
}}
|
|
382
|
+
|
|
383
|
+
await cell.notify(f"{{client}}", "{nodeID} Ping","Pinged successfully")
|
|
384
|
+
|
|
385
|
+
await cell.tx_response(txID, client, data)
|
|
386
|
+
|
|
387
|
+
asyncio.run(main())
|
|
388
|
+
""")
|
|
389
|
+
|
|
390
|
+
html_path = project_path / "ping.html"
|
|
391
|
+
html_content = f"""\
|
|
392
|
+
<!DOCTYPE html>
|
|
393
|
+
<html>
|
|
394
|
+
<head>
|
|
395
|
+
<style>
|
|
396
|
+
body {{
|
|
397
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
398
|
+
background-color: #121212;
|
|
399
|
+
color: #e0e0e0;
|
|
400
|
+
margin: 0;
|
|
401
|
+
padding: 0;
|
|
402
|
+
display: flex;
|
|
403
|
+
justify-content: center;
|
|
404
|
+
align-items: center;
|
|
405
|
+
min-height: 100vh;
|
|
406
|
+
}}
|
|
407
|
+
|
|
408
|
+
.container {{
|
|
409
|
+
background-color: #1e1e1e;
|
|
410
|
+
border-radius: 12px;
|
|
411
|
+
padding: 40px;
|
|
412
|
+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
|
|
413
|
+
width: 100%;
|
|
414
|
+
max-width: 500px;
|
|
415
|
+
text-align: center;
|
|
416
|
+
box-sizing: border-box;
|
|
417
|
+
}}
|
|
418
|
+
|
|
419
|
+
.logo {{
|
|
420
|
+
width: 80px;
|
|
421
|
+
margin-bottom: 25px;
|
|
422
|
+
filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.1));
|
|
423
|
+
}}
|
|
424
|
+
|
|
425
|
+
h1 {{
|
|
426
|
+
font-size: 1.5em;
|
|
427
|
+
font-weight: 600;
|
|
428
|
+
margin-bottom: 5px;
|
|
429
|
+
color: #f5f5f5;
|
|
430
|
+
}}
|
|
431
|
+
|
|
432
|
+
.subtitle {{
|
|
433
|
+
font-size: 0.9em;
|
|
434
|
+
color: #a0a0a0;
|
|
435
|
+
margin-bottom: 30px;
|
|
436
|
+
}}
|
|
437
|
+
|
|
438
|
+
.data-row {{
|
|
439
|
+
background-color: #2a2a2a;
|
|
440
|
+
padding: 12px 15px;
|
|
441
|
+
border-radius: 8px;
|
|
442
|
+
margin-bottom: 10px;
|
|
443
|
+
display: flex;
|
|
444
|
+
justify-content: space-between;
|
|
445
|
+
align-items: center;
|
|
446
|
+
}}
|
|
447
|
+
|
|
448
|
+
.data-label {{
|
|
449
|
+
font-weight: 400;
|
|
450
|
+
color: #a0a0a0;
|
|
451
|
+
margin: 0;
|
|
452
|
+
}}
|
|
453
|
+
|
|
454
|
+
.data-value {{
|
|
455
|
+
font-weight: 500;
|
|
456
|
+
color: #e0e0e0;
|
|
457
|
+
margin: 0;
|
|
458
|
+
}}
|
|
459
|
+
|
|
460
|
+
.data-value.truncated {{
|
|
461
|
+
white-space: nowrap;
|
|
462
|
+
overflow: hidden;
|
|
463
|
+
text-overflow: ellipsis;
|
|
464
|
+
max-width: 60%;
|
|
465
|
+
}}
|
|
466
|
+
|
|
467
|
+
.data-value.client {{
|
|
468
|
+
color: #8cafff;
|
|
469
|
+
}}
|
|
470
|
+
.data-value.timestamp {{
|
|
471
|
+
color: #a1e8a1;
|
|
472
|
+
}}
|
|
473
|
+
.data-value.operation-id {{
|
|
474
|
+
color: #f7a2a2;
|
|
475
|
+
}}
|
|
476
|
+
.api-button {{
|
|
477
|
+
background: #01c07d 100%;
|
|
478
|
+
color: white;
|
|
479
|
+
border: none;
|
|
480
|
+
border-radius: 8px;
|
|
481
|
+
padding: 12px 24px;
|
|
482
|
+
font-size: 16px;
|
|
483
|
+
font-weight: bold;
|
|
484
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
485
|
+
cursor: pointer;
|
|
486
|
+
margin-top: 10px;
|
|
487
|
+
}}
|
|
488
|
+
</style>
|
|
489
|
+
</head>
|
|
490
|
+
<body>
|
|
491
|
+
<div class="container">
|
|
492
|
+
<img class="logo" src="https://neuronum.net/static/logo.png" alt="Neuronum Logo">
|
|
493
|
+
|
|
494
|
+
<h1>Reply from {nodeID}</h1>
|
|
495
|
+
<p class="subtitle">Pinged successfully.</p>
|
|
496
|
+
|
|
497
|
+
<div class="data-row">
|
|
498
|
+
<p class="data-label">Client</p>
|
|
499
|
+
<p class="data-value client">{{{{client}}}}</p>
|
|
500
|
+
</div>
|
|
501
|
+
|
|
502
|
+
<div class="data-row">
|
|
503
|
+
<p class="data-label">Timestamp</p>
|
|
504
|
+
<p class="data-value timestamp">{{{{ts}}}}</p>
|
|
505
|
+
</div>
|
|
506
|
+
|
|
507
|
+
<div class="data-row">
|
|
508
|
+
<p class="data-label">Data</p>
|
|
509
|
+
<p class="data-value">{{{{data}}}}</p>
|
|
510
|
+
</div>
|
|
511
|
+
|
|
512
|
+
<div class="data-row">
|
|
513
|
+
<p class="data-label">Operation ID</p>
|
|
514
|
+
<p class="data-value operation-id truncated">{{{{operation_id}}}}</p>
|
|
515
|
+
</div>
|
|
516
|
+
|
|
517
|
+
<button id="send-request-btn" class="api-button">Ping again</button>
|
|
518
|
+
</div>
|
|
519
|
+
|
|
520
|
+
<script>
|
|
521
|
+
document.getElementById('send-request-btn').addEventListener('click', () => {{
|
|
522
|
+
const apiEndpoint = 'https://neuronum.net/api/activate/{txID}';
|
|
523
|
+
|
|
524
|
+
const dataToSend = {{
|
|
525
|
+
"data": {{"ping": "node"}},
|
|
526
|
+
"cell": {{
|
|
527
|
+
"host": CLIENT_CELL,
|
|
528
|
+
"session": CLIENT_SESSION,
|
|
529
|
+
}}
|
|
530
|
+
}};
|
|
531
|
+
|
|
532
|
+
fetch(apiEndpoint, {{
|
|
533
|
+
method: 'POST',
|
|
534
|
+
headers: {{
|
|
535
|
+
'Content-Type': 'application/json',
|
|
536
|
+
'Accept': 'application/json'
|
|
537
|
+
}},
|
|
538
|
+
body: JSON.stringify(dataToSend)
|
|
539
|
+
}})
|
|
540
|
+
.then(response => {{
|
|
541
|
+
if (!response.ok) {{
|
|
542
|
+
throw new Error(`HTTP error! status: ${{response.status}}`);
|
|
543
|
+
}}
|
|
544
|
+
return response.json();
|
|
545
|
+
}})
|
|
546
|
+
.then(data => {{
|
|
547
|
+
if (data.success && data.response && data.response.html) {{
|
|
548
|
+
document.open();
|
|
549
|
+
document.write(data.response.html);
|
|
550
|
+
document.close();
|
|
551
|
+
console.log('API Response: Page replaced with new HTML.');
|
|
552
|
+
}} else {{
|
|
553
|
+
console.error('API Response does not contain HTML to replace the page:', data);
|
|
554
|
+
alert('API response error: Expected HTML content to replace the page.');
|
|
555
|
+
}}
|
|
556
|
+
}})
|
|
557
|
+
.catch(error => {{
|
|
558
|
+
console.error('API request failed:', error);
|
|
559
|
+
alert('API request failed. See the console for details.');
|
|
560
|
+
}});
|
|
561
|
+
}});
|
|
562
|
+
</script>
|
|
563
|
+
|
|
564
|
+
<div id="legal-banner" style="border-radius: 10px; margin: 15px; position: fixed; bottom: 0; left: 0; right: 0; background-color: #2a2a2a; color: #e0e0e0; padding: 16px; text-align: center; font-size: 14px; z-index: 9999; box-shadow: 0 -2px 10px rgba(0,0,0,0.5);">
|
|
565
|
+
By continuing, you agree to our
|
|
566
|
+
Terms (<span style="color: #8cafff;">{{{{terms_url}}}}</span>) &
|
|
567
|
+
Privacy Policy (<span style="color: #8cafff;">{{{{privacy_url}}}}</span>)
|
|
568
|
+
<br>
|
|
569
|
+
<button id="accept-legal" style="margin-top: 15px; margin-bottom: 15px; background: #01c07d; color: white; border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer;">Accept</button>
|
|
570
|
+
<br>
|
|
571
|
+
Last Update: {{{{last_update}}}}
|
|
572
|
+
</div>
|
|
573
|
+
|
|
574
|
+
<script>
|
|
575
|
+
const banner = document.getElementById('legal-banner');
|
|
576
|
+
const acceptBtn = document.getElementById('accept-legal');
|
|
577
|
+
acceptBtn.addEventListener('click', () => {{
|
|
578
|
+
banner.remove();
|
|
579
|
+
}});
|
|
580
|
+
</script>
|
|
581
|
+
|
|
582
|
+
</body>
|
|
583
|
+
</html>
|
|
584
|
+
"""
|
|
585
|
+
html_path.write_text(html_content)
|
|
586
|
+
|
|
587
|
+
config_path = project_path / "config.json"
|
|
588
|
+
await asyncio.to_thread(
|
|
589
|
+
config_path.write_text,
|
|
590
|
+
f"""{{
|
|
591
|
+
"app_metadata": {{
|
|
592
|
+
"name": "{descr}",
|
|
593
|
+
"version": "1.0.0",
|
|
594
|
+
"author": "{host}"
|
|
595
|
+
}},
|
|
596
|
+
"data_gateways": [
|
|
597
|
+
{{
|
|
598
|
+
"type": "transmitter",
|
|
599
|
+
"id": "{txID}",
|
|
600
|
+
"info": "Ping Your Node"
|
|
601
|
+
}}
|
|
602
|
+
],
|
|
603
|
+
"legals": {{
|
|
604
|
+
"terms": "https://url_to_your/terms",
|
|
605
|
+
"privacy_policy": "https://url_to_your/privacy_policy",
|
|
606
|
+
"last_update" : "DD/MM/YYYY"
|
|
607
|
+
}}
|
|
608
|
+
}}"""
|
|
609
|
+
)
|
|
610
|
+
|
|
611
|
+
nodemd_path = project_path / "NODE.md"
|
|
612
|
+
await asyncio.to_thread(nodemd_path.write_text, f"""### NODE.md of {nodeID}
|
|
613
|
+
|
|
614
|
+
Welcome to your Node's documentation! This guide provides several ways for users to interact with your application.
|
|
615
|
+
|
|
616
|
+
***
|
|
617
|
+
|
|
618
|
+
### 💻 Using the CLI
|
|
619
|
+
|
|
620
|
+
To ping this Node via the command-line interface, use the following command:
|
|
621
|
+
|
|
622
|
+
`neuronum activate --tx {txID} 'ping:node'`
|
|
623
|
+
|
|
624
|
+
***
|
|
625
|
+
|
|
626
|
+
### 🐍 With Python
|
|
627
|
+
|
|
628
|
+
For programmatic access, use the following Python code snippet. This script utilizes the `neuronum` library to activate the transaction and receive a response.
|
|
629
|
+
|
|
630
|
+
```python
|
|
631
|
+
import asyncio
|
|
632
|
+
import neuronum
|
|
633
|
+
|
|
634
|
+
# Set up Cell connection parameters
|
|
635
|
+
cell = neuronum.Cell(
|
|
636
|
+
host="host", # Cell host
|
|
637
|
+
password="password", # Cell password
|
|
638
|
+
network="neuronum.net", # Cell network
|
|
639
|
+
synapse="synapse" # Cell synapse
|
|
640
|
+
)
|
|
641
|
+
|
|
642
|
+
async def main():
|
|
643
|
+
# Define the transaction ID and data payload
|
|
644
|
+
TX = "{txID}"
|
|
645
|
+
data = {{"ping": "node"}}
|
|
646
|
+
|
|
647
|
+
# Activate the transaction and get the response
|
|
648
|
+
tx_response = await cell.activate_tx(TX, data)
|
|
649
|
+
|
|
650
|
+
# Print the response from the Node
|
|
651
|
+
print(tx_response)
|
|
652
|
+
|
|
653
|
+
# Run the main asynchronous function
|
|
654
|
+
if __name__ == "__main__":
|
|
655
|
+
asyncio.run(main())
|
|
656
|
+
```
|
|
657
|
+
|
|
658
|
+
🤖 Via Cellai (Android App - Currently in Testing)
|
|
659
|
+
Download the app from the Google Play Store.
|
|
660
|
+
Send the command "Ping Node" to Cellai
|
|
661
|
+
""")
|
|
662
|
+
|
|
663
|
+
else:
|
|
664
|
+
stxID = "id::stx"
|
|
665
|
+
txID = "id::tx"
|
|
327
666
|
|
|
328
|
-
|
|
329
|
-
|
|
667
|
+
app_path = project_path / "app.py"
|
|
668
|
+
app_path.write_text(f"""\
|
|
330
669
|
import asyncio
|
|
331
670
|
import neuronum
|
|
332
671
|
import os
|
|
@@ -385,8 +724,8 @@ async def main():
|
|
|
385
724
|
asyncio.run(main())
|
|
386
725
|
""")
|
|
387
726
|
|
|
388
|
-
|
|
389
|
-
|
|
727
|
+
html_path = project_path / "ping.html"
|
|
728
|
+
html_content = f"""\
|
|
390
729
|
<!DOCTYPE html>
|
|
391
730
|
<html>
|
|
392
731
|
<head>
|
|
@@ -580,11 +919,11 @@ asyncio.run(main())
|
|
|
580
919
|
</body>
|
|
581
920
|
</html>
|
|
582
921
|
"""
|
|
583
|
-
|
|
922
|
+
html_path.write_text(html_content)
|
|
584
923
|
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
924
|
+
config_path = project_path / "config.json"
|
|
925
|
+
await asyncio.to_thread(
|
|
926
|
+
config_path.write_text,
|
|
588
927
|
f"""{{
|
|
589
928
|
"app_metadata": {{
|
|
590
929
|
"name": "{descr}",
|
|
@@ -606,8 +945,8 @@ f"""{{
|
|
|
606
945
|
}}"""
|
|
607
946
|
)
|
|
608
947
|
|
|
609
|
-
|
|
610
|
-
|
|
948
|
+
nodemd_path = project_path / "NODE.md"
|
|
949
|
+
await asyncio.to_thread(nodemd_path.write_text, f"""### NODE.md of {nodeID}
|
|
611
950
|
|
|
612
951
|
Welcome to your Node's documentation! This guide provides several ways for users to interact with your application.
|
|
613
952
|
|
|
@@ -695,7 +1034,7 @@ def start_node(d):
|
|
|
695
1034
|
click.echo("Starting Node...")
|
|
696
1035
|
|
|
697
1036
|
project_path = Path.cwd()
|
|
698
|
-
script_files = glob.glob("
|
|
1037
|
+
script_files = glob.glob("app.py")
|
|
699
1038
|
processes = []
|
|
700
1039
|
|
|
701
1040
|
for script in script_files:
|
|
@@ -842,7 +1181,7 @@ def restart_node(d):
|
|
|
842
1181
|
|
|
843
1182
|
click.echo(f"Starting Node {nodeID}...")
|
|
844
1183
|
project_path = Path.cwd()
|
|
845
|
-
script_files = glob.glob("
|
|
1184
|
+
script_files = glob.glob("app.py")
|
|
846
1185
|
processes = []
|
|
847
1186
|
|
|
848
1187
|
for script in script_files:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: neuronum
|
|
3
|
-
Version: 7.0.
|
|
3
|
+
Version: 7.0.4
|
|
4
4
|
Summary: Official client library to interact with the Neuronum Network
|
|
5
5
|
Home-page: https://neuronum.net
|
|
6
6
|
Author: Neuronum Cybernetics
|
|
@@ -128,7 +128,7 @@ ping.html: A static HTML file used to render web-based responses.
|
|
|
128
128
|
|
|
129
129
|
Change into Node folder
|
|
130
130
|
```sh
|
|
131
|
-
cd
|
|
131
|
+
cd Test App_<your_node_id>
|
|
132
132
|
```
|
|
133
133
|
|
|
134
134
|
Start your Node:
|
|
@@ -154,7 +154,7 @@ cell = neuronum.Cell( # set Cell connection
|
|
|
154
154
|
async def main():
|
|
155
155
|
|
|
156
156
|
TX = "id::tx" # select the Transmitter TX
|
|
157
|
-
data = {"
|
|
157
|
+
data = {"ping": "node"}
|
|
158
158
|
tx_response = await cell.activate_tx(TX, data) # activate TX - > get response back
|
|
159
159
|
print(tx_response) # print tx response
|
|
160
160
|
|
|
@@ -163,7 +163,7 @@ asyncio.run(main())
|
|
|
163
163
|
|
|
164
164
|
#### **CLI-based**
|
|
165
165
|
```sh
|
|
166
|
-
neuronum activate --tx id::tx '
|
|
166
|
+
neuronum activate --tx id::tx 'ping:node'
|
|
167
167
|
```
|
|
168
168
|
|
|
169
169
|
#### **Cellai (in Testing)**
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|