naeural-client 3.0.5__tar.gz → 3.0.7__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.
Files changed (171) hide show
  1. {naeural_client-3.0.5 → naeural_client-3.0.7}/PKG-INFO +1 -1
  2. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/_ver.py +1 -1
  3. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/base/generic_session.py +25 -7
  4. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/base/instance.py +22 -2
  5. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/base/pipeline.py +39 -11
  6. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/ipfs/r1fs.py +3 -2
  7. {naeural_client-3.0.5 → naeural_client-3.0.7}/pyproject.toml +1 -1
  8. naeural_client-3.0.7/tutorials/ex02_part3_deploy_r1fs_test.py +59 -0
  9. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/_checks/web3_check.py +8 -4
  10. {naeural_client-3.0.5 → naeural_client-3.0.7}/.devcontainer/Dockerfile +0 -0
  11. {naeural_client-3.0.5 → naeural_client-3.0.7}/.devcontainer/devcontainer.json +0 -0
  12. {naeural_client-3.0.5 → naeural_client-3.0.7}/.gitattributes +0 -0
  13. {naeural_client-3.0.5 → naeural_client-3.0.7}/.github/workflows/python-publish.yml +0 -0
  14. {naeural_client-3.0.5 → naeural_client-3.0.7}/.gitignore +0 -0
  15. {naeural_client-3.0.5 → naeural_client-3.0.7}/.vscode/launch.json +0 -0
  16. {naeural_client-3.0.5 → naeural_client-3.0.7}/LICENSE +0 -0
  17. {naeural_client-3.0.5 → naeural_client-3.0.7}/README.md +0 -0
  18. {naeural_client-3.0.5 → naeural_client-3.0.7}/TODOs.md +0 -0
  19. {naeural_client-3.0.5 → naeural_client-3.0.7}/__init__.py +0 -0
  20. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/__init__.py +0 -0
  21. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/base/__init__.py +0 -0
  22. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/base/distributed_custom_code_presets.py +0 -0
  23. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/base/payload/__init__.py +0 -0
  24. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/base/payload/payload.py +0 -0
  25. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/base/plugin_template.py +0 -0
  26. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/base/responses.py +0 -0
  27. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/base/transaction.py +0 -0
  28. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/base/webapp_pipeline.py +0 -0
  29. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/base_decentra_object.py +0 -0
  30. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/bc/__init__.py +0 -0
  31. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/bc/base.py +0 -0
  32. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/bc/chain.py +0 -0
  33. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/bc/ec.py +0 -0
  34. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/bc/evm.py +0 -0
  35. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/certs/__init__.py +0 -0
  36. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/certs/r9092118.ala.eu-central-1.emqxsl.com.crt +0 -0
  37. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/certs/s624dbd4.ala.us-east-1.emqxsl.com.crt +0 -0
  38. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/cli/README.md +0 -0
  39. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/cli/cli.py +0 -0
  40. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/cli/cli_commands.py +0 -0
  41. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/cli/nodes.py +0 -0
  42. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/cli/oracles.py +0 -0
  43. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/code_cheker/__init__.py +0 -0
  44. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/code_cheker/base.py +0 -0
  45. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/code_cheker/checker.py +0 -0
  46. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/comm/__init__.py +0 -0
  47. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/comm/amqp_wrapper.py +0 -0
  48. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/comm/mqtt_wrapper.py +0 -0
  49. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/const/README.md +0 -0
  50. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/const/__init__.py +0 -0
  51. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/const/apps.py +0 -0
  52. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/const/base.py +0 -0
  53. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/const/comms.py +0 -0
  54. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/const/environment.py +0 -0
  55. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/const/evm_net.py +0 -0
  56. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/const/formatter.py +0 -0
  57. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/const/heartbeat.py +0 -0
  58. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/const/misc.py +0 -0
  59. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/const/payload.py +0 -0
  60. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/default/__init__.py +0 -0
  61. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/default/instance/__init__.py +0 -0
  62. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/default/instance/chain_dist_custom_job_01_plugin.py +0 -0
  63. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/default/instance/custom_webapi_01_plugin.py +0 -0
  64. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/default/instance/net_mon_01_plugin.py +0 -0
  65. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/default/instance/telegram_basic_bot_01_plugin.py +0 -0
  66. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/default/instance/telegram_conversational_bot_01_plugin.py +0 -0
  67. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/default/instance/view_scene_01_plugin.py +0 -0
  68. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/default/session/mqtt_session.py +0 -0
  69. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/io_formatter/__init__.py +0 -0
  70. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/io_formatter/base/__init__.py +0 -0
  71. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/io_formatter/base/base_formatter.py +0 -0
  72. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/io_formatter/default/__init__.py +0 -0
  73. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/io_formatter/default/a_dummy.py +0 -0
  74. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/io_formatter/default/aixp1.py +0 -0
  75. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/io_formatter/default/default.py +0 -0
  76. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/io_formatter/io_formatter_manager.py +0 -0
  77. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/ipfs/__init__.py +0 -0
  78. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/ipfs/ifps_keygen +0 -0
  79. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/ipfs/ipfs_setup/ipfs.service +0 -0
  80. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/ipfs/ipfs_setup/launch_service.sh +0 -0
  81. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/ipfs/ipfs_setup/restart.sh +0 -0
  82. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/ipfs/ipfs_setup/run.sh +0 -0
  83. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/ipfs/ipfs_setup/setup.sh +0 -0
  84. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/ipfs/ipfs_setup/show.sh +0 -0
  85. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/ipfs/ipfs_setup/write_key.sh +0 -0
  86. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/logging/__init__.py +0 -0
  87. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/logging/base_logger.py +0 -0
  88. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/logging/logger_mixins/__init__.py +0 -0
  89. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/logging/logger_mixins/class_instance_mixin.py +0 -0
  90. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/logging/logger_mixins/computer_vision_mixin.py +0 -0
  91. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/logging/logger_mixins/datetime_mixin.py +0 -0
  92. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/logging/logger_mixins/download_mixin.py +0 -0
  93. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/logging/logger_mixins/general_serialization_mixin.py +0 -0
  94. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/logging/logger_mixins/json_serialization_mixin.py +0 -0
  95. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/logging/logger_mixins/pickle_serialization_mixin.py +0 -0
  96. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/logging/logger_mixins/process_mixin.py +0 -0
  97. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/logging/logger_mixins/resource_size_mixin.py +0 -0
  98. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/logging/logger_mixins/timers_mixin.py +0 -0
  99. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/logging/logger_mixins/upload_mixin.py +0 -0
  100. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/logging/logger_mixins/utils_mixin.py +0 -0
  101. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/logging/small_logger.py +0 -0
  102. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/logging/tzlocal/__init__.py +0 -0
  103. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/logging/tzlocal/unix.py +0 -0
  104. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/logging/tzlocal/utils.py +0 -0
  105. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/logging/tzlocal/win32.py +0 -0
  106. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/logging/tzlocal/windows_tz.py +0 -0
  107. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/plugins_manager_mixin.py +0 -0
  108. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/utils/__init__.py +0 -0
  109. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/utils/comm_utils.py +0 -0
  110. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/utils/config.py +0 -0
  111. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/utils/dotenv.py +0 -0
  112. {naeural_client-3.0.5 → naeural_client-3.0.7}/naeural_client/utils/oracle_sync/oracle_tester.py +0 -0
  113. {naeural_client-3.0.5 → naeural_client-3.0.7}/nepctl.MD +0 -0
  114. {naeural_client-3.0.5 → naeural_client-3.0.7}/requirements.txt +0 -0
  115. {naeural_client-3.0.5 → naeural_client-3.0.7}/tutorials/.example_env +0 -0
  116. {naeural_client-3.0.5 → naeural_client-3.0.7}/tutorials/8. custom_code_fastapi_assets/index.html +0 -0
  117. {naeural_client-3.0.5 → naeural_client-3.0.7}/tutorials/9. code_sandbox_from_scratch_assets/index.html +0 -0
  118. {naeural_client-3.0.5 → naeural_client-3.0.7}/tutorials/_example_pk_sdk.pem +0 -0
  119. {naeural_client-3.0.5 → naeural_client-3.0.7}/tutorials/ex01_part1_connect.py +0 -0
  120. {naeural_client-3.0.5 → naeural_client-3.0.7}/tutorials/ex01_part2_filter.py +0 -0
  121. {naeural_client-3.0.5 → naeural_client-3.0.7}/tutorials/ex01_part3_adv_filter.py +0 -0
  122. {naeural_client-3.0.5 → naeural_client-3.0.7}/tutorials/ex02_part1_deploy_webapi.py +0 -0
  123. {naeural_client-3.0.5 → naeural_client-3.0.7}/tutorials/ex02_part2_deploy_plugin.py +0 -0
  124. {naeural_client-3.0.5 → naeural_client-3.0.7}/tutorials/ex03_custom_code_on_one_remote__example_1.py +0 -0
  125. {naeural_client-3.0.5 → naeural_client-3.0.7}/tutorials/ex04_custom_code_on_one_remote__example_2.py +0 -0
  126. {naeural_client-3.0.5 → naeural_client-3.0.7}/tutorials/ex05_custom_code_on_one_remote__example_3.py +0 -0
  127. {naeural_client-3.0.5 → naeural_client-3.0.7}/tutorials/ex06_custom_code_on_multiple_remotes__example_1.py +0 -0
  128. {naeural_client-3.0.5 → naeural_client-3.0.7}/tutorials/ex07_custom_code_on_multiple_remotes__example_2.py +0 -0
  129. {naeural_client-3.0.5 → naeural_client-3.0.7}/tutorials/ex08_custom_webapi.py +0 -0
  130. {naeural_client-3.0.5 → naeural_client-3.0.7}/tutorials/ex09_code_sandbox_from_scratch.py +0 -0
  131. {naeural_client-3.0.5 → naeural_client-3.0.7}/tutorials/ex10_telegram_echo_bot.py +0 -0
  132. {naeural_client-3.0.5 → naeural_client-3.0.7}/tutorials/ex11_telegram_blackjack_bot.py +0 -0
  133. {naeural_client-3.0.5 → naeural_client-3.0.7}/tutorials/ex12_telegram_smart_bot.py +0 -0
  134. {naeural_client-3.0.5 → naeural_client-3.0.7}/tutorials/ex13_launch_repo_based_webapp.py +0 -0
  135. {naeural_client-3.0.5 → naeural_client-3.0.7}/tutorials/video_presentation/1. hello_world.ipynb +0 -0
  136. {naeural_client-3.0.5 → naeural_client-3.0.7}/winrun.bat +0 -0
  137. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/README.md +0 -0
  138. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/_checks/cstore_check.py +0 -0
  139. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/_checks/dauth_check.py +0 -0
  140. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/_checks/keys_check.py +0 -0
  141. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/_checks/ora_check.py +0 -0
  142. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/_checks/ora_sign_check.py +0 -0
  143. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/_checks/payload_check.py +0 -0
  144. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/_checks/session_check.py +0 -0
  145. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/dates/check_date.py +0 -0
  146. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/debug/close_pipeline.py +0 -0
  147. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/decentralized/chain_dist_example.py +0 -0
  148. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/decentralized/chain_dist_example_initiator.py +0 -0
  149. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/decentralized/chain_dist_example_worker.py +0 -0
  150. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/enc_dec/enc_dec_test.py +0 -0
  151. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/eth/eth_sign.py +0 -0
  152. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/eth/info.md +0 -0
  153. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/eth/sign.py +0 -0
  154. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/multi-enc-dec/multi_test1.py +0 -0
  155. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/multi-enc-dec/multi_test2.py +0 -0
  156. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/pipelines/start.py +0 -0
  157. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/pipelines/stop.py +0 -0
  158. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/sign/simple_payload_checker.py +0 -0
  159. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/sign/test_sign1.py +0 -0
  160. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/sign/test_sign2.py +0 -0
  161. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/utils/get_documentation.py +0 -0
  162. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/various/attach_example.py +0 -0
  163. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/various/ex1.py +0 -0
  164. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/various/hello.py +0 -0
  165. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/various/remote_exec.py +0 -0
  166. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/various/save_images.py +0 -0
  167. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/wl/wl_add.py +0 -0
  168. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/xarchive/_tutorials/3. simple_real_time_custom_code.py +0 -0
  169. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/xarchive/_tutorials/4. real_time_custom_code_2.py +0 -0
  170. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/xarchive/_tutorials/8. chatbot.py +0 -0
  171. {naeural_client-3.0.5 → naeural_client-3.0.7}/xperimental/xarchive/test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: naeural_client
