hippius 0.1.9__tar.gz → 0.1.11__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hippius
3
- Version: 0.1.9
3
+ Version: 0.1.11
4
4
  Summary: Python SDK and CLI for Hippius blockchain storage
5
5
  Home-page: https://github.com/thenervelab/hippius-sdk
6
6
  Author: Dubs
@@ -348,6 +348,18 @@ When choosing the second option, the system will process each file in the direct
348
348
  - Successfully coded files with their metadata CIDs
349
349
  - Any files that failed, with error details
350
350
 
351
+ You can also directly use the dedicated command for directory erasure coding:
352
+
353
+ ```bash
354
+ # Direct command for applying erasure coding to an entire directory
355
+ hippius erasure-code-dir my_directory/
356
+
357
+ # With custom parameters
358
+ hippius erasure-code-dir my_important_files/ --k 4 --m 8 --encrypt
359
+ ```
360
+
361
+ This dedicated command processes each file in the directory individually, optimizing erasure coding parameters for each file based on its size.
362
+
351
363
  To reconstruct a file from erasure-coded chunks:
352
364
 
353
365
  ```bash
@@ -943,3 +955,95 @@ client = HippiusClient(
943
955
 
944
956
  The multi-account system makes it easier to manage multiple identities while maintaining security and convenience.
945
957
 
958
+ ## Blockchain Account Management
959
+
960
+ Hippius SDK provides a comprehensive solution for managing blockchain accounts, including coldkeys, hotkeys, and proxy relationships.
961
+
962
+ ### Coldkeys and Hotkeys
963
+
964
+ Hippius uses a hierarchical account structure:
965
+
966
+ - **Coldkey**: The main account that holds your funds and grants permissions
967
+ - **Hotkey**: Delegated accounts that can perform specific actions on behalf of your coldkey
968
+
969
+ This separation provides enhanced security by allowing you to keep your main account (coldkey) secure while using hotkeys for day-to-day operations.
970
+
971
+ ### Creating and Managing Accounts
972
+
973
+ ```python
974
+ from hippius_sdk.account import AccountManager
975
+
976
+ # Initialize the account manager
977
+ account_manager = AccountManager()
978
+
979
+ # Create a coldkey (main account)
980
+ coldkey = account_manager.create_coldkey(
981
+ name="my_hippius_coldkey", # Optional custom name
982
+ mnemonic="your mnemonic phrase here" # Optional - will generate if not provided
983
+ )
984
+
985
+ # Create a hotkey associated with the coldkey
986
+ hotkey = account_manager.create_hotkey(
987
+ name="my_hippius_hotkey_1", # Optional custom name
988
+ coldkey_address=coldkey["address"] # Optional association
989
+ )
990
+
991
+ # List all coldkeys
992
+ coldkeys = account_manager.list_coldkeys()
993
+
994
+ # List hotkeys for a specific coldkey
995
+ hotkeys = account_manager.list_hotkeys(coldkey_address=coldkey["address"])
996
+
997
+ # Create a proxy relationship on the blockchain
998
+ result = account_manager.create_proxy_relationship(
999
+ coldkey_address=coldkey["address"],
1000
+ hotkey_address=hotkey["address"],
1001
+ proxy_type="NonTransfer", # Type of permissions granted
1002
+ delay=0 # Blocks before proxy becomes active
1003
+ )
1004
+
1005
+ # List proxy relationships
1006
+ proxies = account_manager.list_proxies(coldkey_address=coldkey["address"])
1007
+
1008
+ # Remove a proxy relationship
1009
+ result = account_manager.remove_proxy(
1010
+ coldkey_address=coldkey["address"],
1011
+ hotkey_address=hotkey["address"]
1012
+ )
1013
+ ```
1014
+
1015
+ ### CLI Commands for Account Management
1016
+
1017
+ The SDK provides CLI commands for managing accounts:
1018
+
1019
+ ```bash
1020
+ # Create a coldkey
1021
+ hippius account coldkey create --name "my_hippius_coldkey" --generate-mnemonic --show-mnemonic
1022
+
1023
+ # Create a hotkey and associate with a coldkey
1024
+ hippius account hotkey create --name "my_hippius_hotkey_1" --coldkey [COLDKEY_ADDRESS]
1025
+
1026
+ # List accounts
1027
+ hippius account list coldkey --verbose
1028
+ hippius account list hotkey
1029
+ hippius account list proxy --coldkey [COLDKEY_ADDRESS]
1030
+
1031
+ # Create a proxy relationship on the blockchain
1032
+ hippius account proxy create --coldkey [COLDKEY_ADDRESS] --hotkey [HOTKEY_ADDRESS] --proxy-type NonTransfer
1033
+
1034
+ # Remove a proxy relationship
1035
+ hippius account proxy remove --coldkey [COLDKEY_ADDRESS] --hotkey [HOTKEY_ADDRESS]
1036
+ ```
1037
+
1038
+ ### Best Practices for Account Management
1039
+
1040
+ 1. **Security**: Keep your coldkey mnemonic secure and never share it. This is the master key to your account.
1041
+
1042
+ 2. **Proxy Types**: Different proxy types grant different permissions:
1043
+ - `NonTransfer`: Can perform operations except transferring funds
1044
+ - Other types may be available depending on the chain configuration
1045
+
1046
+ 3. **Multiple Hotkeys**: Create separate hotkeys for different applications or services to limit the impact if one is compromised.
1047
+
1048
+ 4. **Regular Auditing**: Regularly check your proxy relationships using `hippius account list proxy` to ensure only authorized delegates have access.
1049
+
@@ -317,6 +317,18 @@ When choosing the second option, the system will process each file in the direct
317
317
  - Successfully coded files with their metadata CIDs
318
318
  - Any files that failed, with error details
319
319
 
320
+ You can also directly use the dedicated command for directory erasure coding:
321
+
322
+ ```bash
323
+ # Direct command for applying erasure coding to an entire directory
324
+ hippius erasure-code-dir my_directory/
325
+
326
+ # With custom parameters
327
+ hippius erasure-code-dir my_important_files/ --k 4 --m 8 --encrypt
328
+ ```
329
+
330
+ This dedicated command processes each file in the directory individually, optimizing erasure coding parameters for each file based on its size.
331
+
320
332
  To reconstruct a file from erasure-coded chunks:
321
333
 
322
334
  ```bash
