hippius 0.1.12__tar.gz → 0.1.14__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.12
3
+ Version: 0.1.14
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
@@ -46,10 +46,6 @@ A Python SDK and CLI for interacting with Hippius blockchain storage, designed s
46
46
  ## Installation
47
47
 
48
48
  ```bash
49
-
50
- # Using pipx
51
- pipx install hippius
52
-
53
49
  # Using pip
54
50
  pip install hippius
55
51
 
@@ -352,63 +348,12 @@ When choosing the second option, the system will process each file in the direct
352
348
  - Successfully coded files with their metadata CIDs
353
349
  - Any files that failed, with error details
354
350
 
355
- You can also directly use the dedicated command for directory erasure coding:
356
-
357
- ```bash
358
- # Direct command for applying erasure coding to an entire directory
359
- hippius erasure-code-dir my_directory/
360
-
361
- # With custom parameters
362
- hippius erasure-code-dir my_important_files/ --k 4 --m 8 --encrypt
363
- ```
364
-
365
- This dedicated command processes each file in the directory individually, optimizing erasure coding parameters for each file based on its size.
366
-
367
- **Important Note on Directory Structure:**
368
- - The command processes all files in the entire directory hierarchy, including all subdirectories
369
- - Each file is processed independently and gets its own separate metadata CID
370
- - The original directory structure is not automatically preserved for reconstruction
371
- - You will need to reconstruct each file individually using its specific metadata CID
372
-
373
- If preserving the exact directory structure is important, consider these options:
374
- 1. Archive the directory first (option 1 above), then erasure code the single archive file
375
- 2. Keep track of the original file paths relative to the root directory in your own system
376
- 3. For small directories with few files, reconstruct each file individually and manually recreate the structure
377
-
378
351
  To reconstruct a file from erasure-coded chunks:
379
352
 
380
353
  ```bash
381
354
  hippius reconstruct QmMetadataCID reconstructed_filename