3
- Version: 3.0.5
3
+ Version: 3.0.7
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,4 +1,4 @@
1
- __VER__ = "3.0.5"
1
+ __VER__ = "3.0.7"
2
2
 
3
3
  if __name__ == "__main__":
4
4
  with open("pyproject.toml", "rt") as fd:
@@ -89,7 +89,7 @@ class GenericSession(BaseDecentrAIObject):
89
89
  on_notification=None,
90
90
  on_heartbeat=None,
91
91
  debug_silent=True,
92
- debug=False,
92
+ debug=1,
93
93
  silent=False,
94
94
  verbosity=1,
95
95
  dotenv_path=None,
@@ -145,6 +145,7 @@ class GenericSession(BaseDecentrAIObject):
145
145
  As arguments, it has a reference to this Session object, the node name, the pipeline, signature and instance, and the payload.
146
146
  This callback acts as a default payload processor and will be called even if for a given instance
147
147
  the user has defined a specific callback.
148
+
148
149
  on_notification : Callable[[Session, str, dict], None], optional
149
150
  Callback that handles notifications received from this network.
150
151
  As arguments, it has a reference to this Session object, the node name and the notification payload.
@@ -153,6 +154,7 @@ class GenericSession(BaseDecentrAIObject):
153
154
  This callback will be called when there are notifications related to the node itself, e.g. when the node runs