@@ -911,3 +923,95 @@ client = HippiusClient(
911
923
  ```
912
924
 
913
925
  The multi-account system makes it easier to manage multiple identities while maintaining security and convenience.
926
+
927
+ ## Blockchain Account Management
928
+
929
+ Hippius SDK provides a comprehensive solution for managing blockchain accounts, including coldkeys, hotkeys, and proxy relationships.
930
+
931
+ ### Coldkeys and Hotkeys
932
+
933
+ Hippius uses a hierarchical account structure:
934
+
935
+ - **Coldkey**: The main account that holds your funds and grants permissions
936
+ - **Hotkey**: Delegated accounts that can perform specific actions on behalf of your coldkey
937
+
938
+ This separation provides enhanced security by allowing you to keep your main account (coldkey) secure while using hotkeys for day-to-day operations.
939
+
940
+ ### Creating and Managing Accounts
941
+
942
+ ```python
943
+ from hippius_sdk.account import AccountManager
944
+
945
+ # Initialize the account manager
946
+ account_manager = AccountManager()
947
+
948
+ # Create a coldkey (main account)
949
+ coldkey = account_manager.create_coldkey(
950
+ name="my_hippius_coldkey", # Optional custom name
951
+ mnemonic="your mnemonic phrase here" # Optional - will generate if not provided
952
+ )
953
+
954
+ # Create a hotkey associated with the coldkey
955
+ hotkey = account_manager.create_hotkey(
956
+ name="my_hippius_hotkey_1", # Optional custom name
957
+ coldkey_address=coldkey["address"] # Optional association
958
+ )
959
+
960
+ # List all coldkeys
961
+ coldkeys = account_manager.list_coldkeys()
962
+
963
+ # List hotkeys for a specific coldkey
964
+ hotkeys = account_manager.list_hotkeys(coldkey_address=coldkey["address"])
965
+
966
+ # Create a proxy relationship on the blockchain
967
+ result = account_manager.create_proxy_relationship(
968
+ coldkey_address=coldkey["address"],
969
+ hotkey_address=hotkey["address"],
970
+ proxy_type="NonTransfer", # Type of permissions granted
971
+ delay=0 # Blocks before proxy becomes active
972
+ )
973
+
974
+ # List proxy relationships
975
+ proxies = account_manager.list_proxies(coldkey_address=coldkey["address"])
976
+
977
+ # Remove a proxy relationship
978
+ result = account_manager.remove_proxy(
979
+ coldkey_address=coldkey["address"],
980
+ hotkey_address=hotkey["address"]
981
+ )
982
+ ```
983
+
984
+ ### CLI Commands for Account Management
985
+
986
+ The SDK provides CLI commands for managing accounts:
987
+
988
+ ```bash
989
+ # Create a coldkey
990
+ hippius account coldkey create --name "my_hippius_coldkey" --generate-mnemonic --show-mnemonic
991
+
992
+ # Create a hotkey and associate with a coldkey
993
+ hippius account hotkey create --name "my_hippius_hotkey_1" --coldkey [COLDKEY_ADDRESS]
994
+
995
+ # List accounts
996
+ hippius account list coldkey --verbose
997
+ hippius account list hotkey
998
+ hippius account list proxy --coldkey [COLDKEY_ADDRESS]
999
+
1000
+ # Create a proxy relationship on the blockchain
1001
+ hippius account proxy create --coldkey [COLDKEY_ADDRESS] --hotkey [HOTKEY_ADDRESS] --proxy-type NonTransfer
1002
+
1003
+ # Remove a proxy relationship
1004
+ hippius account proxy remove --coldkey [COLDKEY_ADDRESS] --hotkey [HOTKEY_ADDRESS]
1005
+ ```
1006
+
1007
+ ### Best Practices for Account Management
1008
+
1009
+ 1. **Security**: Keep your coldkey mnemonic secure and never share it. This is the master key to your account.
1010
+
1011
+ 2. **Proxy Types**: Different proxy types grant different permissions:
1012
+ - `NonTransfer`: Can perform operations except transferring funds
1013
+ - Other types may be available depending on the chain configuration
1014
+
1015
+ 3. **Multiple Hotkeys**: Create separate hotkeys for different applications or services to limit the impact if one is compromised.
1016
+
1017
+ 4. **Regular Auditing**: Regularly check your proxy relationships using `hippius account list proxy` to ensure only authorized delegates have access.
@@ -4,6 +4,8 @@ Hippius SDK - Python interface for Hippius blockchain storage
4
4
 
5
5
  from hippius_sdk.client import HippiusClient
6
6
  from hippius_sdk.ipfs import IPFSClient
7
+ from hippius_sdk.substrate import SubstrateClient
8
+ from hippius_sdk.account import AccountManager
7
9
  from hippius_sdk.config import (
8
10
  get_config_value,
9
11
  set_config_value,
@@ -29,6 +31,8 @@ __version__ = "0.1.0"
29
31
  __all__ = [
30
32
  "HippiusClient",
31
33
  "IPFSClient",
34
+ "SubstrateClient",
35
+ "AccountManager",
32
36
  "get_config_value",
33
37
  "set_config_value",
34
38
  "get_encryption_key",