naeural-client 2.5.27__tar.gz → 2.5.28__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. {naeural_client-2.5.27 → naeural_client-2.5.28}/PKG-INFO +1 -1
  2. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/_ver.py +1 -1
  3. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/bc/ec.py +17 -3
  4. {naeural_client-2.5.27 → naeural_client-2.5.28}/pyproject.toml +1 -1
  5. {naeural_client-2.5.27 → naeural_client-2.5.28}/xperimental/eth/eth_sign.py +17 -31
  6. {naeural_client-2.5.27 → naeural_client-2.5.28}/.devcontainer/Dockerfile +0 -0
  7. {naeural_client-2.5.27 → naeural_client-2.5.28}/.devcontainer/devcontainer.json +0 -0
  8. {naeural_client-2.5.27 → naeural_client-2.5.28}/.gitattributes +0 -0
  9. {naeural_client-2.5.27 → naeural_client-2.5.28}/.github/workflows/python-publish.yml +0 -0
  10. {naeural_client-2.5.27 → naeural_client-2.5.28}/.gitignore +0 -0
  11. {naeural_client-2.5.27 → naeural_client-2.5.28}/.vscode/launch.json +0 -0
  12. {naeural_client-2.5.27 → naeural_client-2.5.28}/LICENSE +0 -0
  13. {naeural_client-2.5.27 → naeural_client-2.5.28}/README.md +0 -0
  14. {naeural_client-2.5.27 → naeural_client-2.5.28}/TODOs.md +0 -0
  15. {naeural_client-2.5.27 → naeural_client-2.5.28}/__init__.py +0 -0
  16. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/__init__.py +0 -0
  17. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/base/__init__.py +0 -0
  18. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/base/distributed_custom_code_presets.py +0 -0
  19. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/base/generic_session.py +0 -0
  20. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/base/instance.py +0 -0
  21. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/base/payload/__init__.py +0 -0
  22. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/base/payload/payload.py +0 -0
  23. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/base/pipeline.py +0 -0
  24. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/base/plugin_template.py +0 -0
  25. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/base/responses.py +0 -0
  26. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/base/transaction.py +0 -0
  27. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/base/webapp_pipeline.py +0 -0
  28. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/base_decentra_object.py +0 -0
  29. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/bc/__init__.py +0 -0
  30. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/bc/base.py +0 -0
  31. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/bc/chain.py +0 -0
  32. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/certs/__init__.py +0 -0
  33. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/certs/r9092118.ala.eu-central-1.emqxsl.com.crt +0 -0
  34. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/cli/README.md +0 -0
  35. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/cli/cli.py +0 -0
  36. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/cli/cli_commands.py +0 -0
  37. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/cli/nodes.py +0 -0
  38. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/code_cheker/__init__.py +0 -0
  39. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/code_cheker/base.py +0 -0
  40. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/code_cheker/checker.py +0 -0
  41. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/comm/__init__.py +0 -0
  42. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/comm/amqp_wrapper.py +0 -0
  43. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/comm/mqtt_wrapper.py +0 -0
  44. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/const/README.md +0 -0
  45. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/const/__init__.py +0 -0
  46. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/const/apps.py +0 -0
  47. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/const/base.py +0 -0
  48. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/const/comms.py +0 -0
  49. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/const/environment.py +0 -0
  50. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/const/formatter.py +0 -0
  51. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/const/heartbeat.py +0 -0
  52. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/const/misc.py +0 -0
  53. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/const/payload.py +0 -0
  54. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/default/__init__.py +0 -0
  55. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/default/instance/__init__.py +0 -0
  56. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/default/instance/chain_dist_custom_job_01_plugin.py +0 -0
  57. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/default/instance/custom_webapi_01_plugin.py +0 -0
  58. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/default/instance/net_mon_01_plugin.py +0 -0
  59. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/default/instance/telegram_basic_bot_01_plugin.py +0 -0
  60. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/default/instance/telegram_conversational_bot_01_plugin.py +0 -0
  61. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/default/instance/view_scene_01_plugin.py +0 -0
  62. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/default/session/mqtt_session.py +0 -0
  63. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/io_formatter/__init__.py +0 -0
  64. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/io_formatter/base/__init__.py +0 -0
  65. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/io_formatter/base/base_formatter.py +0 -0
  66. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/io_formatter/default/__init__.py +0 -0
  67. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/io_formatter/default/a_dummy.py +0 -0
  68. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/io_formatter/default/aixp1.py +0 -0
  69. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/io_formatter/default/default.py +0 -0
  70. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/io_formatter/io_formatter_manager.py +0 -0
  71. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/logging/__init__.py +0 -0
  72. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/logging/base_logger.py +0 -0
  73. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/logging/logger_mixins/__init__.py +0 -0
  74. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/logging/logger_mixins/class_instance_mixin.py +0 -0
  75. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/logging/logger_mixins/computer_vision_mixin.py +0 -0
  76. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/logging/logger_mixins/datetime_mixin.py +0 -0
  77. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/logging/logger_mixins/download_mixin.py +0 -0
  78. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/logging/logger_mixins/general_serialization_mixin.py +0 -0
  79. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/logging/logger_mixins/json_serialization_mixin.py +0 -0
  80. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/logging/logger_mixins/pickle_serialization_mixin.py +0 -0
  81. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/logging/logger_mixins/process_mixin.py +0 -0
  82. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/logging/logger_mixins/resource_size_mixin.py +0 -0
  83. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/logging/logger_mixins/timers_mixin.py +0 -0
  84. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/logging/logger_mixins/upload_mixin.py +0 -0
  85. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/logging/logger_mixins/utils_mixin.py +0 -0
  86. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/logging/small_logger.py +0 -0
  87. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/logging/tzlocal/__init__.py +0 -0
  88. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/logging/tzlocal/unix.py +0 -0
  89. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/logging/tzlocal/utils.py +0 -0
  90. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/logging/tzlocal/win32.py +0 -0
  91. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/logging/tzlocal/windows_tz.py +0 -0
  92. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/plugins_manager_mixin.py +0 -0
  93. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/utils/__init__.py +0 -0
  94. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/utils/comm_utils.py +0 -0
  95. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/utils/config.py +0 -0
  96. {naeural_client-2.5.27 → naeural_client-2.5.28}/naeural_client/utils/dotenv.py +0 -0
  97. {naeural_client-2.5.27 → naeural_client-2.5.28}/nepctl.MD +0 -0
  98. {naeural_client-2.5.27 → naeural_client-2.5.28}/requirements.txt +0 -0
  99. {naeural_client-2.5.27 → naeural_client-2.5.28}/tutorials/.example_env +0 -0
  100. {naeural_client-2.5.27 → naeural_client-2.5.28}/tutorials/8. custom_code_fastapi_assets/index.html +0 -0
  101. {naeural_client-2.5.27 → naeural_client-2.5.28}/tutorials/9. code_sandbox_from_scratch_assets/index.html +0 -0
  102. {naeural_client-2.5.27 → naeural_client-2.5.28}/tutorials/_example_pk_sdk.pem +0 -0
  103. {naeural_client-2.5.27 → naeural_client-2.5.28}/tutorials/ex01_part1_connect.py +0 -0
  104. {naeural_client-2.5.27 → naeural_client-2.5.28}/tutorials/ex01_part2_filter.py +0 -0
  105. {naeural_client-2.5.27 → naeural_client-2.5.28}/tutorials/ex01_part3_adv_filter.py +0 -0
  106. {naeural_client-2.5.27 → naeural_client-2.5.28}/tutorials/ex02_first_deploy.py +0 -0
  107. {naeural_client-2.5.27 → naeural_client-2.5.28}/tutorials/ex03_custom_code_on_one_remote__example_1.py +0 -0
  108. {naeural_client-2.5.27 → naeural_client-2.5.28}/tutorials/ex04_custom_code_on_one_remote__example_2.py +0 -0
  109. {naeural_client-2.5.27 → naeural_client-2.5.28}/tutorials/ex05_custom_code_on_one_remote__example_3.py +0 -0
  110. {naeural_client-2.5.27 → naeural_client-2.5.28}/tutorials/ex06_custom_code_on_multiple_remotes__example_1.py +0 -0
  111. {naeural_client-2.5.27 → naeural_client-2.5.28}/tutorials/ex07_custom_code_on_multiple_remotes__example_2.py +0 -0
  112. {naeural_client-2.5.27 → naeural_client-2.5.28}/tutorials/ex08_custom_webapi.py +0 -0
  113. {naeural_client-2.5.27 → naeural_client-2.5.28}/tutorials/ex09_code_sandbox_from_scratch.py +0 -0
  114. {naeural_client-2.5.27 → naeural_client-2.5.28}/tutorials/ex10_telegram_echo_bot.py +0 -0
  115. {naeural_client-2.5.27 → naeural_client-2.5.28}/tutorials/ex11_telegram_blackjack_bot.py +0 -0
  116. {naeural_client-2.5.27 → naeural_client-2.5.28}/tutorials/ex12_telegram_smart_bot.py +0 -0
  117. {naeural_client-2.5.27 → naeural_client-2.5.28}/tutorials/ex13_launch_repo_based_webapp.py +0 -0
  118. {naeural_client-2.5.27 → naeural_client-2.5.28}/tutorials/video_presentation/1. hello_world.ipynb +0 -0
  119. {naeural_client-2.5.27 → naeural_client-2.5.28}/winrun.bat +0 -0
  120. {naeural_client-2.5.27 → naeural_client-2.5.28}/xperimental/.example_env +0 -0
  121. {naeural_client-2.5.27 → naeural_client-2.5.28}/xperimental/_archive/test.py +0 -0
  122. {naeural_client-2.5.27 → naeural_client-2.5.28}/xperimental/_tutorials/3. simple_real_time_custom_code.py +0 -0
  123. {naeural_client-2.5.27 → naeural_client-2.5.28}/xperimental/_tutorials/4. real_time_custom_code_2.py +0 -0
  124. {naeural_client-2.5.27 → naeural_client-2.5.28}/xperimental/_tutorials/8. chatbot.py +0 -0
  125. {naeural_client-2.5.27 → naeural_client-2.5.28}/xperimental/check_local_keys/check1.py +0 -0
  126. {naeural_client-2.5.27 → naeural_client-2.5.28}/xperimental/decentralized/chain_dist_example.py +0 -0
  127. {naeural_client-2.5.27 → naeural_client-2.5.28}/xperimental/decentralized/chain_dist_example_initiator.py +0 -0
  128. {naeural_client-2.5.27 → naeural_client-2.5.28}/xperimental/decentralized/chain_dist_example_worker.py +0 -0
  129. {naeural_client-2.5.27 → naeural_client-2.5.28}/xperimental/enc_dec/enc_dec_test.py +0 -0
  130. {naeural_client-2.5.27 → naeural_client-2.5.28}/xperimental/eth/info.md +0 -0
  131. {naeural_client-2.5.27 → naeural_client-2.5.28}/xperimental/eth/sign.py +0 -0
  132. {naeural_client-2.5.27 → naeural_client-2.5.28}/xperimental/multi-enc-dec/multi_test1.py +0 -0
  133. {naeural_client-2.5.27 → naeural_client-2.5.28}/xperimental/multi-enc-dec/multi_test2.py +0 -0
  134. {naeural_client-2.5.27 → naeural_client-2.5.28}/xperimental/sign/test_sign1.py +0 -0
  135. {naeural_client-2.5.27 → naeural_client-2.5.28}/xperimental/utils/get_documentation.py +0 -0
  136. {naeural_client-2.5.27 → naeural_client-2.5.28}/xperimental/various/README.md +0 -0
  137. {naeural_client-2.5.27 → naeural_client-2.5.28}/xperimental/various/attach_example.py +0 -0
  138. {naeural_client-2.5.27 → naeural_client-2.5.28}/xperimental/various/ex1.py +0 -0
  139. {naeural_client-2.5.27 → naeural_client-2.5.28}/xperimental/various/hello.py +0 -0
  140. {naeural_client-2.5.27 → naeural_client-2.5.28}/xperimental/various/remote_exec.py +0 -0
  141. {naeural_client-2.5.27 → naeural_client-2.5.28}/xperimental/various/save_images.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: naeural_client