154
155
  low on memory.
155
156
  Defaults to None.
157
+
156
158
  on_heartbeat : Callable[[Session, str, dict], None], optional
157
159
  Callback that handles heartbeats received from this network.
158
160
  As arguments, it has a reference to this Session object, the node name and the heartbeat payload.
@@ -162,8 +164,12 @@ class GenericSession(BaseDecentrAIObject):
162
164
  This flag will disable debug logs, set to 'False` for a more verbose log, by default True
163
165
  Observation: Obsolete, will be removed
164
166
 
165
- debug : bool, optional
166
- This flag will enable debug logs, set to 'False` for a more verbose log, by default False
167
+ debug : bool or int, optional
168
+ This flag will enable debug logs, set to 'True` or 2 for a more verbose log, by default 1
169
+ - 0 or False will disable debug logs
170
+ - 1 will enable level 1
171
+ - 2 will enable full debug
172
+
167
173
 
168
174
 
169
175
  silent : bool, optional
@@ -185,8 +191,11 @@ class GenericSession(BaseDecentrAIObject):
185
191
  If True, the SDK will use the home folder as the base folder for the local cache.
186
192
  NOTE: if you need to use development style ./_local_cache, set this to False.
187
193
  """
188
-
189
194
  debug = debug or not debug_silent
195
+ if isinstance(debug, bool):
196
+ debug = 2 if debug else 0
197
+
198
+ self.__debug = int(debug) > 0
190
199
 
191
200
  self.__at_least_one_node_peered = False
192
201
  self.__at_least_a_netmon_received = False
@@ -278,13 +287,20 @@ class GenericSession(BaseDecentrAIObject):
278
287
 
279
288
  super(GenericSession, self).__init__(
280
289
  log=log,
281
- DEBUG=debug,
290
+ DEBUG=int(debug) > 1,
282
291
  create_logger=True,
283
292
  silent=self.silent,
284
293
  local_cache_base_folder=local_cache_base_folder,
285
294
  local_cache_app_folder=local_cache_app_folder,
286
295
  )
287
296
  return
297
+
298
+ def Pd(self, *args, **kwargs):
299
+ if self.__debug:
300
+ kwargs["color"] = 'd' if kwargs.get("color") != 'r' else 'r'
301
+ self.log.P(*args, **kwargs)
302
+ return
303
+
288
304
 
289
305
  def startup(self):
290
306
  ## 1st config step - we prepare config via ~/.naeural/config or .env
@@ -830,7 +846,7 @@ class GenericSession(BaseDecentrAIObject):
830
846
  if needs_netconfig:
831
847
  lst_netconfig_request.append(node_addr)
832
848
  # end for each node in network map
833
- self.P(f"Net mon from <{sender_addr}> `{ee_id}`: {len(online_addresses)}/{len(all_addresses)}", color='y')
849
+ self.Pd(f"Net mon from <{sender_addr}> `{ee_id}`: {len(online_addresses)}/{len(all_addresses)}")
834
850
  if len(lst_netconfig_request) > 0:
835
851
  self.__request_pipelines_from_net_config_monitor(lst_netconfig_request)
836
852
  # end if needs netconfig
@@ -1607,7 +1623,7 @@ class GenericSession(BaseDecentrAIObject):
1607
1623
  )
1608
1624
  self.bc_engine.sign(msg_to_send, use_digest=True)
1609
1625
  if show_command:
1610
- self.P(
1626
+ self.Pd(
1611
1627
  "Sending command '{}' to '{}':\n{}".format(command, worker, json.dumps(msg_to_send, indent=2)),
1612
1628
  color='y',
1613
1629
  verbosity=1
@@ -1778,6 +1794,7 @@ class GenericSession(BaseDecentrAIObject):
1778
1794
  on_notification=None,
1779
1795
  max_wait_time=0,
1780
1796
  pipeline_type=None,
1797
+ debug=False,
1781
1798
  **kwargs) -> Pipeline:
1782
1799
  """
