naeural-client 2.6.9__py3-none-any.whl → 2.6.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/bc/base.py +5 -1
- naeural_client/const/base.py +3 -0
- {naeural_client-2.6.9.dist-info → naeural_client-2.6.11.dist-info}/METADATA +25 -41
- {naeural_client-2.6.9.dist-info → naeural_client-2.6.11.dist-info}/RECORD +8 -8
- {naeural_client-2.6.9.dist-info → naeural_client-2.6.11.dist-info}/WHEEL +0 -0
- {naeural_client-2.6.9.dist-info → naeural_client-2.6.11.dist-info}/entry_points.txt +0 -0
- {naeural_client-2.6.9.dist-info → naeural_client-2.6.11.dist-info}/licenses/LICENSE +0 -0
naeural_client/_ver.py
CHANGED
naeural_client/bc/base.py
CHANGED
@@ -1259,8 +1259,12 @@ class BaseBlockEngine:
|
|
1259
1259
|
response = requests.post(url, json={'body' : to_send})
|
1260
1260
|
if response.status_code == 200:
|
1261
1261
|
dct_response = response.json()
|
1262
|
+
server_alias = dct_response.get('result', {}).get('server_alias', 'unknown-alias')
|
1263
|
+
server_addr = dct_response.get('result', {}).get('EE_SENDER', 'unknown-address')
|
1262
1264
|
if debug:
|
1263
|
-
self.P(f"Response
|
1265
|
+
self.P(f"Response received from {server_alias} <{server_addr}>:\n {json.dumps(dct_response, indent=2)}")
|
1266
|
+
else:
|
1267
|
+
self.P(f"Response received from {server_alias} <{server_addr}>,")
|
1264
1268
|
dct_result = dct_response.get('result', {}).get(DAUTH_SUBKEY, {})
|
1265
1269
|
error = dct_response.get('error', None)
|
1266
1270
|
if error is not None:
|
naeural_client/const/base.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: naeural_client
|
3
|
-
Version: 2.6.
|
3
|
+
Version: 2.6.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
|
@@ -21,18 +21,18 @@ Requires-Dist: python-dateutil
|
|
21
21
|
Requires-Dist: web3
|
22
22
|
Description-Content-Type: text/markdown
|
23
23
|
|
24
|
-
# naeural_client SDK
|
24
|
+
# Ratio1 SDK (naeural_client SDK)
|
25
25
|
|
26
|
-
This is the Python SDK package that allows interactions, development and deployment of jobs in Naeural Edge Protocol network. The SDK enables low-code development and deployment of end-to-end AI (and not only) cooperative application pipelines within the
|
26
|
+
This is the Python SDK package that allows interactions, development and deployment of jobs in Ratio1 ecosystem formely known as Naeural Edge Protocol network. The SDK enables low-code development and deployment of end-to-end AI (and not only) cooperative application pipelines within the Ratio1 Edge Nodes ecosystem.
|
27
27
|
|
28
28
|
## Dependencies
|
29
29
|
|
30
|
-
This packet depends
|
30
|
+
This packet depends and will automatically install the following packets: `pika`, `paho-mqtt`, `numpy`, `pyopenssl>=23.0.0`, `cryptography>=39.0.0`, `python-dateutil`, `pyaml`.
|
31
31
|
|
32
32
|
## Installation
|
33
33
|
|
34
34
|
```shell
|
35
|
-
|
35
|
+
pip install naeural_client --upgrade
|
36
36
|
```
|
37
37
|
|
38
38
|
### Development installation
|
@@ -51,49 +51,33 @@ Code examples are located in the `tutorials` folder in the project's repository.
|
|
51
51
|
|
52
52
|
## Quick start guides
|
53
53
|
|
54
|
-
|
55
|
-
you started with the `naeural_client` SDK. These are only the most important aspects,
|
56
|
-
selected from the documentation and from the code examples. For more
|
57
|
-
in-depth information, please consult the examples from the repository
|
58
|
-
and the documentation.
|
54
|
+
Starting with version 2.6+ the SDK will automatically perform self-configuration using the dAuth - the Ratio1 decentralized self-authentication system.
|
59
55
|
|
60
|
-
|
56
|
+
In order to start a local edge node you just need to run:
|
61
57
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
- `Node == Worker` (Unless it is in the context of a distributed job, the 2 words refer to the same thing)
|
67
|
-
|
68
|
-
## Hello world tutorial
|
69
|
-
|
70
|
-
Below is a simple "Hello world!" style application that aims to show how simple and straightforward it is to distribute existing Python code to multiple edge node workers.
|
71
|
-
|
72
|
-
To execute this code, you can check [tutorials/video_presentation/1. hello_world.ipynb](./tutorials/video_presentation/1.%20hello_world.ipynb)
|
73
|
-
|
74
|
-
### 1. Create `.env` file
|
75
|
-
|
76
|
-
Copy the `tutorials/.example_env` file to your project directory and rename it to `.env`.
|
77
|
-
|
78
|
-
Fill in the empty variables with appropriate values.
|
79
|
-
|
80
|
-
### 2. Create new / Use test private key
|
81
|
-
|
82
|
-
**Disclaimer: You should never publish sensitive information such as private keys.**
|
83
|
-
|
84
|
-
To experiment on our test net, you can use the provided private key to communicate with the 3 nodes in the test network.
|
58
|
+
```bash
|
59
|
+
docker run -d --name=local_node naeural/edge_node:develop
|
60
|
+
```
|
61
|
+
after a few seconds the node will be online and you can get the node's address by running:
|
85
62
|
|
86
|
-
|
63
|
+
```bash
|
64
|
+
docker exec local_node get_node_info
|
65
|
+
```
|
87
66
|
|
88
|
-
|
67
|
+
The output will be similar to:
|
89
68
|
|
90
|
-
|
69
|
+
```json
|
70
|
+
{
|
71
|
+
"address": "0xai_AtMvIwaEPi5M8cnkdbaZ3tbUhCzKbGKEYuZ1xFtCjT_6",
|
72
|
+
"alias": "6dd74472642e",
|
73
|
+
"eth_address": "0x98FE7c0d8CeC2E97B932D2bDC1bb73B395C9Dfd7"
|
74
|
+
}
|
75
|
+
```
|
91
76
|
|
92
|
-
To use an existing private key, create in the working directory the directory tree `_local_cache/_data/` and add the `_pk_sdk.pem` file there.
|
93
77
|
|
94
|
-
|
78
|
+
## Some Examples
|
95
79
|
|
96
|
-
###
|
80
|
+
### Local Execution
|
97
81
|
|
98
82
|
We want to find all $168$ prime numbers in the interval $1$ - $1000$. For this we can run the following code on our local machine.
|
99
83
|
|
@@ -159,7 +143,7 @@ Because we want to find $168$ unique numbers, we append to the list of found pri
|
|
159
143
|
|
160
144
|
At the end, we want to show a list of all the numbers found.
|
161
145
|
|
162
|
-
###
|
146
|
+
### Remote Execution
|
163
147
|
|
164
148
|
For this example we would like to use multiple edge nodes to find the prime numbers faster.
|
165
149
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
naeural_client/__init__.py,sha256=YimqgDbjLuywsf8zCWE0EaUXH4MBUrqLxt0TDV558hQ,632
|
2
|
-
naeural_client/_ver.py,sha256=
|
2
|
+
naeural_client/_ver.py,sha256=DptYuPW6mJovNNYWBJDpDjURb7EaP7awqEvtRD_YvcE,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
|
@@ -14,7 +14,7 @@ naeural_client/base/webapp_pipeline.py,sha256=QmPLVmhP0CPdi0YuvbZEH4APYz2Amtw3gy
|
|
14
14
|
naeural_client/base/payload/__init__.py,sha256=y8fBI8tG2ObNfaXFWjyWZXwu878FRYj_I8GIbHT4GKE,29
|
15
15
|
naeural_client/base/payload/payload.py,sha256=x-au7l67Z_vfn_4R2C_pjZCaFuUVXHngJiGOfIAYVdE,2690
|
16
16
|
naeural_client/bc/__init__.py,sha256=FQj23D1PrY06NUOARiKQi4cdj0-VxnoYgYDEht8lpr8,158
|
17
|
-
naeural_client/bc/base.py,sha256=
|
17
|
+
naeural_client/bc/base.py,sha256=sBWApNp_9gm4IIgSTwfZpTyskI74sgS2fdls2fm2kOQ,35554
|
18
18
|
naeural_client/bc/chain.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
19
19
|
naeural_client/bc/ec.py,sha256=qI8l7YqiS4MNftlx-tF7IZUswrSeQc7KMn5OZ0fEaJs,23370
|
20
20
|
naeural_client/certs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -32,7 +32,7 @@ naeural_client/comm/mqtt_wrapper.py,sha256=Ig3bFZkCbWd4y_Whn2PPa91Z3aLgNbNPau6Tn
|
|
32
32
|
naeural_client/const/README.md,sha256=6OHesr-f5NBuuJGryEoi_TCu2XdlhfQYlDKx_IJoXeg,177
|
33
33
|
naeural_client/const/__init__.py,sha256=MM6Zib6i7M2qWcMkLtLx14zqU-lE-u2uPHjNvbh2jAM,478
|
34
34
|
naeural_client/const/apps.py,sha256=gIONTZUkqPveu3DwelyJWpbFMeIR9l6DlaNg-xEfK1A,611
|
35
|
-
naeural_client/const/base.py,sha256=
|
35
|
+
naeural_client/const/base.py,sha256=Lqe9SxlijYVWvRD3jS5ThforbWu7QUO0mTNGHp4XB2Q,4424
|
36
36
|
naeural_client/const/comms.py,sha256=La6JXWHexH8CfcBCKyT4fCIoeaoZlcm7KtZ57ab4ZgU,2201
|
37
37
|
naeural_client/const/environment.py,sha256=iytmTDgbOjvORPwHQmc0K0r-xJx7dnnzNnqAJJiFCDA,870
|
38
38
|
naeural_client/const/formatter.py,sha256=AW3bWlqf39uaqV4BBUuW95qKYfF2OkkU4f9hy3kSVhM,200
|
@@ -81,8 +81,8 @@ naeural_client/utils/__init__.py,sha256=mAnke3-MeRzz3nhQvhuHqLnpaaCSmDxicd7Ck9uw
|
|
81
81
|
naeural_client/utils/comm_utils.py,sha256=4cS9llRr_pK_3rNgDcRMCQwYPO0kcNU7AdWy_LtMyCY,1072
|
82
82
|
naeural_client/utils/config.py,sha256=v7xHikr6Z5Sbvf3opYeMhYzGWD2pe0HlRwa-aGJzUh8,6323
|
83
83
|
naeural_client/utils/dotenv.py,sha256=_AgSo35n7EnQv5yDyu7C7i0kHragLJoCGydHjvOkrYY,2008
|
84
|
-
naeural_client-2.6.
|
85
|
-
naeural_client-2.6.
|
86
|
-
naeural_client-2.6.
|
87
|
-
naeural_client-2.6.
|
88
|
-
naeural_client-2.6.
|
84
|
+
naeural_client-2.6.11.dist-info/METADATA,sha256=3k54h_N0eh40gxgXGgMUVYDouqYYMZhZ6PNGQE5Gs98,13176
|
85
|
+
naeural_client-2.6.11.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
86
|
+
naeural_client-2.6.11.dist-info/entry_points.txt,sha256=PNdyotDaQBAslZREx5luVyj0kqpQnwNACwkFNTPIHU4,55
|
87
|
+
naeural_client-2.6.11.dist-info/licenses/LICENSE,sha256=cvOsJVslde4oIaTCadabXnPqZmzcBO2f2zwXZRmJEbE,11311
|
88
|
+
naeural_client-2.6.11.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|