hippius 0.1.12__py3-none-any.whl → 0.1.14__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.
- {hippius-0.1.12.dist-info → hippius-0.1.14.dist-info}/METADATA +1 -148
- hippius-0.1.14.dist-info/RECORD +10 -0
- hippius_sdk/__init__.py +15 -19
- hippius_sdk/cli.py +197 -497
- hippius_sdk/client.py +7 -8
- hippius_sdk/config.py +7 -77
- hippius_sdk/ipfs.py +12 -12
- hippius_sdk/substrate.py +10 -6
- hippius-0.1.12.dist-info/RECORD +0 -12
- hippius_sdk/account.py +0 -648
- hippius_sdk/utils.py +0 -87
- {hippius-0.1.12.dist-info → hippius-0.1.14.dist-info}/WHEEL +0 -0
- {hippius-0.1.12.dist-info → hippius-0.1.14.dist-info}/entry_points.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: hippius
|
3
|
-
Version: 0.1.
|
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
|
-
|
@@ -0,0 +1,10 @@
|
|
1
|
+
hippius_sdk/__init__.py,sha256=SXQFoeDEMtZcPbH4tCoLPtYrbo6gmsiUHm45gAkeFKY,1261
|
2
|
+
hippius_sdk/cli.py,sha256=ARWZmeWpv6UEHUx71K4LngBUSWQosDQARHWor1dWzhQ,74100
|
3
|
+
hippius_sdk/client.py,sha256=dIrjaXl2J71_ljhu_nFS-gTOmKDRPzJDXeviBSOAeis,14894
|
4
|
+
hippius_sdk/config.py,sha256=nLDmZft5hR_mD_NrmnnfMwfWRCsp2uQi2f1mTWu-fC4,22870
|
5
|
+
hippius_sdk/ipfs.py,sha256=kMqmtyvdjzo1JlXTdLYA74zAmZocDAOsW9cmzwG6ejg,63959
|
6
|
+
hippius_sdk/substrate.py,sha256=ghvZSQvTaOhbUzRGkeG7jD47b7oW7cSqcghbgCog5gE,33096
|
7
|
+
hippius-0.1.14.dist-info/METADATA,sha256=6a7zaPYieHFRjvrYvJc8Ouj36q_d2_iWB7d2F-T0KBk,28001
|
8
|
+
hippius-0.1.14.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
9
|
+
hippius-0.1.14.dist-info/entry_points.txt,sha256=b1lo60zRXmv1ud-c5BC-cJcAfGE5FD4qM_nia6XeQtM,98
|
10
|
+
hippius-0.1.14.dist-info/RECORD,,
|
hippius_sdk/__init__.py
CHANGED
@@ -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
|
-
|
14
|
-
load_config,
|
15
|
-
save_config,
|
15
|
+
get_seed_phrase,
|
16
16
|
initialize_from_env,
|
17
|
-
|
17
|
+
list_accounts,
|
18
|
+
load_config,
|
18
19
|
reset_config,
|
19
|
-
|
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
|
-
|
26
|
-
|
27
|
-
|
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.
|
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",
|