1783
1800
  Create a new pipeline on a node. A pipeline is the equivalent of the "config file" used by the Naeural Edge Protocol edge node team internally.
@@ -1857,6 +1874,7 @@ class GenericSession(BaseDecentrAIObject):
1857
1874
  on_data=on_data,
1858
1875
  on_notification=on_notification,
1859
1876
  is_attached=False,
1877
+ debug=debug,
1860
1878
  **kwargs
1861
1879
  )
1862
1880
  self.own_pipelines.append(pipeline)
@@ -9,7 +9,19 @@ class Instance():
9
9
  The Instance class is a wrapper around a plugin instance. It provides a simple API for sending commands to the instance and updating its configuration.
10
10
  """
11
11
 
12
- def __init__(self, log, pipeline, instance_id, signature, on_data=None, on_notification=None, config={}, is_attached=False, **kwargs):
12
+ def __init__(
13
+ self,
14
+ log,
15
+ pipeline,
16
+ instance_id,
17
+ signature,
18
+ on_data=None,
19
+ on_notification=None,
20
+ config={},
21
+ is_attached=False,
22
+ debug=False,
23
+ **kwargs
24
+ ):
13
25
  """
14
26
  Create a new instance of the plugin.
15
27
 
@@ -39,6 +51,7 @@ class Instance():
39
51
  self.instance_id = instance_id