382
355
  ```
383
356
 
384
- **Integration with Other Features:**
385
- The directory erasure coding functionality works seamlessly with other Hippius SDK features:
386
-
387
- - **Account Management**: Use with multiple coldkeys and hotkeys by specifying the account with `--account`
388
- - **Default Address**: Combined with default address management for streamlined operations
389
- - **Proxy Support**: Hotkeys with proper permissions can perform erasure coding operations on behalf of a coldkey
390
- - **Configuration Management**: All erasure coding parameters can be preset in your config file with `hippius config set`
391
-
392
- For a comprehensive workflow, you can manage accounts, set default addresses, configure erasure coding parameters, and then process directories in a single sequence of commands:
393
-
394
- ```bash
395
- # Set active account
396
- hippius account switch my_account_name
397
-
398
- # Set default address for operations
399
- hippius address set-default 5H1QBRF7T7dgKwzVGCgS4wioudvMRf9K4NEDzfuKLnuyBNzH
400
-
401
- # Configure default erasure coding parameters
402
- hippius config set erasure_coding default_k 4
403
- hippius config set erasure_coding default_m 8
404
-
405
- # Apply erasure coding to a directory
406
- hippius erasure-code-dir my_important_directory/
407
-
408
- # Check the status of erasure-coded files
409
- hippius ec-files
410
- ```
411
-
412
357
  #### Default Address Management
413
358
 
414
359
  Hippius SDK now allows setting a default address for read-only operations, making it easier to use commands like `files` and `ec-files` without specifying an account address each time:
@@ -998,95 +943,3 @@ client = HippiusClient(
998
943
 
999
944
  The multi-account system makes it easier to manage multiple identities while maintaining security and convenience.
1000
945
 
1001
- ## Blockchain Account Management
1002
-
1003
- Hippius SDK provides a comprehensive solution for managing blockchain accounts, including coldkeys, hotkeys, and proxy relationships.
1004
-
1005
- ### Coldkeys and Hotkeys
1006
-
1007
- Hippius uses a hierarchical account structure:
1008
-
1009
- - **Coldkey**: The main account that holds your funds and grants permissions
1010
- - **Hotkey**: Delegated accounts that can perform specific actions on behalf of your coldkey
1011
-
1012
- This separation provides enhanced security by allowing you to keep your main account (coldkey) secure while using hotkeys for day-to-day operations.
1013
-
1014
- ### Creating and Managing Accounts
1015
-
1016
- ```python
1017
- from hippius_sdk.account import AccountManager
1018
-
1019
- # Initialize the account manager
1020
- account_manager = AccountManager()
1021
-
1022
- # Create a coldkey (main account)
1023
- coldkey = account_manager.create_coldkey(
1024
- name="my_hippius_coldkey", # Optional custom name
1025
- mnemonic="your mnemonic phrase here" # Optional - will generate if not provided
1026
- )
1027
-
1028
- # Create a hotkey associated with the coldkey
1029
- hotkey = account_manager.create_hotkey(
1030
- name="my_hippius_hotkey_1", # Optional custom name
1031
- coldkey_address=coldkey["address"] # Optional association
1032
- )
1033
-
1034
- # List all coldkeys
1035
- coldkeys = account_manager.list_coldkeys()
1036
-
1037
- # List hotkeys for a specific coldkey
1038
- hotkeys = account_manager.list_hotkeys(coldkey_address=coldkey["address"])
1039
-
1040
- # Create a proxy relationship on the blockchain
1041
- result = account_manager.create_proxy_relationship(
1042
- coldkey_address=coldkey["address"],
1043
- hotkey_address=hotkey["address"],
1044
- proxy_type="NonTransfer", # Type of permissions granted
1045
- delay=0 # Blocks before proxy becomes active
1046
- )
1047
-
1048
- # List proxy relationships
1049
- proxies = account_manager.list_proxies(coldkey_address=coldkey["address"])
1050
-
1051
- # Remove a proxy relationship
1052
- result = account_manager.remove_proxy(
1053
- coldkey_address=coldkey["address"],
1054
- hotkey_address=hotkey["address"]
1055
- )
1056
- ```
1057
-
1058
- ### CLI Commands for Account Management
1059
-
1060
- The SDK provides CLI commands for managing accounts:
1061
-
1062
- ```bash
1063
- # Create a coldkey
1064
- hippius account coldkey create --name "my_hippius_coldkey" --generate-mnemonic --show-mnemonic
1065
-
1066
- # Create a hotkey and associate with a coldkey
1067
- hippius account hotkey create --name "my_hippius_hotkey_1" --coldkey [COLDKEY_ADDRESS]
1068
-
1069
- # List accounts
1070
- hippius account list coldkey --verbose
1071
- hippius account list hotkey
1072
- hippius account list proxy --coldkey [COLDKEY_ADDRESS]
1073
-
1074
- # Create a proxy relationship on the blockchain
1075
- hippius account proxy create --coldkey [COLDKEY_ADDRESS] --hotkey [HOTKEY_ADDRESS] --proxy-type NonTransfer
1076
-
1077
- # Remove a proxy relationship
1078
- hippius account proxy remove --coldkey [COLDKEY_ADDRESS] --hotkey [HOTKEY_ADDRESS]
1079
- ```
1080
-
1081
- ### Best Practices for Account Management
1082
-
1083
- 1. **Security**: Keep your coldkey mnemonic secure and never share it. This is the master key to your account.
1084
-
1085
- 2. **Proxy Types**: Different proxy types grant different permissions:
1086
- - `NonTransfer`: Can perform operations except transferring funds
1087
- - Other types may be available depending on the chain configuration
1088
-
1089
- 3. **Multiple Hotkeys**: Create separate hotkeys for different applications or services to limit the impact if one is compromised.
1090
-
1091
- 4. **Regular Auditing**: Regularly check your proxy relationships using `hippius account list proxy` to ensure only authorized delegates have access.
1092
-
@@ -15,10 +15,6 @@ A Python SDK and CLI for interacting with Hippius blockchain storage, designed s
15
15
  ## Installation
16
16
 
17
17
  ```bash
18
-
19
- # Using pipx
20
- pipx install hippius
21
-
22
18
  # Using pip
23
19
  pip install hippius
24
20
 
@@ -321,63 +317,12 @@ When choosing the second option, the system will process each file in the direct
321
317
  - Successfully coded files with their metadata CIDs
322
318
  - Any files that failed, with error details
323
319
 
