ratio1 3.4.81__py3-none-any.whl → 3.4.83__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.
ratio1/_ver.py CHANGED
@@ -1,4 +1,4 @@
1
- __VER__ = "3.4.81"
1
+ __VER__ = "3.4.83"
2
2
 
3
3
  if __name__ == "__main__":
4
4
  with open("pyproject.toml", "rt") as fd:
ratio1/const/evm_net.py CHANGED
@@ -33,6 +33,8 @@ class EvmNetConstants:
33
33
  NET_CONFIG_MONITOR_SHOW_EACH_KEY = 'NET_CONFIG_MONITOR_SHOW_EACH'
34
34
  SEED_NODES_ADDRESSES_KEY = 'SEED_NODES_ADDRESSES' # This is a list of seed nodes for the network, used for initial connections.
35
35
  EE_ORACLE_SYNC_USE_R1FS_KEY = 'EE_ORACLE_SYNC_USE_R1FS' # This is a boolean flag to use R1FS for oracle sync.
36
+ ORACLE_SYNC_BLOCKCHAIN_PRESENCE_MIN_THRESHOLD_KEY = 'ORACLE_SYNC_BLOCKCHAIN_PRESENCE_MIN_THRESHOLD'
37
+ ORACLE_SYNC_ONLINE_PRESENCE_MIN_THRESHOLD_KEY = 'ORACLE_SYNC_ONLINE_PRESENCE_MIN_THRESHOLD'
36
38
  # endclass EvmNetConstants
37
39
 
38
40
 
@@ -493,6 +495,8 @@ EVM_NET_CONSTANTS = {
493
495
  "0xai_AgNhMIJZkkWdrTjnmrqdOa6hzAXkoXPNV4Zbvbm_piYJ", # r1s-04
494
496
  ],
495
497
  EvmNetConstants.EE_ORACLE_SYNC_USE_R1FS_KEY: False, # Do not use R1FS for oracle sync in mainnet.
498
+ EvmNetConstants.ORACLE_SYNC_BLOCKCHAIN_PRESENCE_MIN_THRESHOLD_KEY: 0.3,
499
+ EvmNetConstants.ORACLE_SYNC_ONLINE_PRESENCE_MIN_THRESHOLD_KEY: 0.4,
496
500
  },
497
501
  EvmNetData.TESTNET: {
498
502
  EvmNetConstants.EE_NET_MON_01_SUPERVISOR_LOG_TIME_KEY: 120, # Log every 2 minutes.
@@ -502,6 +506,8 @@ EVM_NET_CONSTANTS = {
502
506
  "0xai_A61eKDV1otIH6uWy3zDlbJNJUWayp1jAsirOuYxztf82", # tr1s-02
503
507
  ],
504
508
  EvmNetConstants.EE_ORACLE_SYNC_USE_R1FS_KEY: False, # Do not use R1FS for oracle sync in testnet.
509
+ EvmNetConstants.ORACLE_SYNC_BLOCKCHAIN_PRESENCE_MIN_THRESHOLD_KEY: 0.3,
510
+ EvmNetConstants.ORACLE_SYNC_ONLINE_PRESENCE_MIN_THRESHOLD_KEY: 0.4,
505
511
  },
506
512
  EvmNetData.DEVNET: {
507
513
  EvmNetConstants.EE_NET_MON_01_SUPERVISOR_LOG_TIME_KEY: 60, # Log every minute.
@@ -511,6 +517,8 @@ EVM_NET_CONSTANTS = {
511
517
  "0xai_AgnygSlY8BwnmaCj6mItg36JHlG_Lh3UqqFaTPbuNzy0", # dr1s-02
512
518
  ],
513
519
  EvmNetConstants.EE_ORACLE_SYNC_USE_R1FS_KEY: True, # Use R1FS for oracle sync in devnet.
520
+ EvmNetConstants.ORACLE_SYNC_BLOCKCHAIN_PRESENCE_MIN_THRESHOLD_KEY: 0.15,
521
+ EvmNetConstants.ORACLE_SYNC_ONLINE_PRESENCE_MIN_THRESHOLD_KEY: 0.2,
514
522
  },