40
52
  self.signature = signature.upper()
41
53
  self.config = {}
54
+ self.__debug = debug
42
55
 
43
56
  if is_attached:
44
57
  assert len(kwargs) == 0, "When attaching an instance, no additional parameters are allowed"
@@ -61,6 +74,12 @@ class Instance():
61
74
  self.on_notification_callbacks.append(on_notification)
62
75
 
63
76
  return
77
+
78
+ def Pd(self, *args, **kwargs):
79
+ if self.__debug:
80
+ kwargs["color"] = 'd' if kwargs.get("color") != 'r' else 'r'
81
+ self.log.P(*args, **kwargs)
82
+ return
64
83
 
65
84
  # Message handling
66
85
  if True:
@@ -75,6 +94,7 @@ class Instance():
75
94
  data : dict | Payload
76
95
  The data received from the instance
77
96
  """
97
+ self.Pd(f"_on_data: {pipeline.name}:{self.signature}:{self.instance_id}")
78
98
  for callback in self.on_data_callbacks:
79
99
  callback(pipeline, data)
80
100
  for callback in self.temporary_on_data_callbacks.values():
@@ -503,7 +523,7 @@ class Instance():
503
523
  The list of transactions generated, or None if `wait_confirmation` is False.
504
524
 
505
525
  """
