hippius 0.1.7__py3-none-any.whl → 0.1.10__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.7.dist-info → hippius-0.1.10.dist-info}/METADATA +189 -9
- hippius-0.1.10.dist-info/RECORD +12 -0
- hippius_sdk/__init__.py +4 -0
- hippius_sdk/account.py +648 -0
- hippius_sdk/cli.py +645 -445
- hippius_sdk/client.py +1 -1
- hippius_sdk/config.py +72 -1
- hippius_sdk/ipfs.py +1 -1
- hippius_sdk/substrate.py +252 -154
- hippius_sdk/utils.py +87 -0
- hippius-0.1.7.dist-info/RECORD +0 -10
- {hippius-0.1.7.dist-info → hippius-0.1.10.dist-info}/WHEEL +0 -0
- {hippius-0.1.7.dist-info → hippius-0.1.10.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.10
|
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
|
@@ -67,7 +67,7 @@ client = HippiusClient()
|
|
67
67
|
# Or specify custom endpoints
|
68
68
|
client = HippiusClient(
|
69
69
|
ipfs_gateway="https://ipfs.io", # For downloads (default)
|
70
|
-
ipfs_api_url="https://
|
70
|
+
ipfs_api_url="https://store.hippius.network", # For uploads (default)
|
71
71
|
)
|
72
72
|
|
73
73
|
# Upload a file to IPFS
|
@@ -313,6 +313,64 @@ This command provides detailed information about each erasure-coded file includi
|
|
313
313
|
- Miners storing the file
|
314
314
|
- Reconstruction command
|
315
315
|
|
316
|
+
The `ec-files` command is optimized for performance through parallel processing and intelligent filtering, making it efficient even with large numbers of files.
|
317
|
+
|
318
|
+
#### Performance Considerations
|
319
|
+
|
320
|
+
The erasure coding implementation has been optimized for:
|
321
|
+
|
322
|
+
1. **Speed**: Parallel processing for file operations
|
323
|
+
2. **Memory efficiency**: Files are processed in chunks to minimize memory usage
|
324
|
+
3. **Auto-tuning**: Parameters like chunk size are automatically adjusted for small files
|
325
|
+
4. **Intelligent filtering**: The system can quickly identify potential erasure-coded files
|
326
|
+
|
327
|
+
For extremely large files (>1GB), consider using larger chunk sizes to improve performance:
|
328
|
+
|
329
|
+
```bash
|
330
|
+
hippius erasure-code large_video.mp4 --chunk-size 10485760 # 10MB chunks
|
331
|
+
```
|
332
|
+
|
333
|
+
#### Directory Support for Erasure Coding
|
334
|
+
|
335
|
+
Hippius SDK now supports applying erasure coding to entire directories:
|
336
|
+
|
337
|
+
```bash
|
338
|
+
# Apply erasure coding to an entire directory
|
339
|
+
hippius erasure-code my_directory/
|
340
|
+
|
341
|
+
# The CLI will detect that it's a directory and offer two options:
|
342
|
+
# 1. Archive the directory first, then erasure code the archive
|
343
|
+
# 2. Apply erasure coding to each file in the directory individually
|
344
|
+
```
|
345
|
+
|
346
|
+
When choosing the second option, the system will process each file in the directory individually, adjusting parameters like chunk size automatically for small files. A summary of the operation will be displayed, showing:
|
347
|
+
- Total files processed
|
348
|
+
- Successfully coded files with their metadata CIDs
|
349
|
+
- Any files that failed, with error details
|
350
|
+
|
351
|
+
To reconstruct a file from erasure-coded chunks:
|
352
|
+
|
353
|
+
```bash
|
354
|
+
hippius reconstruct QmMetadataCID reconstructed_filename
|
355
|
+
```
|
356
|
+
|
357
|
+
#### Default Address Management
|
358
|
+
|
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:
|
360
|
+
|
361
|
+
```bash
|
362
|
+
# Set a default address for read-only operations
|
363
|
+
hippius address set-default 5H1QBRF7T7dgKwzVGCgS4wioudvMRf9K4NEDzfuKLnuyBNzH
|
364
|
+
|
365
|
+
# View the currently set default address
|
366
|
+
hippius address get-default
|
367
|
+
|
368
|
+
# Clear the default address
|
369
|
+
hippius address clear-default
|
370
|
+
```
|
371
|
+
|
372
|
+
Once a default address is set, commands like `hippius files` and `hippius ec-files` will automatically use this address when no explicit address is provided.
|
373
|
+
|
316
374
|
#### Troubleshooting
|
317
375
|
|
318
376
|
1. **IPFS Connection Issues**: Make sure you have either:
|
@@ -333,7 +391,30 @@ This command provides detailed information about each erasure-coded file includi
|
|
333
391
|
which hippius
|
334
392
|
```
|
335
393
|
|
336
|
-
4. **
|
394
|
+
4. **Default Address Issues**: If you receive errors about missing account address:
|
395
|
+
```bash
|
396
|
+
# Set a default address for read-only operations
|
397
|
+
hippius address set-default 5H1QBRF7T7dgKwzVGCgS4wioudvMRf9K4NEDzfuKLnuyBNzH
|
398
|
+
```
|
399
|
+
|
400
|
+
5. **Substrate Issues**: For marketplace operations, make sure your `.env` has the correct `SUBSTRATE_SEED_PHRASE` and `SUBSTRATE_URL` values.
|
401
|
+
|
402
|
+
6. **Erasure Coding Problems**:
|
403
|
+
- **"Wrong length for input blocks"**: This typically happens with very small files
|
404
|
+
```bash
|
405
|
+
# Try smaller k and m values for small files
|
406
|
+
hippius erasure-code small_file.txt --k 2 --m 3
|
407
|
+
```
|
408
|
+
- **Directories can't be directly coded**: Use the directory support option when prompted
|
409
|
+
- **"zfec is required"**: Install the missing package
|
410
|
+
```bash
|
411
|
+
pip install zfec
|
412
|
+
poetry add zfec
|
413
|
+
```
|
414
|
+
- **Slow performance with large files**: Increase chunk size
|
415
|
+
```bash
|
416
|
+
hippius erasure-code large_file.mp4 --chunk-size 5242880 # 5MB chunks
|
417
|
+
```
|
337
418
|
|
338
419
|
## Command Line Interface
|
339
420
|
|
@@ -346,7 +427,7 @@ The Hippius SDK includes a powerful command-line interface (CLI) that provides a
|
|
346
427
|
hippius --help
|
347
428
|
|
348
429
|
# Set global options
|
349
|
-
hippius --gateway https://ipfs.io --api-url https://
|
430
|
+
hippius --gateway https://ipfs.io --api-url https://store.hippius.network --verbose
|
350
431
|
```
|
351
432
|
|
352
433
|
### IPFS Operations
|
@@ -431,7 +512,7 @@ hippius ec-files --all-miners
|
|
431
512
|
hippius ec-files --show-chunks
|
432
513
|
```
|
433
514
|
|
434
|
-
The `ec-files` command
|
515
|
+
The `ec-files` command has been optimized for performance and can now handle large numbers of files efficiently through parallel processing.
|
435
516
|
|
436
517
|
### Using Environment Variables
|
437
518
|
|
@@ -439,7 +520,7 @@ The CLI automatically reads from your `.env` file for common settings:
|
|
439
520
|
|
440
521
|
```
|
441
522
|
IPFS_GATEWAY=https://ipfs.io
|
442
|
-
IPFS_API_URL=https://
|
523
|
+
IPFS_API_URL=https://store.hippius.network
|
443
524
|
SUBSTRATE_URL=wss://rpc.hippius.network
|
444
525
|
SUBSTRATE_SEED_PHRASE="your twelve word seed phrase..."
|
445
526
|
SUBSTRATE_DEFAULT_MINERS=miner1,miner2,miner3
|
@@ -546,13 +627,14 @@ The configuration is organized in the following sections:
|
|
546
627
|
{
|
547
628
|
"ipfs": {
|
548
629
|
"gateway": "https://ipfs.io",
|
549
|
-
"api_url": "https://
|
630
|
+
"api_url": "https://store.hippius.network",
|
550
631
|
"local_ipfs": false
|
551
632
|
},
|
552
633
|
"substrate": {
|
553
634
|
"url": "wss://rpc.hippius.network",
|
554
635
|
"seed_phrase": null,
|
555
|
-
"default_miners": []
|
636
|
+
"default_miners": [],
|
637
|
+
"default_address": null
|
556
638
|
},
|
557
639
|
"encryption": {
|
558
640
|
"encrypt_by_default": false,
|
@@ -737,7 +819,13 @@ hippius --help
|
|
737
819
|
which hippius
|
738
820
|
```
|
739
821
|
|
740
|
-
4. **
|
822
|
+
4. **Default Address Issues**: If you receive errors about missing account address:
|
823
|
+
```bash
|
824
|
+
# Set a default address for read-only operations
|
825
|
+
hippius address set-default 5H1QBRF7T7dgKwzVGCgS4wioudvMRf9K4NEDzfuKLnuyBNzH
|
826
|
+
```
|
827
|
+
|
828
|
+
5. **Substrate Issues**: For marketplace operations, make sure your `.env` has the correct `SUBSTRATE_SEED_PHRASE` and `SUBSTRATE_URL` values.
|
741
829
|
|
742
830
|
## Contributing
|
743
831
|
|
@@ -855,3 +943,95 @@ client = HippiusClient(
|
|
855
943
|
|
856
944
|
The multi-account system makes it easier to manage multiple identities while maintaining security and convenience.
|
857
945
|
|
946
|
+
## Blockchain Account Management
|
947
|
+
|
948
|
+
Hippius SDK provides a comprehensive solution for managing blockchain accounts, including coldkeys, hotkeys, and proxy relationships.
|
949
|
+
|
950
|
+
### Coldkeys and Hotkeys
|
951
|
+
|
952
|
+
Hippius uses a hierarchical account structure:
|
953
|
+
|
954
|
+
- **Coldkey**: The main account that holds your funds and grants permissions
|
955
|
+
- **Hotkey**: Delegated accounts that can perform specific actions on behalf of your coldkey
|
956
|
+
|
957
|
+
This separation provides enhanced security by allowing you to keep your main account (coldkey) secure while using hotkeys for day-to-day operations.
|
958
|
+
|
959
|
+
### Creating and Managing Accounts
|
960
|
+
|
961
|
+
```python
|
962
|
+
from hippius_sdk.account import AccountManager
|
963
|
+
|
964
|
+
# Initialize the account manager
|
965
|
+
account_manager = AccountManager()
|
966
|
+
|
967
|
+
# Create a coldkey (main account)
|
968
|
+
coldkey = account_manager.create_coldkey(
|
969
|
+
name="my_hippius_coldkey", # Optional custom name
|
970
|
+
mnemonic="your mnemonic phrase here" # Optional - will generate if not provided
|
971
|
+
)
|
972
|
+
|
973
|
+
# Create a hotkey associated with the coldkey
|
974
|
+
hotkey = account_manager.create_hotkey(
|
975
|
+
name="my_hippius_hotkey_1", # Optional custom name
|
976
|
+
coldkey_address=coldkey["address"] # Optional association
|
977
|
+
)
|
978
|
+
|
979
|
+
# List all coldkeys
|
980
|
+
coldkeys = account_manager.list_coldkeys()
|
981
|
+
|
982
|
+
# List hotkeys for a specific coldkey
|
983
|
+
hotkeys = account_manager.list_hotkeys(coldkey_address=coldkey["address"])
|
984
|
+
|
985
|
+
# Create a proxy relationship on the blockchain
|
986
|
+
result = account_manager.create_proxy_relationship(
|
987
|
+
coldkey_address=coldkey["address"],
|
988
|
+
hotkey_address=hotkey["address"],
|
989
|
+
proxy_type="NonTransfer", # Type of permissions granted
|
990
|
+
delay=0 # Blocks before proxy becomes active
|
991
|
+
)
|
992
|
+
|
993
|
+
# List proxy relationships
|
994
|
+
proxies = account_manager.list_proxies(coldkey_address=coldkey["address"])
|
995
|
+
|
996
|
+
# Remove a proxy relationship
|
997
|
+
result = account_manager.remove_proxy(
|
998
|
+
coldkey_address=coldkey["address"],
|
999
|
+
hotkey_address=hotkey["address"]
|
1000
|
+
)
|
1001
|
+
```
|
1002
|
+
|
1003
|
+
### CLI Commands for Account Management
|
1004
|
+
|
1005
|
+
The SDK provides CLI commands for managing accounts:
|
1006
|
+
|
1007
|
+
```bash
|
1008
|
+
# Create a coldkey
|
1009
|
+
hippius account coldkey create --name "my_hippius_coldkey" --generate-mnemonic --show-mnemonic
|
1010
|
+
|
1011
|
+
# Create a hotkey and associate with a coldkey
|
1012
|
+
hippius account hotkey create --name "my_hippius_hotkey_1" --coldkey [COLDKEY_ADDRESS]
|
1013
|
+
|
1014
|
+
# List accounts
|
1015
|
+
hippius account list coldkey --verbose
|
1016
|
+
hippius account list hotkey
|
1017
|
+
hippius account list proxy --coldkey [COLDKEY_ADDRESS]
|
1018
|
+
|
1019
|
+
# Create a proxy relationship on the blockchain
|
1020
|
+
hippius account proxy create --coldkey [COLDKEY_ADDRESS] --hotkey [HOTKEY_ADDRESS] --proxy-type NonTransfer
|
1021
|
+
|
1022
|
+
# Remove a proxy relationship
|
1023
|
+
hippius account proxy remove --coldkey [COLDKEY_ADDRESS] --hotkey [HOTKEY_ADDRESS]
|
1024
|
+
```
|
1025
|
+
|
1026
|
+
### Best Practices for Account Management
|
1027
|
+
|
1028
|
+
1. **Security**: Keep your coldkey mnemonic secure and never share it. This is the master key to your account.
|
1029
|
+
|
1030
|
+
2. **Proxy Types**: Different proxy types grant different permissions:
|
1031
|
+
- `NonTransfer`: Can perform operations except transferring funds
|
1032
|
+
- Other types may be available depending on the chain configuration
|
1033
|
+
|
1034
|
+
3. **Multiple Hotkeys**: Create separate hotkeys for different applications or services to limit the impact if one is compromised.
|
1035
|
+
|
1036
|
+
4. **Regular Auditing**: Regularly check your proxy relationships using `hippius account list proxy` to ensure only authorized delegates have access.
|
1037
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
hippius_sdk/__init__.py,sha256=OluIKx43ZOGvMI0W06B4bTTcmOJz4e6lq46GLBbPg8M,1402
|
2
|
+
hippius_sdk/account.py,sha256=R0lsyUAqe4nmPyiMt4hGDRucoSrpeLouWBVe7DP20Bc,24308
|
3
|
+
hippius_sdk/cli.py,sha256=ZHYw4-sUTT8wf_hlOIE1C9TLFOe6aGcLIB8bvC6UMOE,84047
|
4
|
+
hippius_sdk/client.py,sha256=54tsg4k29sqt3F77LQJ_vhzzTR73QuZ_edqI_BvZM1E,14905
|
5
|
+
hippius_sdk/config.py,sha256=wrVU0599aH39NIVRL59pZPyHXRevATQR9zwIUkCaWFE,25389
|
6
|
+
hippius_sdk/ipfs.py,sha256=9fds5MJwVb7t8IqROM70x9fWgyk9_Ot5psat_hMnRN8,63969
|
7
|
+
hippius_sdk/substrate.py,sha256=V49s1VYbl94Wk8-IH8DQsXLmRsAShGhIX9aYSY0BkBk,33034
|
8
|
+
hippius_sdk/utils.py,sha256=FSdVhYuCsKRNZiN9-XdzN2HESHXAVcWEpOpb3CLmVPI,2192
|
9
|
+
hippius-0.1.10.dist-info/METADATA,sha256=9s1i1aXU-lhxzGeuvjk4cDHoFkbVcbFNOSJPg4r8Evg,31298
|
10
|
+
hippius-0.1.10.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
11
|
+
hippius-0.1.10.dist-info/entry_points.txt,sha256=b1lo60zRXmv1ud-c5BC-cJcAfGE5FD4qM_nia6XeQtM,98
|
12
|
+
hippius-0.1.10.dist-info/RECORD,,
|
hippius_sdk/__init__.py
CHANGED
@@ -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",
|