neuronum 7.0.0__py3-none-any.whl → 7.0.2__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.
Potentially problematic release.
This version of neuronum might be problematic. Click here for more details.
- cli/main.py +47 -15
- {neuronum-7.0.0.dist-info → neuronum-7.0.2.dist-info}/METADATA +1 -8
- neuronum-7.0.2.dist-info/RECORD +10 -0
- neuronum-7.0.0.dist-info/RECORD +0 -10
- {neuronum-7.0.0.dist-info → neuronum-7.0.2.dist-info}/WHEEL +0 -0
- {neuronum-7.0.0.dist-info → neuronum-7.0.2.dist-info}/entry_points.txt +0 -0
- {neuronum-7.0.0.dist-info → neuronum-7.0.2.dist-info}/licenses/LICENSE.md +0 -0
- {neuronum-7.0.0.dist-info → neuronum-7.0.2.dist-info}/top_level.txt +0 -0
cli/main.py
CHANGED
|
@@ -330,11 +330,19 @@ async def async_init_node(descr):
|
|
|
330
330
|
import asyncio
|
|
331
331
|
import neuronum
|
|
332
332
|
import os
|
|
333
|
+
import json
|
|
333
334
|
from dotenv import load_dotenv
|
|
334
335
|
from jinja2 import Environment, FileSystemLoader
|
|
335
336
|
|
|
336
337
|
env = Environment(loader=FileSystemLoader('.'))
|
|
337
|
-
template = env.get_template('ping.html')
|
|
338
|
+
template = env.get_template('ping.html')
|
|
339
|
+
|
|
340
|
+
with open('config.json', 'r') as f:
|
|
341
|
+
data = json.load(f)
|
|
342
|
+
terms_url = data['legals']['terms']
|
|
343
|
+
privacy_url = data['legals']['privacy_policy']
|
|
344
|
+
last_update = data['legals']['last_update']
|
|
345
|
+
|
|
338
346
|
|
|
339
347
|
load_dotenv()
|
|
340
348
|
host = os.getenv("HOST")
|
|
@@ -360,10 +368,10 @@ async def main():
|
|
|
360
368
|
|
|
361
369
|
if txID == "{txID}":
|
|
362
370
|
|
|
363
|
-
def render_html_template(client, ts, data, operation_id):
|
|
364
|
-
return template.render(client=client, ts=ts, data=data, operation_id=operation_id)
|
|
371
|
+
def render_html_template(client, ts, data, operation_id, terms_url, privacy_url, last_update):
|
|
372
|
+
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)
|
|
365
373
|
|
|
366
|
-
html_content = render_html_template(client, ts, data, operation_id)
|
|
374
|
+
html_content = render_html_template(client, ts, data, operation_id, terms_url, privacy_url, last_update)
|
|
367
375
|
|
|
368
376
|
data = {{
|
|
369
377
|
"json": f"{{operation_id}} - Reply from {nodeID}: Pinged by {{client}} at {{ts}} with data: {{data}}",
|
|
@@ -463,6 +471,18 @@ asyncio.run(main())
|
|
|
463
471
|
.data-value.operation-id {{
|
|
464
472
|
color: #f7a2a2;
|
|
465
473
|
}}
|
|
474
|
+
.api-button {{
|
|
475
|
+
background: #01c07d 100%;
|
|
476
|
+
color: white;
|
|
477
|
+
border: none;
|
|
478
|
+
border-radius: 8px;
|
|
479
|
+
padding: 12px 24px;
|
|
480
|
+
font-size: 16px;
|
|
481
|
+
font-weight: bold;
|
|
482
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
483
|
+
cursor: pointer;
|
|
484
|
+
margin-top: 10px;
|
|
485
|
+
}}
|
|
466
486
|
</style>
|
|
467
487
|
</head>
|
|
468
488
|
<body>
|
|
@@ -497,7 +517,7 @@ asyncio.run(main())
|
|
|
497
517
|
|
|
498
518
|
<script>
|
|
499
519
|
document.getElementById('send-request-btn').addEventListener('click', () => {{
|
|
500
|
-
const apiEndpoint = 'https://neuronum.net/api/activate/{
|
|
520
|
+
const apiEndpoint = 'https://neuronum.net/api/activate/{txID}';
|
|
501
521
|
|
|
502
522
|
const dataToSend = {{
|
|
503
523
|
"data": {{"ping": "node"}},
|
|
@@ -538,6 +558,25 @@ asyncio.run(main())
|
|
|
538
558
|
}});
|
|
539
559
|
}});
|
|
540
560
|
</script>
|
|
561
|
+
|
|
562
|
+
<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);">
|
|
563
|
+
By continuing, you agree to our
|
|
564
|
+
Terms (<span style="color: #8cafff;">{{{{terms_url}}}}</span>) &
|
|
565
|
+
Privacy Policy (<span style="color: #8cafff;">{{{{privacy_url}}}}</span>)
|
|
566
|
+
<br>
|
|
567
|
+
<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>
|
|
568
|
+
<br>
|
|
569
|
+
Last Update: {{{{last_update}}}}
|
|
570
|
+
</div>
|
|
571
|
+
|
|
572
|
+
<script>
|
|
573
|
+
const banner = document.getElementById('legal-banner');
|
|
574
|
+
const acceptBtn = document.getElementById('accept-legal');
|
|
575
|
+
acceptBtn.addEventListener('click', () => {{
|
|
576
|
+
banner.remove();
|
|
577
|
+
}});
|
|
578
|
+
</script>
|
|
579
|
+
|
|
541
580
|
</body>
|
|
542
581
|
</html>
|
|
543
582
|
"""
|
|
@@ -560,8 +599,9 @@ f"""{{
|
|
|
560
599
|
}}
|
|
561
600
|
],
|
|
562
601
|
"legals": {{
|
|
563
|
-
"
|
|
564
|
-
"
|
|
602
|
+
"terms": "https://url_to_your/terms",
|
|
603
|
+
"privacy_policy": "https://url_to_your/privacy_policy",
|
|
604
|
+
"last_update" : "DD/MM/YYYY"
|
|
565
605
|
}}
|
|
566
606
|
}}"""
|
|
567
607
|
)
|
|
@@ -581,14 +621,6 @@ To ping this Node via the command-line interface, use the following command:
|
|
|
581
621
|
|
|
582
622
|
***
|
|
583
623
|
|
|
584
|
-
### 🌐 Via the Web
|
|
585
|
-
|
|
586
|
-
You can also interact with this Node by simply visiting this URL in your web browser:
|
|
587
|
-
|
|
588
|
-
[https://neuronum.net/tx/{txID}](https://neuronum.net/tx/{txID})
|
|
589
|
-
|
|
590
|
-
***
|
|
591
|
-
|
|
592
624
|
### 🐍 With Python
|
|
593
625
|
|
|
594
626
|
For programmatic access, use the following Python code snippet. This script utilizes the `neuronum` library to activate the transaction and receive a response.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: neuronum
|
|
3
|
-
Version: 7.0.
|
|
3
|
+
Version: 7.0.2
|
|
4
4
|
Summary: Official client library to interact with the Neuronum Network
|
|
5
5
|
Home-page: https://neuronum.net
|
|
6
6
|
Author: Neuronum Cybernetics
|
|
@@ -79,7 +79,6 @@ Neuronum is the real-time data engine designed for developers to build event-dri
|
|
|
79
79
|
|
|
80
80
|
### Requirements
|
|
81
81
|
- Python >= 3.8
|
|
82
|
-
- neuronum >= 5.5.0
|
|
83
82
|
|
|
84
83
|
------------------
|
|
85
84
|
|
|
@@ -140,12 +139,6 @@ neuronum start-node # start Node
|
|
|
140
139
|
------------------
|
|
141
140
|
|
|
142
141
|
### **Interact with Neuronum**
|
|
143
|
-
#### **Web-based**
|
|
144
|
-
1. [Visit Neuronum](https://neuronum.net)
|
|
145
|
-
2. [Connect your Cell](https://neuronum.net/connect)
|
|
146
|
-
3. [Explore Transmitters](https://neuronum.net/explore)
|
|
147
|
-
4. Activate Transmitters
|
|
148
|
-
|
|
149
142
|
#### **Code-based**
|
|
150
143
|
```python
|
|
151
144
|
import asyncio
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
cli/main.py,sha256=jaRDzs_SRdr_2pkdUntg9IBNKfl5_TMB-RQJbgQMPZc,37766
|
|
3
|
+
neuronum/__init__.py,sha256=tAdqNC9rByY_CwG63yAyEe34phBdQ_Vv3FyFpTXQ2wo,45
|
|
4
|
+
neuronum/neuronum.py,sha256=5OjJIAmY7haT6eJ3P767RFk-LTvNFRrlkjB9mOozgN8,17971
|
|
5
|
+
neuronum-7.0.2.dist-info/licenses/LICENSE.md,sha256=m7pw_FktMNCs4tcy2UXP3QQP2S_je28P1SepdYoo0Xo,1961
|
|
6
|
+
neuronum-7.0.2.dist-info/METADATA,sha256=rjaMl_SCEQfxY7dTMnyuv4WxybF7mJqwQOpTddskqo0,5902
|
|
7
|
+
neuronum-7.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
+
neuronum-7.0.2.dist-info/entry_points.txt,sha256=XKYBcRNxGeJpZZkDPsa8HA_RaJ7Km_R_JaUq5T9Nk2U,42
|
|
9
|
+
neuronum-7.0.2.dist-info/top_level.txt,sha256=ru8Fr84cHm6oHr_DcJ8-uaq3RTiuCRFIr6AC8V0zPu4,13
|
|
10
|
+
neuronum-7.0.2.dist-info/RECORD,,
|
neuronum-7.0.0.dist-info/RECORD
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
cli/main.py,sha256=gfMIrKkh_2FICpmgOUf2EBSM1K70MshsQgvZggWIrKs,36207
|
|
3
|
-
neuronum/__init__.py,sha256=tAdqNC9rByY_CwG63yAyEe34phBdQ_Vv3FyFpTXQ2wo,45
|
|
4
|
-
neuronum/neuronum.py,sha256=5OjJIAmY7haT6eJ3P767RFk-LTvNFRrlkjB9mOozgN8,17971
|
|
5
|
-
neuronum-7.0.0.dist-info/licenses/LICENSE.md,sha256=m7pw_FktMNCs4tcy2UXP3QQP2S_je28P1SepdYoo0Xo,1961
|
|
6
|
-
neuronum-7.0.0.dist-info/METADATA,sha256=Ne-RH1cISRVrlfNi5UHS2YGUWVdso_uIyW-3T68E0Jw,6118
|
|
7
|
-
neuronum-7.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
-
neuronum-7.0.0.dist-info/entry_points.txt,sha256=XKYBcRNxGeJpZZkDPsa8HA_RaJ7Km_R_JaUq5T9Nk2U,42
|
|
9
|
-
neuronum-7.0.0.dist-info/top_level.txt,sha256=ru8Fr84cHm6oHr_DcJ8-uaq3RTiuCRFIr6AC8V0zPu4,13
|
|
10
|
-
neuronum-7.0.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|