506
- self.P(f'Sending command <{command}> to instance <{self.__repr__()}>', color="b")
526
+ self.Pd(f'Sending command <{command}> to instance <{self.__repr__()}>', color="b")
507
527
 
508
528
  self.__was_last_operation_successful = None
509
529
 
@@ -40,6 +40,7 @@ class Pipeline(BaseCodeChecker):
40
40
  on_notification=None,
41
41
  is_attached=False,
42
42
  existing_config=None,
43
+ debug=False,
43
44
  **kwargs
44
45
  ) -> None:
45
46
  """
@@ -99,6 +100,7 @@ class Pipeline(BaseCodeChecker):
99
100
  self.session = session
100
101
  self.node_addr = node_addr
101
102
  self.name = name
103
+ self.__debug = debug
102
104
 
103
105
  self.config = {}
104
106
  plugins = config.pop('PLUGINS', plugins)
@@ -148,10 +150,28 @@ class Pipeline(BaseCodeChecker):
148
150
 
149
151
  self.__init_plugins(plugins, is_attached)
150
152
  return
153
+
154
+ def Pd(self, *args, **kwargs):
155
+ """
156
+ Print debug message.
157
+ """
158
+ if self.__debug:
159
+ kwargs["color"] = 'd' if kwargs.get("color") != 'r' else 'r'
160
+ self.P(*args, **kwargs)
161
+ return
151
162
 
152
163
  # Utils
153
164
  if True:
154
- def __init_instance(self, signature, instance_id, config, on_data, on_notification, is_attached):
165
+ def __init_instance(
166
+ self,
167
+ signature,
168
+ instance_id,
169
+ config,
170
+ on_data,
171
+ on_notification,
172
+ is_attached,
173
+ debug=False,
174
+ ):
155
175
  instance_class = None
156
176
  str_signature = None
157
177
  if isinstance(signature, str):
@@ -160,15 +180,17 @@ class Pipeline(BaseCodeChecker):
160
180
  else:
161
181
  instance_class = signature
162
182
  str_signature = instance_class.signature.upper()
163
- instance = instance_class(self.log,
164
- pipeline=self,
165
- signature=str_signature,
166
- instance_id=instance_id,
167
- config=config,
168
- on_data=on_data,
169
- on_notification=on_notification,
170
- is_attached=is_attached
171
- )
183
+ instance = instance_class(
184
+ self.log,
185
+ pipeline=self,
186
+ signature=str_signature,
187
+ instance_id=instance_id,
188
+ config=config,
189
+ on_data=on_data,
190
+ on_notification=on_notification,
191
+ is_attached=is_attached,
192
+ debug=debug,
193
+ )
172
194
  self.lst_plugin_instances.append(instance)
173
195
  return instance
174
196
 
@@ -710,6 +732,7 @@ class Pipeline(BaseCodeChecker):
710
732
  The payload of the message.
711
733
  """