3
- Version: 2.5.27
3
+ Version: 2.5.28
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__ = "2.5.27"
1
+ __VER__ = "2.5.28"
2
2
 
3
3
  if __name__ == "__main__":
4
4
  with open("pyproject.toml", "rt") as fd:
@@ -766,6 +766,7 @@ class BaseBCEllipticCurveEngine(BaseBlockEngine):
766
766
  "signature": signed_message.signature.hex(),
767
767
  "signed_message": signed_message_hash.hex(),
768
768
  "sender" : self.eth_address,
769
+ "eth_signed_data" : types,
769
770
  }
770
771
 
771
772
  def eth_sign_text(self, message, signature_only=True):
@@ -794,14 +795,21 @@ class BaseBCEllipticCurveEngine(BaseBlockEngine):
794
795
 
795
796
 
796
797
 
797
- def eth_sign_node_epochs(self, node, epochs, epochs_vals, signature_only=True):
798
+ def eth_sign_node_epochs(
799
+ self,
800
+ node,
801
+ epochs,
802
+ epochs_vals,
803
+ signature_only=True,
804
+ use_evm_node_addr=True
805
+ ):
798
806
  """
799
807
  Signs the node availability
800
808
 
801
809
  Parameters
802
810
  ----------
803
811
  node : str
804
- The node address.
812
+ The node address to sign. Either the node address or the Ethereum address based on `use_evm_node_addr`.
805
813
 
806
814
  epochs : list of int
807
815
  The epochs to sign.
@@ -811,13 +819,19 @@ class BaseBCEllipticCurveEngine(BaseBlockEngine):
811
819
 
812
820
  signature_only : bool, optional
813
821
  Whether to return only the signature. The default is True.
822
+
823
+ use_evm_node_addr : bool, optional
824
+ Whether to use the Ethereum address of the node. The default is True.
814
825
 
815
826
  Returns
816
827
  -------
817
828
  str
818
829
  The signature of the message.
819
830
  """
