hippius 0.1.10__tar.gz → 0.1.12__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.
- {hippius-0.1.10 → hippius-0.1.12}/PKG-INFO +56 -1
- {hippius-0.1.10 → hippius-0.1.12}/README.md +55 -0
- {hippius-0.1.10 → hippius-0.1.12}/hippius_sdk/cli.py +47 -0
- {hippius-0.1.10 → hippius-0.1.12}/pyproject.toml +1 -1
- {hippius-0.1.10 → hippius-0.1.12}/hippius_sdk/__init__.py +0 -0
- {hippius-0.1.10 → hippius-0.1.12}/hippius_sdk/account.py +0 -0
- {hippius-0.1.10 → hippius-0.1.12}/hippius_sdk/client.py +0 -0
- {hippius-0.1.10 → hippius-0.1.12}/hippius_sdk/config.py +0 -0
- {hippius-0.1.10 → hippius-0.1.12}/hippius_sdk/ipfs.py +0 -0
- {hippius-0.1.10 → hippius-0.1.12}/hippius_sdk/substrate.py +0 -0
- {hippius-0.1.10 → hippius-0.1.12}/hippius_sdk/utils.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: hippius
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.12
|
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,6 +46,10 @@ 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
|
+
|
49
53
|
# Using pip
|
50
54
|
pip install hippius
|
51
55
|
|
@@ -348,12 +352,63 @@ When choosing the second option, the system will process each file in the direct
|
|
348
352
|
- Successfully coded files with their metadata CIDs
|
349
353
|
- Any files that failed, with error details
|
350
354
|
|
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
|
+
|
351
378
|
To reconstruct a file from erasure-coded chunks:
|
352
379
|
|
353
380
|
```bash
|
354
381
|
hippius reconstruct QmMetadataCID reconstructed_filename
|
355
382
|
```
|
356
383
|
|
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
|
+
|
357
412
|
#### Default Address Management
|
358
413
|
|
359
414
|
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:
|
@@ -15,6 +15,10 @@ 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
|
+
|
18
22
|
# Using pip
|
19
23
|
pip install hippius
|
20
24
|
|
@@ -317,12 +321,63 @@ When choosing the second option, the system will process each file in the direct
|
|
317
321
|
- Successfully coded files with their metadata CIDs
|
318
322
|
- Any files that failed, with error details
|
319
323
|
|
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
|
+
|
320
347
|
To reconstruct a file from erasure-coded chunks:
|
321
348
|
|
322
349
|
```bash
|
323
350
|
hippius reconstruct QmMetadataCID reconstructed_filename
|
324
351
|
```
|
325
352
|
|
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
|
+
|
326
381
|
#### Default Address Management
|
327
382
|
|
328
383
|
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:
|
@@ -1915,6 +1915,41 @@ examples:
|
|
1915
1915
|
"--verbose", action="store_true", help="Enable verbose output", default=True
|
1916
1916
|
)
|
1917
1917
|
|
1918
|
+
# Erasure code directory command
|
1919
|
+
erasure_code_dir_parser = subparsers.add_parser(
|
1920
|
+
"erasure-code-dir", help="Apply erasure coding to each file in a directory"
|
1921
|
+
)
|
1922
|
+
erasure_code_dir_parser.add_argument(
|
1923
|
+
"dir_path", help="Path to directory to process"
|
1924
|
+
)
|
1925
|
+
erasure_code_dir_parser.add_argument(
|
1926
|
+
"--k",
|
1927
|
+
type=int,
|
1928
|
+
default=3,
|
1929
|
+
help="Number of data chunks needed to reconstruct (default: 3)",
|
1930
|
+
)
|
1931
|
+
erasure_code_dir_parser.add_argument(
|
1932
|
+
"--m", type=int, default=5, help="Total number of chunks to create (default: 5)"
|
1933
|
+
)
|
1934
|
+
erasure_code_dir_parser.add_argument(
|
1935
|
+
"--chunk-size",
|
1936
|
+
type=int,
|
1937
|
+
default=1048576,
|
1938
|
+
help="Chunk size in bytes (default: 1MB)",
|
1939
|
+
)
|
1940
|
+
erasure_code_dir_parser.add_argument(
|
1941
|
+
"--miner-ids", help="Comma-separated list of miner IDs"
|
1942
|
+
)
|
1943
|
+
erasure_code_dir_parser.add_argument(
|
1944
|
+
"--encrypt", action="store_true", help="Encrypt the files"
|
1945
|
+
)
|
1946
|
+
erasure_code_dir_parser.add_argument(
|
1947
|
+
"--no-encrypt", action="store_true", help="Do not encrypt the files"
|
1948
|
+
)
|
1949
|
+
erasure_code_dir_parser.add_argument(
|
1950
|
+
"--verbose", action="store_true", help="Enable verbose output", default=True
|
1951
|
+
)
|
1952
|
+
|
1918
1953
|
# Reconstruct command
|
1919
1954
|
reconstruct_parser = subparsers.add_parser(
|
1920
1955
|
"reconstruct", help="Reconstruct an erasure-coded file"
|
@@ -2260,6 +2295,18 @@ examples:
|
|
2260
2295
|
verbose=args.verbose,
|
2261
2296
|
)
|
2262
2297
|
|
2298
|
+
elif args.command == "erasure-code-dir":
|
2299
|
+
return handle_erasure_code_directory(
|
2300
|
+
client,
|
2301
|
+
args.dir_path,
|
2302
|
+
args.k,
|
2303
|
+
args.m,
|
2304
|
+
args.chunk_size,
|
2305
|
+
miner_ids,
|
2306
|
+
encrypt=args.encrypt,
|
2307
|
+
verbose=args.verbose,
|
2308
|
+
)
|
2309
|
+
|
2263
2310
|
elif args.command == "reconstruct":
|
2264
2311
|
return handle_reconstruct(
|
2265
2312
|
client, args.metadata_cid, args.output_file, verbose=args.verbose
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|