712
734
  # call all self callbacks
735
+ self.Pd(f"Pipeline <{self.name}> received data from <{signature}:{instance_id}>")
713
736
  for callback in self.on_data_callbacks:
714
737
  callback(self, signature, instance_id, data)
715
738
 
@@ -834,6 +857,7 @@ class Pipeline(BaseCodeChecker):
834
857
  config={},
835
858
  on_data=None,
836
859
  on_notification=None,
860
+ debug=False,
837
861
  **kwargs
838
862
  ) -> Instance:
839
863
  """
@@ -884,7 +908,11 @@ class Pipeline(BaseCodeChecker):
884
908
 
885
909
  # create the new instance and add it to the list
886
910
  config = {**config, **kwargs}
887
- instance = self.__init_instance(signature, instance_id, config, on_data, on_notification, is_attached=False)
911
+ instance = self.__init_instance(
912
+ signature=signature, instance_id=instance_id, config=config,
913
+ on_data=on_data, on_notification=on_notification, is_attached=False,
914
+ debug=debug
915
+ )
888
916
  return instance
889
917
 
890
918
  def __remove_plugin_instance(self, instance):
@@ -268,8 +268,8 @@ class R1FSEngine:
268
268
 
269
269
  def _get_unique_or_complete_upload_name(self, fn=None, prefix="r1fs", suffix=""):
270
270
  if fn is not None and os.path.dirname(fn) == "":
271
- return os.path.join(self.__uploads_dir, fn)
272
- return self._get_unique_upload_name(prefix, suffix)
271
+ return os.path.join(self.__uploads_dir, f"{fn}{suffix}")
272
+ return self._get_unique_upload_name(prefix, suffix=suffix)
273
273
 
274
274
  def __set_reprovider_interval(self):
275
275
  # Command to set the Reprovider.Interval to 1 minute
@@ -566,6 +566,7 @@ class R1FSEngine:
566
566
  msg += f"\n Download: {self.__downloads_dir}"
567
567
  msg += f"\n Upload: {self.__uploads_dir}"
568
568
  msg += f"\n SwarmKey: {hidden_base64_swarm_key}"
569
+ msg += f"\n Debug: {self.__debug}"
569
570
  self.P(msg, color='d')
570
571
 
571
572
  ipfs_repo = os.path.expanduser("~/.ipfs")
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "naeural_client"
7
- version = "3.0.5"
7
+ version = "3.0.7"
8
8
  authors = [
9
9
  { name="Andrei Ionut Damian", email="andrei.damian@me.com" },
10
10
  { name="Cristan Bleotiu", email="cristibleotiu@gmail.com" },
@@ -0,0 +1,59 @@
1
+ import json
2
+ from naeural_client import Instance, Payload, Pipeline, Session, PAYLOAD_DATA
3
+
4
+ def instance_on_data(pipeline: Pipeline, payload: Payload):
5
+ # we extract the payload and do a minimal processing
6
+ # this is the payload key sent by the demo plugin
7
+ R1FS_DEMO_DATA_KEY = "R1FS_DATA"
8
+ # next convert to the data object for convenience
9
+ data = payload.data
10
+ # then we extract the sender alias directly from the payload
11
+ sender_alias = data[PAYLOAD_DATA.EE_ID]
12
+ # we extract the r1fs data if it is present
13
+ r1fs_data = data.get(R1FS_DEMO_DATA_KEY)
14
+ if r1fs_data is None:
15
+ # we ignore the payload if the data is not present
16
+ return
17
+ # then we extract the R1FS file originator (creator) from the demo data
18
+ read_file_originator = r1fs_data["owner_id"]
19
+ # we print the data
20
+ pipeline.P("Data received from worker '{}' from file created by '{}':\n {}".format(
21
+ sender_alias, read_file_originator, json.dumps(r1fs_data, indent=2)
22
+ ))
23
+ return
24
+
25
+ if __name__ == '__main__':
26
+
27
+ session: Session = Session()
28
+
29
+ # this code assumes the node have "allowed" the SDK to deploy the pipeline
30
+ nodes = [
31
+ '0xai_A2LfyeItL5oEp7nHONlczGgwS3SV8Ims9ujJ0soJ6Anx',
32
+ '0xai_AqgKnJMNvUvq5n1wIin_GD2i1FbZ4FBTUJaCI6cWf7i4',
33
+ ]
34
+
35
+ for node in nodes:
36
+ session.P(f"Deploying pipeline to node: {node}")
37
+ session.wait_for_node(node) # we wait for the node to be ready
38
+ pipeline: Pipeline = session.create_pipeline(
39
+ node=node, name='r1fs_demo_pipeline', data_source='Void',
40
+ debug=True,
41
+ )
42
+ # The ideea is that we create a plugin instance that listens for data
43
+ # on ChainStorage from other plugins/nodes that create R1FS demo files
44
+ # while itself also creating R1FS demo files
45
+ instance: Instance = pipeline.create_plugin_instance(
46
+ signature='R1FS_DEMO', on_data=instance_on_data,
47
+ instance_id='inst01',
48
+ debug=True,
49
+ )
50
+
51
+ pipeline.deploy()
52
+ WAIT_TIME = 150
53
+ session.P(f"All pipelines deployed, we wait for {WAIT_TIME} seconds...")
54
+ session.wait(
55
+ seconds=WAIT_TIME, # we wait the session for 60 seconds
56
+ close_pipelines=True, # we close the pipelines after the session
57
+ close_session=True, # we close the session after the session
58
+ )
59
+ session.P("Main thread exiting...")
@@ -1,4 +1,4 @@
1
-
1
+ import os
2
2
  import json
3
3
 
4
4
 
@@ -9,6 +9,9 @@ from naeural_client.utils.config import get_user_folder
9
9
 
10
10
 
11
11
  if __name__ == '__main__' :
12
+
13
+ os.environ["EE_EVM_NET"] = "devnet"
14
+
12
15
  l = Logger(
13
16
  "ENC", base_folder=str(get_user_folder()),
14
17
  app_folder="_local_cache"
@@ -20,7 +23,7 @@ if __name__ == '__main__' :
20
23
  }
21
24
  )
22
25
 
23
- network = None
26
+
24
27
  addresses = [
25
28
  "0xE486F0d594e9F26931fC10c29E6409AEBb7b5144",
26
29
  "0x93B04EF1152D81A0847C2272860a8a5C70280E14",
@@ -30,7 +33,7 @@ if __name__ == '__main__' :
30
33
 
31
34
  for addr in addresses:
32
35
  is_active = eng.web3_is_node_licensed(
33
- address=addr, network=network, debug=True
36
+ address=addr, debug=True
34
37
  )
35
38
  l.P("{} {}".format(
36
39
  addr,
@@ -39,7 +42,7 @@ if __name__ == '__main__' :
39
42
  color='g' if is_active else 'r'
40
43
  )
41
44
 
42
- oracles = eng.web3_get_oracles(network=network, debug=True)
45
+ oracles = eng.web3_get_oracles(debug=True)
43
46
  l.P("\nOracles:\n {}".format(json.dumps(oracles, indent=2)),
44
47
  color='b'
45
48
  )
@@ -47,6 +50,7 @@ if __name__ == '__main__' :
47
50
  supervisors = [
48
51
  "0xai_AleLPKqUHV-iPc-76-rUvDkRWW4dFMIGKW1xFVcy65nH",
49
52
  "0xai_A-Bn9grkqH1GUMTZUqHNzpX5DA6PqducH9_JKAlBx6YL",
53
+ "0xai_AmT2Tz230aZtNFh3ruOr7rN3KHuAcByOEPmZ-Qa8Km4A"
50
54
  ]
51
55
 
52
56
  for supervisor in supervisors:
File without changes
File without changes
File without changes
File without changes