820
- types = ["string", "uint256[]", "uint256[]"]
831
+ if use_evm_node_addr:
832
+ types = ["address", "uint256[]", "uint256[]"]
833
+ else:
834
+ types = ["string", "uint256[]", "uint256[]"]
821
835
  values = [node, epochs, epochs_vals]
822
836
  result = self.eth_sign_message(types, values)
823
837
  if signature_only:
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "naeural_client"
7
- version = "2.5.27"
7
+ version = "2.5.28"
8
8
  authors = [
9
9
  { name="Andrei Ionut Damian", email="andrei.damian@me.com" },
10
10
  { name="Cristan Bleotiu", email="cristibleotiu@gmail.com" },
@@ -35,40 +35,26 @@ if __name__ == '__main__' :
35
35
 
36
36
 
37
37
  node = "0xai_Amfnbt3N-qg2-qGtywZIPQBTVlAnoADVRmSAsdDhlQ-6"
38
+ node_eth = eng1.node_address_to_eth_address(node)
39
+ l.P("Node: {}\nNode Eth: {}".format(node, node_eth))
38
40
  epochs = [245, 246, 247, 248, 249, 250]
39
41
  epochs_vals = [124, 37, 30, 6, 19, 4]
42
+ USE_ETH_ADDR = True
43
+
44
+ if USE_ETH_ADDR:
45
+ types = ["address", "uint256[]", "uint256[]"]
46
+ node_data = node_eth
47
+ else:
48
+ types = ["string", "uint256[]", "uint256[]"]
49
+ node_data = node
50
+
51
+ values = [node_data, epochs, epochs_vals]
40
52
 
41
- types = ["string", "uint256[]", "uint256[]"]
42
- values = [node, epochs, epochs_vals]
43
-
44
-
45
- from web3 import Web3
46
- from eth_account import Account
47
- from eth_account.messages import encode_defunct
48
-
49
- message_hash = Web3.solidity_keccak(types, values)
50
- signable_message = encode_defunct(primitive=message_hash)
51
- signed_message = Account.sign_message(signable_message, private_key=private_key)
52
-
53
- results = {
54
- "sender" : eng1.eth_address,
55
- "message_hash": message_hash.hex(),
56
- "signature": signed_message.signature.hex(),
57
- "signed_message": signed_message.message_hash.hex(),
58
- }
59
- l.P("Signable message: {}".format(signable_message))
60
- l.P("Results:\n{}".format(json.dumps(results, indent=2)))
61
-
53
+
62
54
  s2 = eng1.eth_sign_message(types, values)
63
55
  l.P("Results:\n{}".format(json.dumps(s2, indent=2)))
64
- l.P("Signature: {}".format(eng1.eth_sign_node_epochs(node, epochs, epochs_vals)))
65
-
66
-
67
-
68
-
69
-
70
-
71
-
72
-
73
56
 
74
-
57
+ res = eng1.eth_sign_node_epochs(node_data, epochs, epochs_vals, signature_only=False, use_evm_node_addr=USE_ETH_ADDR)
58
+ eth_signature = res["signature"]
59
+ inputs = res["eth_signed_data"]
60
+ l.P(f"Results:\n Signature: {eth_signature}\n Inputs: {inputs}")
File without changes