515
523
  }
516
524
 
ratio1/ipfs/r1fs.py CHANGED
@@ -67,6 +67,7 @@ from io import BytesIO
67
67
  import ssl
68
68
  from requests.auth import HTTPBasicAuth
69
69
  import tempfile
70
+ import random
70
71
 
71
72
  from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
72
73
 
@@ -739,9 +740,10 @@ class R1FSEngine:
739
740
  def add_file(
740
741
  self,
741
742
  file_path: str,
743
+ nonce: int = None,
742
744
  secret: str = None,
743
745
  raise_on_error: bool = False,
744
- show_logs: bool = True
746
+ show_logs: bool = True,
745
747
  ) -> str:
746
748
  """
747
749
  Add a file to R1FS with default encryption. The secret parameter is mandatory,
@@ -797,7 +799,12 @@ class R1FSEngine:
797
799
  raise ValueError(f"File {file_path} is too large ({file_size} bytes). Maximum allowed size is 2 GB.")
798
800
 
799
801
  key = self._hash_secret(secret) # mandatory passphrase
800
- nonce = os.urandom(12) # recommended for GCM
802
+
803
+ if nonce is None:
804
+ nonce = os.urandom(12) # recommended for GCM
805
+ else:
806
+ nonce = random.Random(nonce).randbytes(12)
807
+
801
808
  original_basename = os.path.basename(file_path)
802
809
 
803
810
  # JSON metadata storing the original filename
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ratio1
3
- Version: 3.4.81
3
+ Version: 3.4.83
4
4
  Summary: `ratio1` or Ration1 SDK is the Python SDK required for client app development for the Ratio1 ecosystem
5
5
  Project-URL: Homepage, https://github.com/Ratio1/ratio1_sdk
6
6
  Project-URL: Bug Tracker, https://github.com/Ratio1/ratio1_sdk/issues
@@ -1,5 +1,5 @@
1
1
  ratio1/__init__.py,sha256=YimqgDbjLuywsf8zCWE0EaUXH4MBUrqLxt0TDV558hQ,632
2
- ratio1/_ver.py,sha256=KeoLTqnSZE2Q4K2UU8cEo0bevuX2ihXEf8XEorKWuPw,331
2
+ ratio1/_ver.py,sha256=mac3IZOHBuyzh21Zy6zfHy5QePvpY5IixaEnXA0UTHA,331
3
3
  ratio1/base_decentra_object.py,sha256=iXvAAf6wPnGWzeeiRfwLojVoan-m1e_VsyPzjUQuENo,4492
4
4
  ratio1/plugins_manager_mixin.py,sha256=X1JdGLDz0gN1rPnTN_5mJXR8JmqoBFQISJXmPR9yvCo,11106
5
5
  ratio1/base/__init__.py,sha256=hACh83_cIv7-PwYMM3bQm2IBmNqiHw-3PAfDfAEKz9A,259
@@ -42,7 +42,7 @@ ratio1/const/apps.py,sha256=0NiuoAPak0HjEULF3fs3xaUH8IRSZ0i4fZw7T2fEd_g,785
42
42
  ratio1/const/base.py,sha256=QIeRH6X-u8DbezQCGipI3isL1LGComBQC5hLedO1jrQ,6042
43
43
  ratio1/const/comms.py,sha256=qEYX4ciYg8SYWSDZZTUYxzpR1--2a7UusrWzAq0hxo8,2259
44
44
  ratio1/const/environment.py,sha256=632L5GrcNqF3-JhvrC6kXzXwLMcihRgMlOkLurnOwGY,1031
45
- ratio1/const/evm_net.py,sha256=ygQ_LbFxhSB6Uw7zp3Vt4jKhLjTtME6qDbpxR1co0Pg,16133
45
+ ratio1/const/evm_net.py,sha256=9is8Gx2_xtKlWRNAZTNAmmaA33c30xvpBT-zL4AtIuM,16774
46
46
  ratio1/const/formatter.py,sha256=AW3bWlqf39uaqV4BBUuW95qKYfF2OkkU4f9hy3kSVhM,200
47
47
  ratio1/const/heartbeat.py,sha256=Z_n87yI-L4vlBmlHZhkruysEJV5JVbXLQlGI26R42C4,3197
48
48
  ratio1/const/misc.py,sha256=VDCwwpf5bl9ltx9rzT2WPVP8B3mZFRufU1tSS5MO240,413
@@ -68,7 +68,7 @@ ratio1/io_formatter/default/aixp1.py,sha256=MX0TeUR4APA-qN3vUC6uzcz8Pssz5lgrQWo7
68
68
  ratio1/io_formatter/default/default.py,sha256=gEy78cP2D5s0y8vQh4aHuxqz7D10gGfuiKF311QhrpE,494
69
69
  ratio1/ipfs/__init__.py,sha256=vXEDLUNUO6lOTMGa8iQ9Zf7ajIQq9GZuvYraAHt3meE,38
70
70
  ratio1/ipfs/ifps_keygen,sha256=PcoYuo4c89_C9FWrKq9K_28ruhKqnxNn1s3nLHiF1tc,879
71
- ratio1/ipfs/r1fs.py,sha256=vpX2b_FdgWgC_ArY8JgW-D_9TbhIPIsNN2YFLB39mJs,49327
71
+ ratio1/ipfs/r1fs.py,sha256=bslLpr0FTiqBsXPCoAqmH62MDki1lkvgW-oT7TvgFcQ,49458
72
72
  ratio1/ipfs/ipfs_setup/ipfs.service,sha256=isTJQsktPy4i1yaDA9AC1OKdlTYvsCCRRAVX-EmGqAs,248
73
73
  ratio1/ipfs/ipfs_setup/launch_service.sh,sha256=GWhZyNqtohLxJg8Q_c8YnNZduu1ddXDU-IFRRMaEyiY,141
74
74
  ratio1/ipfs/ipfs_setup/restart.sh,sha256=9xHMgkUoAMI25jeaoDVFbCa_LjojYm3ubljW58RatKE,22
@@ -103,8 +103,8 @@ ratio1/utils/comm_utils.py,sha256=4cS9llRr_pK_3rNgDcRMCQwYPO0kcNU7AdWy_LtMyCY,10
103
103
  ratio1/utils/config.py,sha256=Elfkl7W4aDMvB5WZLiYlPXrecBncgTxb4hcKhQedMzI,10111
104
104
  ratio1/utils/dotenv.py,sha256=_AgSo35n7EnQv5yDyu7C7i0kHragLJoCGydHjvOkrYY,2008
105
105
  ratio1/utils/oracle_sync/oracle_tester.py,sha256=aJOPcZhtbw1XPqsFG4qYpfv2Taj5-qRXbwJzrPyeXDE,27465
106
- ratio1-3.4.81.dist-info/METADATA,sha256=bYRGOZYqcNydFV6S0RpAVH0fyjgNNxJMbn9vXGogKxI,12255
107
- ratio1-3.4.81.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
108
- ratio1-3.4.81.dist-info/entry_points.txt,sha256=DR_olREzU1egwmgek3s4GfQslBi-KR7lXsd4ap0TFxE,46
109
- ratio1-3.4.81.dist-info/licenses/LICENSE,sha256=cvOsJVslde4oIaTCadabXnPqZmzcBO2f2zwXZRmJEbE,11311
110
- ratio1-3.4.81.dist-info/RECORD,,
106
+ ratio1-3.4.83.dist-info/METADATA,sha256=T_tBgCVBwuaf2wcqDD2yVecRk-839qSrCwLC04R1T9s,12255
107
+ ratio1-3.4.83.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
108
+ ratio1-3.4.83.dist-info/entry_points.txt,sha256=DR_olREzU1egwmgek3s4GfQslBi-KR7lXsd4ap0TFxE,46
109
+ ratio1-3.4.83.dist-info/licenses/LICENSE,sha256=cvOsJVslde4oIaTCadabXnPqZmzcBO2f2zwXZRmJEbE,11311
110
+ ratio1-3.4.83.dist-info/RECORD,,