### Basic Hippius CLI Commands (Testing) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Examples of basic commands available in the Hippius CLI after installing the SDK in development mode. Includes getting help, downloading a file, generating a key, and using the verbose flag. ```bash # Basic commands hippius --help hippius download QmCID123 output_file.txt hippius keygen # To see what commands would do without actually running them, add --verbose hippius --verbose store myfile.txt ``` -------------------------------- ### Clone and Install Hippius SDK (Development) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Steps to clone the Hippius SDK repository and install its dependencies using Poetry for development purposes. This sets up the project environment. ```bash # Clone the repository git clone https://github.com/your-username/hippius-sdk.git cd hippius-sdk # Install dependencies poetry install ``` -------------------------------- ### Run Example Hippius SDK Test Script (Bash) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Execute the example Python test script to verify the functionality of the Hippius SDK components. ```bash python test_script.py ``` -------------------------------- ### Installing Hippius SDK - Bash Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Commands to install the Hippius SDK using popular Python package managers like pip and poetry. Includes an option to install with clipboard support for the encryption key utility. ```bash # Using pip pip install hippius # Using Poetry poetry add hippius # With clipboard support for encryption key utility poetry add hippius -E clipboard ``` -------------------------------- ### Build and Install Hippius SDK Package (Bash) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Steps to build the distributable package for the Hippius SDK using Poetry, create a virtual environment, and install the built package for final testing before publishing. ```bash # Build the package poetry build # Install the built package in a virtual environment python -m venv test_env source test_env/bin/activate # On Windows: test_env\Scripts\activate pip install dist/hippius-0.1.0-py3-none-any.whl # Test the installed package hippius --help ``` -------------------------------- ### Install Hippius SDK with Extras (Development) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Install the Hippius SDK dependencies including optional extras like 'encryption' and 'clipboard' support using Poetry. This is needed for features requiring these dependencies. ```bash poetry install -E clipboard ``` -------------------------------- ### Installing Dependencies (Poetry) - Bash Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Installs all project dependencies, including optional extras, using the Poetry package manager. Useful for resolving missing dependency errors. ```bash poetry install --all-extras ``` -------------------------------- ### Installing Hippius SDK Dependencies (Bash) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Installs all required dependencies for the Hippius SDK using Poetry, including optional extras needed for full functionality like password-based encryption. ```bash poetry install --all-extras ``` -------------------------------- ### Quick Start - Initialize Client and Perform IPFS Operations - Python Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Demonstrates how to initialize the asynchronous HippiusClient, perform common IPFS operations such as uploading, downloading, checking existence, retrieving content, and pinning files, and use utility methods for formatting CIDs and file sizes. ```python import asyncio from hippius_sdk import HippiusClient # Initialize the client with default connections to Hippius network client = HippiusClient() # Or specify custom endpoints client = HippiusClient( ipfs_gateway="https://get.hippius.network", # For downloads (default) ipfs_api_url="https://store.hippius.network", # For uploads (default) ) async def main(): # Upload a file to IPFS result = await client.upload_file("path/to/your/model.pt") print(f"File uploaded with CID: {result['cid']}") print(f"File size: {result['size_formatted']}") # Download a file from IPFS dl_result = await client.download_file(result['cid'], "path/to/save/model.pt") print(f"Download successful in {dl_result['elapsed_seconds']} seconds") print(f"File size: {dl_result['size_formatted']}") # Check if a file exists exists_result = await client.exists(result['cid']) print(f"File exists: {exists_result['exists']}") print(f"Gateway URL: {exists_result['gateway_url']}") # Get file content directly content_result = await client.cat(result['cid']) if content_result['is_text']: print(f"Content preview: {content_result['text_preview']}") else: print(f"Binary content (hex): {content_result['hex_preview']}") print(f"Content size: {content_result['size_formatted']}") # Pin a file to ensure it stays on the network pin_result = await client.pin(result['cid']) print(f"Pinning successful: {pin_result['success']}") print(f"Message: {pin_result['message']}") # Format a CID for display (non-async utility function) formatted_cid = client.format_cid(result['cid']) print(f"Formatted CID: {formatted_cid}") # Format file size for display (non-async utility function) formatted_size = client.format_size(1024 * 1024) print(f"Formatted size: {formatted_size}") # Output: 1.00 MB # Run the async function if __name__ == "__main__": asyncio.run(main()) ``` -------------------------------- ### Verifying Hippius SDK Installation (Bash) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Checks if the Hippius SDK package is installed within the current Poetry environment to confirm successful installation. ```bash poetry show hippius ``` -------------------------------- ### Example Hippius SDK Test Script (Python) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md A simple Python script demonstrating how to import the Hippius SDK, load environment variables, create a client, and perform a basic asynchronous operation like checking file existence. ```python # test_script.py import asyncio from hippius_sdk import HippiusClient from dotenv import load_dotenv import os # Load environment variables load_dotenv() # Create a client client = HippiusClient() async def test_ipfs_client(): # Test a simple operation print("Testing IPFS client...") try: result = await client.exists("QmZ4tDuvesekSs4qM5ZBKpXiZGun7S2CYtEZRB3DYXkjGx") print(f"Result: {result}") except Exception as e: print(f"Error: {e}") # Run the async function asyncio.run(test_ipfs_client()) ``` -------------------------------- ### Installing zfec (Poetry) - Bash Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Adds and installs the `zfec` package as a dependency using Poetry, which is required for erasure coding functionality. ```bash poetry add zfec ``` -------------------------------- ### Getting CLI Help - Hippius CLI - Bash Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Displays the main help message for the Hippius CLI, listing available commands and global options. ```bash hippius --help ``` -------------------------------- ### Installing zfec (pip) - Bash Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Installs the `zfec` package using pip, which is required for erasure coding functionality. ```bash pip install zfec ``` -------------------------------- ### Verifying Hippius Installation (Poetry) - Bash Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Checks if the `hippius` package is installed within the current Poetry environment. ```bash poetry show hippius ``` -------------------------------- ### Import Hippius Config from Env (CLI) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Import configuration settings from your local `.env` file into the Hippius SDK configuration. This is useful for migrating existing environment variable setups. ```bash hippius config import-env ``` -------------------------------- ### Managing Hippius SDK Configuration via CLI (Bash) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Use the `hippius config` command in the bash CLI to manage the persistent configuration stored in `~/.hippius/config.json`. You can list all settings or retrieve the value of a specific setting using the `list` and `get` subcommands. ```bash # List all configuration settings hippius config list # Get a specific configuration value hippius config get ipfs gateway ``` -------------------------------- ### Running Local IPFS Daemon - Bash Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Starts a local IPFS daemon process, which is required for IPFS connection if not using remote connections via environment variables. ```bash ipfs daemon ``` -------------------------------- ### Checking Hippius CLI Path (Bash) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Locates the executable path for the `hippius` command-line interface to verify it's accessible in the system's PATH after installation. ```bash which hippius ``` -------------------------------- ### CLI Erasure Coding Commands (Bash) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Provides examples of using the Hippius CLI to perform erasure coding on files with automatic or custom parameters (k, m, chunk-size) and to reconstruct a file from its metadata CID. ```bash # Basic usage with automatic parameter adjustment hippius erasure-code myfile.txt # Specify custom parameters hippius erasure-code large_video.mp4 --k 4 --m 8 --chunk-size 4194304 # For smaller files, using smaller parameters hippius erasure-code small_doc.txt --k 2 --m 5 --chunk-size 4096 # Reconstruct a file from its metadata CID hippius reconstruct QmMetadataCID reconstructed_file.mp4 ``` -------------------------------- ### Erasure Coding Large Files (Adjust Chunk Size) - Hippius CLI - Bash Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Applies erasure coding to a large file, increasing the chunk size to improve performance. The example uses 5MB chunks. ```bash hippius erasure-code large_file.mp4 --chunk-size 5242880 ``` -------------------------------- ### Erasure Coding Large Files (Set Chunk Size) - Hippius CLI - Bash Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Applies erasure coding to a large file, specifying a custom chunk size for improved performance. The example uses 10MB chunks. ```bash hippius erasure-code large_video.mp4 --chunk-size 10485760 ``` -------------------------------- ### Using Multiple Hippius Accounts (Python) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Shows how to programmatically list configured accounts, switch the active account using `set_active_account`, and initialize the `HippiusClient` using either the active account or a specific named account. ```python import asyncio from hippius_sdk import HippiusClient, set_active_account, list_accounts async def main(): # List all accounts accounts = list_accounts() for name, data in accounts.items(): print(f"{name}: {data.get('ss58_address')}") # Switch the active account set_active_account("my-validator") # Create a client with the active account client = HippiusClient(seed_phrase_password="your-password") # Or specify a different account to use client = HippiusClient( account_name="my-developer-account", seed_phrase_password="your-password" ) ``` -------------------------------- ### Setting Up Encryption in Code - Python Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Shows how to configure the HippiusClient to use encryption by providing a decoded base64 key directly during initialization and how to generate a new key programmatically using a utility method. ```python import base64 import asyncio from hippius_sdk import HippiusClient # Decode the base64 key encryption_key = base64.b64decode("your-base64-encoded-key") # Initialize client with encryption enabled client = HippiusClient( encrypt_by_default=True, encryption_key=encryption_key ) async def main(): # Generate a new key programmatically (non-async utility method) encoded_key = client.generate_encryption_key() print(f"Generated key: {encoded_key}") # Run the async function asyncio.run(main()) ``` -------------------------------- ### Listing Configured Hippius Accounts (Bash) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Displays a list of all named accounts that have been configured using the Hippius SDK CLI, showing their names and associated SS58 addresses. ```bash hippius account list ``` -------------------------------- ### Initializing Hippius Client with Seed Password (Python) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Demonstrates how to initialize the `HippiusClient` in Python, showing options for letting the client interactively prompt for a password or providing it directly for seed phrase decryption. ```python import asyncio from hippius_sdk import HippiusClient # The client will prompt for password when needed to decrypt the seed phrase client = HippiusClient() # Or you can provide a password when initializing client = HippiusClient(seed_phrase_password="your-password") async def main(): # Your async code here pass # Run the async function asyncio.run(main()) ``` -------------------------------- ### Performing IPFS Operations with Python SDK Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md This Python code demonstrates how to use the `hippius_sdk.IPFSClient` to interact with IPFS. It covers initializing the client (default or custom endpoints), uploading files and directories, downloading files, checking CID existence, retrieving file content (`cat`), pinning files, and using utility functions for formatting CIDs and file sizes. ```python import asyncio from hippius_sdk import IPFSClient async def main(): # Initialize the IPFS client (uses Hippius relay node by default) ipfs_client = IPFSClient() # Or specify custom endpoints ipfs_client = IPFSClient( gateway="https://get.hippius.network", # For downloads api_url="http://relay-fr.hippius.network:5001" # For uploads ) # Upload a file result = await ipfs_client.upload_file("path/to/your/file.txt") cid = result["cid"] size = result["size_formatted"] # Upload a directory dir_result = await ipfs_client.upload_directory("path/to/your/directory") dir_cid = dir_result["cid"] file_count = dir_result["file_count"] total_size = dir_result["size_formatted"] # Download a file dl_result = await ipfs_client.download_file(cid, "path/to/save/file.txt") success = dl_result["success"] elapsed_time = dl_result["elapsed_seconds"] # Check if a CID exists exists_result = await ipfs_client.exists(cid) exists = exists_result["exists"] gateway_url = exists_result["gateway_url"] # Get file content directly content_result = await ipfs_client.cat(cid) content = content_result["content"] is_text = content_result["is_text"] preview = content_result["text_preview"] if is_text else content_result["hex_preview"] # Pin a file pin_result = await ipfs_client.pin(cid) success = pin_result["success"] message = pin_result["message"] # Format a CID (non-async utility function) formatted_cid = ipfs_client.format_cid("6261666b7265696134...") # Hex-encoded CID # Will return a proper formatted CID like "bafkrei..." # Format a file size (non-async utility function) human_readable = ipfs_client.format_size(1048576) # 1 MB # Run the async function asyncio.run(main()) ``` -------------------------------- ### Performing Encryption Operations via CLI (Bash) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md These bash commands demonstrate how to generate encryption keys using the `hippius keygen` command (with an option to copy to clipboard) and how to use the `--encrypt` and `--decrypt` flags with the `hippius store` and `hippius download` commands for encrypted file transfers. ```bash # Generate an encryption key hippius keygen # Generate and copy to clipboard hippius keygen --copy # Upload with encryption hippius store my_file.txt --encrypt # Download and decrypt hippius download QmCID123 output_file.txt --decrypt ``` -------------------------------- ### Using Hippius Config in Python Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Demonstrates how to retrieve and set configuration values programmatically within Python code using `get_config_value` and `set_config_value`. The `HippiusClient` automatically utilizes these configuration settings. ```python import asyncio from hippius_sdk import get_config_value, set_config_value, HippiusClient # Get a configuration value gateway = get_config_value("ipfs", "gateway") print(f"Current gateway: {gateway}") # Set a configuration value set_config_value("ipfs", "gateway", "https://dweb.link") # Client will automatically use configuration values client = HippiusClient() async def main(): # Your async code here pass # Run the async function asyncio.run(main()) ``` -------------------------------- ### Setting Global CLI Options - Hippius CLI - Bash Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Sets global options for the Hippius CLI, such as specifying gateway and API URLs and enabling verbose output. ```bash hippius --gateway https://get.hippius.network --api-url https://store.hippius.network --verbose ``` -------------------------------- ### Managing Hippius Accounts via CLI (Bash) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Use these bash commands with the `hippius` CLI to check available credits for accounts, view files stored by accounts (including options for specific accounts, viewing all miners, or filtering for erasure-coded files), and inspect erasure-coded files with chunk details. ```bash # Check available credits for an account hippius credits # Check credits for a specific account hippius credits 5H1QBRF7T7dgKwzVGCgS4wioudvMRf9K4NEDzfuKLnuyBNzH # View files stored by an account hippius files # View files for a specific account hippius files 5H1QBRF7T7dgKwzVGCgS4wioudvMRf9K4NEDzfuKLnuyBNzH # Show all miners for each file hippius files --all-miners # View only erasure-coded files hippius ec-files # View erasure-coded files with details about chunks hippius ec-files --show-chunks ``` -------------------------------- ### Run Hippius CLI Script Directly (Testing) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Another method to test the CLI by making the main script executable and running it directly. Requires changing file permissions. ```bash chmod +x hippius_sdk/cli.py ./hippius_sdk/cli.py download QmCID123 output_file.txt ``` -------------------------------- ### Using Encryption with Hippius SDK (Python) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Demonstrates how to use the HippiusClient for file operations (upload, download, cat) with transparent or explicit encryption/decryption control. ```python import asyncio from hippius_sdk import HippiusClient client = HippiusClient() async def main(): # Upload with encryption (uses default setting) result = await client.upload_file("sensitive_data.txt") # Explicitly enable/disable encryption for a specific operation encrypted_result = await client.upload_file("sensitive_data.txt", encrypt=True) unencrypted_result = await client.upload_file("public_data.txt", encrypt=False) # Download and decrypt automatically dl_result = await client.download_file(encrypted_result['cid'], "decrypted_file.txt") # Explicitly control decryption decrypted_result = await client.download_file(encrypted_result['cid'], "output.txt", decrypt=True) raw_result = await client.download_file(encrypted_result['cid'], "still_encrypted.txt", decrypt=False) # View encrypted content content = await client.cat(encrypted_result['cid'], decrypt=True) # Run the async function asyncio.run(main()) ``` -------------------------------- ### Run Hippius SDK Tests (Development) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Execute the test suite for the Hippius SDK using pytest via Poetry. This command runs all tests defined in the project. ```bash poetry run pytest ``` -------------------------------- ### Storing Directory on IPFS and Marketplace - Hippius CLI - Bash Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Stores an entire local directory on IPFS and registers it on the Hippius Marketplace. ```bash hippius store-dir ./my_directory ``` -------------------------------- ### Listing Erasure-Coded Files (Basic) - Hippius CLI - Bash Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Lists all erasure-coded files managed by the Hippius SDK. ```bash hippius ec-files ``` -------------------------------- ### Storing File on IPFS and Marketplace - Hippius CLI - Bash Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Stores a local file on IPFS and registers it on the Hippius Marketplace. ```bash hippius store my_file.txt ``` -------------------------------- ### Run Hippius CLI Module Directly (Testing) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Alternative method to run the Hippius CLI commands directly using the Python module, useful for testing changes without reinstalling the package. ```bash python -m hippius_sdk.cli download QmCID123 output_file.txt ``` -------------------------------- ### Using Erasure Coding with Hippius SDK (Python) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Illustrates how to perform erasure coding on files using the HippiusClient, including default parameters, custom k/m values, chunk size, encryption, and storing coded files in the marketplace, as well as reconstructing files. ```python import asyncio from hippius_sdk import HippiusClient client = HippiusClient() async def main(): # Erasure code a file with default parameters (k=3, m=5) result = await client.erasure_code_file("large_file.mp4") metadata_cid = result["metadata_cid"] # Use custom parameters for more redundancy result = await client.erasure_code_file( file_path="important_data.zip", k=4, # Need 4 chunks to reconstruct m=10, # Create 10 chunks total (6 redundant) chunk_size=2097152, # 2MB chunks encrypt=True # Encrypt before splitting ) # Store erasure-coded file in Hippius marketplace result = await client.store_erasure_coded_file( file_path="critical_backup.tar", k=3, m=5, encrypt=True, miner_ids=["miner1", "miner2", "miner3"] ) # Reconstruct a file from its metadata reconstructed_path = await client.reconstruct_from_erasure_code( metadata_cid=metadata_cid, output_file="reconstructed_file.mp4" ) # Run the async function asyncio.run(main()) ``` -------------------------------- ### Hippius Configuration Structure (JSON) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md This JSON object illustrates the hierarchical structure of the Hippius SDK configuration, showing the available sections and keys like `ipfs`, `substrate`, `encryption`, `erasure_coding`, and `cli`. ```json { "ipfs": { "gateway": "https://get.hippius.network", "api_url": "https://store.hippius.network", "local_ipfs": false }, "substrate": { "url": "wss://rpc.hippius.network", "seed_phrase": null, "default_miners": [], "default_address": null }, "encryption": { "encrypt_by_default": false, "encryption_key": null }, "erasure_coding": { "default_k": 3, "default_m": 5, "default_chunk_size": 1048576 }, "cli": { "verbose": false, "max_retries": 3 } } ``` -------------------------------- ### Configuring Hippius SDK via Environment Variables (.env) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md The Hippius CLI and SDK can read configuration settings from a `.env` file. This snippet shows the format and common variables used, including IPFS gateway/API URLs, Substrate connection details, seed phrase, default miners, and encryption key/default encryption setting. ```env IPFS_GATEWAY=https://get.hippius.network IPFS_API_URL=https://store.hippius.network SUBSTRATE_URL=wss://rpc.hippius.network SUBSTRATE_SEED_PHRASE="your twelve word seed phrase..." SUBSTRATE_DEFAULT_MINERS=miner1,miner2,miner3 HIPPIUS_ENCRYPTION_KEY=your-base64-encoded-key HIPPIUS_ENCRYPT_BY_DEFAULT=true|false ``` -------------------------------- ### Generating Encryption Key via CLI - Bash Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Command-line tool provided by the SDK to generate a new encryption key. The '--copy' flag requires the 'pyperclip' library and copies the generated key to the clipboard. ```bash # After installing the SDK, you can use the built-in command-line tool: hippius-keygen # Generate and copy to clipboard (requires pyperclip) hippius-keygen --copy ``` -------------------------------- ### CLI Erasure Coding & Reconstruction (Bash) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Shows basic and custom parameter usage for erasure coding via the Hippius CLI and the command for reconstructing a file using its metadata CID. ```bash # Basic erasure coding with default parameters (k=3, m=5) hippius erasure-code my_large_file.zip # Erasure code with custom parameters for increased redundancy hippius erasure-code my_important_file.mp4 --k 4 --m 10 --chunk-size 2097152 --encrypt ``` ```bash hippius reconstruct QmMetadataCID reconstructed_filename ``` -------------------------------- ### Running Async Main Function - Python Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md This snippet shows the standard way to run the main asynchronous function (`main()`) of the application or SDK using `asyncio.run()`. This function executes the top-level async function until it completes, handling the asyncio event loop. ```Python asyncio.run(main()) ``` -------------------------------- ### Listing Erasure-Coded Files (All Miners) - Hippius CLI - Bash Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Lists all erasure-coded files and shows the associated miners for each file. ```bash hippius ec-files --all-miners ``` -------------------------------- ### Setting Seed for Named Account (Plain Text) (Bash) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Sets the Substrate seed phrase for a specific named account, storing it in plain text. This allows managing multiple accounts with distinct seeds via the CLI. ```bash hippius seed set "your seed phrase here" --account "my-validator" ``` -------------------------------- ### Downloading File from IPFS - Hippius CLI - Bash Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Downloads a file from IPFS using its Content Identifier (CID) and saves it to a specified output filename. ```bash hippius download QmCID123 output_file.txt ``` -------------------------------- ### Run Specific Hippius SDK Tests (Bash) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Use pytest via Poetry to run specific test files or individual test functions within the Hippius SDK test suite. ```bash # Run specific tests poetry run pytest tests/test_ipfs.py # Run a specific test function poetry run pytest tests/test_ipfs.py::test_upload_file ``` -------------------------------- ### Setting Hippius Seed Phrase (Plain Text) (Bash) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Sets the Substrate seed phrase for the default account, storing it in plain text. This method is less secure and primarily intended for development or testing environments. ```bash hippius seed set "your twelve word seed phrase here" ``` -------------------------------- ### Setting Hippius Seed Phrase (Encrypted) (Bash) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Sets the Substrate seed phrase for the default account and encrypts it using a password provided interactively. This requires the `pynacl` and `cryptography` Python packages. ```bash hippius seed set "your twelve word seed phrase here" --encode ``` -------------------------------- ### Listing Erasure-Coded Files (Show Chunks) - Hippius CLI - Bash Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Lists all erasure-coded files and shows the associated chunks for each file. ```bash hippius ec-files --show-chunks ``` -------------------------------- ### Set Hippius Config Value (CLI) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Use the `hippius config set` command to set a specific configuration value. This command takes the section, key, and value as arguments. ```bash hippius config set ipfs gateway https://get.hippius.network ``` -------------------------------- ### Displaying File Content from IPFS - Hippius CLI - Bash Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Retrieves and displays the content of a file stored on IPFS using its Content Identifier (CID). ```bash hippius cat QmCID123 ``` -------------------------------- ### Handling Erasure Coding via CLI (Bash) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Utilize these bash commands for erasure coding files with the `hippius erasure-code` command, allowing default or custom parameters (k, m, chunk-size, encryption). You can also reconstruct files from metadata using `hippius reconstruct` and list/inspect erasure-coded files with `hippius ec-files`. ```bash # Erasure code a file with default parameters (k=3, m=5) hippius erasure-code large_file.mp4 # Erasure code with custom parameters hippius erasure-code important_data.zip --k 4 --m 10 --chunk-size 2097152 --encrypt # Reconstruct a file from its metadata hippius reconstruct QmMetadataCID reconstructed_file.mp4 # List all your erasure-coded files with metadata CIDs hippius ec-files # Show all miners for each erasure-coded file hippius ec-files --all-miners # Show detailed information including associated chunks hippius ec-files --show-chunks ``` -------------------------------- ### Checking Hippius CLI Path - Bash Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Locates the executable path for the `hippius` command, useful for troubleshooting "command not found" errors. ```bash which hippius ``` -------------------------------- ### Viewing Default Address - Hippius CLI - Bash Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Displays the currently configured default account address for read-only operations. ```bash hippius address get-default ``` -------------------------------- ### Setting Default Hippius Address (Bash) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Configures a default SS58 address for the Hippius SDK CLI to use for read-only operations when no specific account is specified, resolving potential address errors. ```bash hippius address set-default 5H1QBRF7T7dgKwzVGCgS4wioudvMRf9K4NEDzfuKLnuyBNzH ``` -------------------------------- ### Setting Encrypted Seed for Named Account (Bash) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Sets the Substrate seed phrase for a specific named account and encrypts it using a password prompted during execution, providing enhanced security for individual accounts. ```bash hippius seed set "another seed phrase" --account "my-developer-account" --encode ``` -------------------------------- ### Setting Default Address - Hippius CLI - Bash Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Sets a default account address for read-only operations, avoiding the need to specify the address for commands like `files` and `ec-files`. ```bash hippius address set-default 5H1QBRF7T7dgKwzVGCgS4wioudvMRf9K4NEDzfuKLnuyBNzH ``` -------------------------------- ### Reconstructing Erasure-Coded Files - Hippius CLI - Bash Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Reconstructs a file from its erasure-coded chunks using the metadata CID. ```bash hippius reconstruct QmMetadataCID reconstructed_filename ``` -------------------------------- ### Switching Active Hippius Account (Bash) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Sets the specified named account as the currently active account. Subsequent CLI operations will use this account by default unless another is specified. ```bash hippius account switch my-developer-account ``` -------------------------------- ### Erasure Coding Directories - Hippius CLI - Bash Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Applies erasure coding to an entire directory. The CLI will prompt for options (archive or individual files). ```bash hippius erasure-code my_directory/ ``` -------------------------------- ### Erasure Coding Small Files (Adjust k/m) - Hippius CLI - Bash Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Applies erasure coding to a small file, adjusting the `k` (data blocks) and `m` (parity blocks) parameters to avoid "Wrong length for input blocks" errors. ```bash hippius erasure-code small_file.txt --k 2 --m 3 ``` -------------------------------- ### Reset Hippius Config (CLI) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Reset the Hippius SDK configuration back to its default values. This command clears any custom settings you may have applied. ```bash hippius config reset ``` -------------------------------- ### Checking Status of Specific Hippius Account (Bash) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Displays the seed phrase status (set/encrypted) for a specific named account, allowing users to check the configuration of accounts other than the currently active one. ```bash hippius seed status --account my-validator ``` -------------------------------- ### Encrypting Existing Hippius Seed Phrase (Bash) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Encrypts an already set, plain-text seed phrase for the default account using a password prompted during execution. This enhances security for existing configurations. ```bash hippius seed encode ``` -------------------------------- ### Checking Hippius Seed Phrase Status (Bash) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Displays the current status of the default account's seed phrase, indicating whether it is set and if it is stored in plain text or encrypted form. ```bash hippius seed status ``` -------------------------------- ### Deleting a Hippius Account (Bash) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Removes the specified named account and its associated configuration, including the seed phrase, from the Hippius SDK storage. ```bash hippius account delete my-developer-account ``` -------------------------------- ### Temporarily Decrypting Hippius Seed Phrase (Bash) Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Temporarily decrypts and displays the encrypted seed phrase for the default account after prompting for the password. Use this command with caution in secure environments. ```bash hippius seed decode ``` -------------------------------- ### Clearing Default Address - Hippius CLI - Bash Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Removes the currently configured default account address. ```bash hippius address clear-default ``` -------------------------------- ### Checking if CID Exists - Hippius CLI - Bash Source: https://github.com/thenervelab/hippius-sdk/blob/main/README.md Checks if a given IPFS Content Identifier (CID) exists and is accessible. ```bash hippius exists QmCID123 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.