324
- You can also directly use the dedicated command for directory erasure coding:
325
-
326
- ```bash
327
- # Direct command for applying erasure coding to an entire directory
328
- hippius erasure-code-dir my_directory/
329
-
330
- # With custom parameters
331
- hippius erasure-code-dir my_important_files/ --k 4 --m 8 --encrypt
332
- ```
333
-
334
- This dedicated command processes each file in the directory individually, optimizing erasure coding parameters for each file based on its size.
335
-
336
- **Important Note on Directory Structure:**
337
- - The command processes all files in the entire directory hierarchy, including all subdirectories
338
- - Each file is processed independently and gets its own separate metadata CID
339
- - The original directory structure is not automatically preserved for reconstruction
340
- - You will need to reconstruct each file individually using its specific metadata CID
341
-
342
- If preserving the exact directory structure is important, consider these options:
343
- 1. Archive the directory first (option 1 above), then erasure code the single archive file
344
- 2. Keep track of the original file paths relative to the root directory in your own system
345
- 3. For small directories with few files, reconstruct each file individually and manually recreate the structure
346
-
347
320
  To reconstruct a file from erasure-coded chunks:
348
321
 
349
322
  ```bash
350
323
  hippius reconstruct QmMetadataCID reconstructed_filename
351
324
  ```
352
325
 
353
- **Integration with Other Features:**
354
- The directory erasure coding functionality works seamlessly with other Hippius SDK features:
355
-
356
- - **Account Management**: Use with multiple coldkeys and hotkeys by specifying the account with `--account`
357
- - **Default Address**: Combined with default address management for streamlined operations
358
- - **Proxy Support**: Hotkeys with proper permissions can perform erasure coding operations on behalf of a coldkey
359
- - **Configuration Management**: All erasure coding parameters can be preset in your config file with `hippius config set`
360
-
361
- For a comprehensive workflow, you can manage accounts, set default addresses, configure erasure coding parameters, and then process directories in a single sequence of commands:
362
-
363
- ```bash
364
- # Set active account
365
- hippius account switch my_account_name
366
-
367
- # Set default address for operations
368
- hippius address set-default 5H1QBRF7T7dgKwzVGCgS4wioudvMRf9K4NEDzfuKLnuyBNzH
369
-
370
- # Configure default erasure coding parameters
371
- hippius config set erasure_coding default_k 4
372
- hippius config set erasure_coding default_m 8
373
-
374
- # Apply erasure coding to a directory
375
- hippius erasure-code-dir my_important_directory/
376
-
377
- # Check the status of erasure-coded files
378
- hippius ec-files
379
- ```
380
-
381
326
  #### Default Address Management
382
327
 
383
328
  Hippius SDK now allows setting a default address for read-only operations, making it easier to use commands like `files` and `ec-files` without specifying an account address each time:
@@ -966,95 +911,3 @@ client = HippiusClient(
966
911
  ```
967
912
 
968
913
  The multi-account system makes it easier to manage multiple identities while maintaining security and convenience.
969
-
970
- ## Blockchain Account Management
971
-
972
- Hippius SDK provides a comprehensive solution for managing blockchain accounts, including coldkeys, hotkeys, and proxy relationships.
973
-
974
- ### Coldkeys and Hotkeys
975
-
976
- Hippius uses a hierarchical account structure:
977
-
978
- - **Coldkey**: The main account that holds your funds and grants permissions
979
- - **Hotkey**: Delegated accounts that can perform specific actions on behalf of your coldkey
980
-
981
- This separation provides enhanced security by allowing you to keep your main account (coldkey) secure while using hotkeys for day-to-day operations.
982
-
983
- ### Creating and Managing Accounts
984
-
985
- ```python
986
- from hippius_sdk.account import AccountManager
987
-
988
- # Initialize the account manager
989
- account_manager = AccountManager()
990
-
991
- # Create a coldkey (main account)
992
- coldkey = account_manager.create_coldkey(
993
- name="my_hippius_coldkey", # Optional custom name
994
- mnemonic="your mnemonic phrase here" # Optional - will generate if not provided
995
- )
996
-
997
- # Create a hotkey associated with the coldkey
998
- hotkey = account_manager.create_hotkey(
999
- name="my_hippius_hotkey_1", # Optional custom name
1000
- coldkey_address=coldkey["address"] # Optional association
1001
- )
1002
-
1003
- # List all coldkeys
1004
- coldkeys = account_manager.list_coldkeys()
1005
-
1006
- # List hotkeys for a specific coldkey
1007
- hotkeys = account_manager.list_hotkeys(coldkey_address=coldkey["address"])
1008
-
1009
- # Create a proxy relationship on the blockchain
1010
- result = account_manager.create_proxy_relationship(
1011
- coldkey_address=coldkey["address"],
1012
- hotkey_address=hotkey["address"],
1013
- proxy_type="NonTransfer", # Type of permissions granted
1014
- delay=0 # Blocks before proxy becomes active
1015
- )
1016
-
1017
- # List proxy relationships
1018
- proxies = account_manager.list_proxies(coldkey_address=coldkey["address"])
1019
-
1020
- # Remove a proxy relationship
1021
- result = account_manager.remove_proxy(
1022
- coldkey_address=coldkey["address"],
1023
- hotkey_address=hotkey["address"]
1024
- )
1025
- ```
1026
-
1027
- ### CLI Commands for Account Management
1028
-
1029
- The SDK provides CLI commands for managing accounts:
1030
-
1031
- ```bash
1032
- # Create a coldkey
1033
- hippius account coldkey create --name "my_hippius_coldkey" --generate-mnemonic --show-mnemonic
1034
-
1035
- # Create a hotkey and associate with a coldkey
1036
- hippius account hotkey create --name "my_hippius_hotkey_1" --coldkey [COLDKEY_ADDRESS]
1037
-
1038
- # List accounts
1039
- hippius account list coldkey --verbose
1040
- hippius account list hotkey
1041
- hippius account list proxy --coldkey [COLDKEY_ADDRESS]
1042
-
1043
- # Create a proxy relationship on the blockchain
1044
- hippius account proxy create --coldkey [COLDKEY_ADDRESS] --hotkey [HOTKEY_ADDRESS] --proxy-type NonTransfer
1045
-
1046
- # Remove a proxy relationship
1047
- hippius account proxy remove --coldkey [COLDKEY_ADDRESS] --hotkey [HOTKEY_ADDRESS]
1048
- ```
1049
-
1050
- ### Best Practices for Account Management
1051
-
1052
- 1. **Security**: Keep your coldkey mnemonic secure and never share it. This is the master key to your account.
1053
-
1054
- 2. **Proxy Types**: Different proxy types grant different permissions:
1055
- - `NonTransfer`: Can perform operations except transferring funds
1056
- - Other types may be available depending on the chain configuration
1057
-
1058
- 3. **Multiple Hotkeys**: Create separate hotkeys for different applications or services to limit the impact if one is compromised.
1059
-
1060
- 4. **Regular Auditing**: Regularly check your proxy relationships using `hippius account list proxy` to ensure only authorized delegates have access.
@@ -3,36 +3,32 @@ Hippius SDK - Python interface for Hippius blockchain storage
3
3
  """
4
4
 
5
5
  from hippius_sdk.client import HippiusClient
6
- from hippius_sdk.ipfs import IPFSClient
7
- from hippius_sdk.substrate import SubstrateClient
8
- from hippius_sdk.account import AccountManager
9
6
  from hippius_sdk.config import (
7
+ decrypt_seed_phrase,
8
+ delete_account,
9
+ encrypt_seed_phrase,
10
+ get_account_address,
11
+ get_active_account,
12
+ get_all_config,
10
13
  get_config_value,
11
- set_config_value,
12
14
  get_encryption_key,
13
- set_encryption_key,
14
- load_config,
15
- save_config,
15
+ get_seed_phrase,
16
16
  initialize_from_env,
17
- get_all_config,
17
+ list_accounts,
18
+ load_config,
18
19
  reset_config,
19
- get_seed_phrase,
20
- set_seed_phrase,
21
- encrypt_seed_phrase,
22
- decrypt_seed_phrase,
23
- get_active_account,
20
+ save_config,
24
21
  set_active_account,
25
- list_accounts,
26
- delete_account,
27
- get_account_address,
22
+ set_config_value,
23
+ set_encryption_key,
24
+ set_seed_phrase,
28
25
  )
26
+ from hippius_sdk.ipfs import IPFSClient
29
27
 
30
- __version__ = "0.1.0"
28
+ __version__ = "0.1.14"
31
29
  __all__ = [
32
30
  "HippiusClient",
33
31
  "IPFSClient",
34
- "SubstrateClient",
35
- "AccountManager",
36
32
  "get_config_value",
37
33
  "set_config_value",
38
34
  "get_encryption_key",