### Manual hApp Installation (Kando Example) Source: https://github.com/holo-host/edgenode/blob/main/docker/DEVELOPERS.md This sequence demonstrates the manual installation of a hApp, using Kando as an example. It involves obtaining an agent key, downloading the hApp, and then using `hc s` to call the `install-app` function with necessary parameters like network seed, agent key, and app ID. ```sh su - nonroot export ADMIN_PORT= export AGENT_KEY=$(hc s -f $ADMIN_PORT call new-agent | awk '{print $NF}') export APP_ID="kando::v0.13.0::$AGENT_KEY" wget https://github.com/holochain-apps/kando/releases/download/v0.13.0/kando.happ export NETWORK_SEED="" hc s -f $ADMIN_PORT call install-app ./kando.happ $NETWORK_SEED --agent-key "$AGENT_KEY" --app-id "$APP_ID" ``` -------------------------------- ### Test holochain and hc Binaries with Docker Source: https://github.com/holo-host/edgenode/blob/main/docker/DEVELOPERS.md This snippet demonstrates how to start an edgenode Docker container, execute commands inside it, and verify the installation of holochain, hc, and lair-keystore by checking their paths and versions. Ensure Docker is installed and running. ```sh docker run --name edgenode -dit ghcr.io/holo-host/edgenode docker exec -it edgenode /bin/sh which holochain which hc holochain --version hc --version lair-keystore --version ``` -------------------------------- ### Install Holo-Host OS Draft (Holoport) Source: https://github.com/holo-host/edgenode/blob/main/USAGE.md Command to initiate the installation of the Holo-Host OS draft onto the primary hard drive of a Holoport device. This command assumes the system is booted from the USB installer and the target drive is identified as `sda`. The system will reboot after installation. ```bash install-draft sda ``` -------------------------------- ### Download hApp Configuration File Source: https://github.com/holo-host/edgenode/blob/main/USAGE.md Command to download a hApp configuration file from a remote URL using `wget`. This is typically done on the edge node machine before installing the hApp. The example uses a GitHub Gist URL. ```bash wget https://gist.github.com/zippy/28a93d63470256bde57738336a476e18 ``` -------------------------------- ### Running a Holochain Sandbox Source: https://github.com/holo-host/edgenode/blob/main/docker/DEVELOPERS.md This command starts a Holochain sandbox with the ID '0'. It will output the admin port, which is crucial for subsequent operations like installing hApps. ```sh hc sandbox run 0 ``` -------------------------------- ### Scripted hApp Installation Source: https://github.com/holo-host/edgenode/blob/main/docker/DEVELOPERS.md This script installs a hApp using the `install_happ` command. It requires the admin port of a running sandbox and a JSON configuration file for the hApp. Ensure you are in the container and have exported the `ADMIN_PORT`. ```sh su - nonroot export ADMIN_PORT= install_happ $ADMIN_PORT ``` -------------------------------- ### Verifying hApp Installation Source: https://github.com/holo-host/edgenode/blob/main/docker/DEVELOPERS.md These commands verify that a hApp has been successfully installed and check the network statistics. `list-apps` shows installed applications, while `dump-network-stats` provides information about the Holochain network. ```sh hc s -f $ADMIN_PORT call list-apps hc s -f $ADMIN_PORT call dump-network-stats ``` -------------------------------- ### Example CLI Commands for Configuration Management Source: https://github.com/holo-host/edgenode/blob/main/tools/happ_config_file/README.md Demonstrates practical usage of the happ_config_file CLI for creating and validating configuration files. Includes examples for creating files with and without options, and for validating an existing file. ```bash # Create with an explicit name; writes my_app_config.json with app.name = "my_app" happ_config_file create --name my_app --gateway --economics --init-zome-calls # Create with defaults; writes example_happ_config.json with app.name = "example_happ" happ_config_file create # Validate a file happ_config_file validate --input ./example_happ_config.json ``` -------------------------------- ### Install hApp using Configuration File Source: https://github.com/holo-host/edgenode/blob/main/USAGE.md Command to install a Holochain Application (hApp) onto the edge node using a previously created and validated JSON configuration file. The `install_happ` command reads the configuration and sets up the application environment. ```bash install_happ example_config.json ``` -------------------------------- ### Install WebHapp with Configuration (Bash) Source: https://context7.com/holo-host/edgenode/llms.txt Bash command to install a Holochain Web hApp using a provided JSON configuration file. The `install_happ` script automates the download, unpacking, verification, and installation process. ```bash # Install .webhapp (automatically extracts .happ file) install_happ webhapp_config.json # Script automatically: # 1. Downloads .webhapp file # 2. Extracts .happ using 'hc web-app unpack' # 3. Verifies SHA256 if provided in config # 4. Installs extracted .happ file # 5. Executes initZomeCalls if configured ``` -------------------------------- ### Listing Installed hApps Source: https://github.com/holo-host/edgenode/blob/main/docker/DEVELOPERS.md This command lists all installed hApps within the running Holochain sandbox. It can be executed with or without specifying the admin port, using the default if not provided. ```sh su - nonroot export ADMIN_PORT= list_happs $ADMIN_PORT # Or with default port: list_happs ``` -------------------------------- ### Build happ_config_file Utility with Cargo Source: https://github.com/holo-host/edgenode/blob/main/DEVELOPERS.md Compiles the 'happ_config_file' utility written in Rust using Cargo. Requires Rust and Cargo to be installed. ```bash cd tools/happ_config_file cargo build --release ``` -------------------------------- ### Installing and Enabling a hApp via Script Source: https://github.com/holo-host/edgenode/blob/main/docker/README.md Steps to install a hApp using the 'install_happ' script within the Edge Node container, followed by enabling it. Supports URLs for .happ and .webhapp files. Requires interactive shell access. ```sh su - nonroot install_happ enable_happ ``` -------------------------------- ### Run Holochain Edgenode Docker Container for Development Source: https://github.com/holo-host/edgenode/blob/main/DEVELOPERS.md Runs the Holochain Edge Node container in interactive mode with persistent storage and port mapping. Requires a built Docker image and Docker installed. ```bash # Create a directory for persistent data mkdir -p ./holo-data-dev # Run the container in interactive mode docker run --name edgenode-dev -it \ -v $(pwd)/holo-data-dev:/data \ -p 4444:4444 \ local-edgenode ``` -------------------------------- ### Manually Run Holochain Conductor Source: https://github.com/holo-host/edgenode/blob/main/docker/DEVELOPERS.md Command to manually start the Holochain conductor using a specified configuration file. This is typically done after the container is set up and configured. ```sh holochain -c /etc/holochain/conductor-config.yaml ``` -------------------------------- ### WebHapp Installation Configuration (JSON) Source: https://context7.com/holo-host/edgenode/llms.txt JSON configuration file for installing Holochain Web hApps (.webhapp files). It specifies application details, network settings, and modifiers. The install_happ script uses this file to download, unpack, verify, and install the hApp. ```json { "app": { "name": "rhymez", "version": "0.1.0", "happUrl": "https://example.com/rhymez.webhapp", "modifiers": { "networkSeed": "test-network-001", "properties": "" } }, "env": { "holochain": { "version": "", "flags": [""], "bootstrapUrl": "https://bootstrap.holo.host", "signalServerUrl": "wss://signal.holo.host", "stunServerUrls": ["stun:stun.cloudflare.com:3478"] } } } ``` -------------------------------- ### Build Holochain Edgenode Docker Image Source: https://github.com/holo-host/edgenode/blob/main/DEVELOPERS.md Builds the Docker image for the Holochain Edge Node locally using the provided Dockerfile. Requires Docker to be installed and running. ```bash cd docker docker build -t local-edgenode . cd .. ``` -------------------------------- ### Minimal JSON Configuration Example Source: https://github.com/holo-host/edgenode/blob/main/tools/happ_config_file/README.md A basic JSON configuration structure for Edge Node tools, excluding optional sections such as gateway, economics, and init_zome_calls. This serves as a baseline for valid configurations. ```json { "app": { "name": "example_happ", "version": "0.1.0", "happUrl": "https://github.com/example/v0.1.0/example_happ.happ", "modifiers": { "networkSeed": "", "properties": "" } }, "env": { "holochain": { "version": "", "flags": [""], "bootstrapUrl": "", "signalServerUrl": "", "stunServerUrls": [""] } } } ``` -------------------------------- ### Clone Holochain Edgenode Repository Source: https://github.com/holo-host/edgenode/blob/main/DEVELOPERS.md Clones the official Holochain Edgenode repository from GitHub and navigates into the project directory. Requires Git to be installed. ```bash git clone https://github.com/Holo-Host/edgenode.git cd edgenode ``` -------------------------------- ### Listing Installed hApps in the Container Source: https://github.com/holo-host/edgenode/blob/main/docker/README.md Commands to list all installed hApps within the Edge Node container. Can be run with or without specifying the admin port. ```sh su - nonroot export ADMIN_PORT= list_happs $ADMIN_PORT ``` ```sh list_happs ``` -------------------------------- ### Install hApp with Explicit or Default Node Name (Bash) Source: https://context7.com/holo-host/edgenode/llms.txt Bash commands for installing a hApp using `install_happ`, with options to explicitly provide a node name for parameter substitution or let it default to the hostname. This is used in conjunction with `initZomeCalls` configurations. ```bash # Install with explicit node name (replaces all occurrences) install_happ profiles_config.json production-node-01 # Install without node name (defaults to hostname) install_happ profiles_config.json # Init zome calls executed automatically after enabling app # Requires zome-call authorization via admin API # DnaHash extracted from installed app info ``` -------------------------------- ### List Installed hApps Source: https://github.com/holo-host/edgenode/blob/main/USAGE.md Command to display a list of all Holochain Applications (hApps) currently installed and running on the edge node. This is used to verify successful installation and manage deployed applications. ```bash list_happs ``` -------------------------------- ### Write Holo-Host ISO to USB (Linux) Source: https://github.com/holo-host/edgenode/blob/main/USAGE.md Command to write the Holo-Host OS ISO image to a USB drive using the `dd` utility on Linux. This is a crucial step for installing the OS on a HoloPort or spare computer. Ensure the correct device path for the USB stick is used to avoid data loss. ```bash dd if=./holos-0.0.6.iso of=/dev/sdX bs=1024k conv=sync ``` -------------------------------- ### Restrict logging helper to setup, test, or teardown functions using batslib_is_caller Source: https://github.com/holo-host/edgenode/blob/main/docker/tests/libs/bats-support/README.md This example shows a `log_test` helper function restricted to be called from `setup`, any test function (identified by `$BATS_TEST_NAME`), or `teardown`. It uses `batslib_is_caller` with `--indirect` and logical OR operators to check if the call originates from any of these allowed contexts. If not, an error is logged and the function fails. ```shell log_test() { # Check caller. if ! ( batslib_is_caller --indirect 'setup' \ || batslib_is_caller --indirect "$BATS_TEST_NAME" \ || batslib_is_caller --indirect 'teardown' ) then echo "Must be called from \`setup', \`@test' or \`teardown'" \ | batslib_decorate 'ERROR: log_test' \ | fail return $? fi # Body goes here... } ``` -------------------------------- ### Creating a Holochain Sandbox Source: https://github.com/holo-host/edgenode/blob/main/docker/DEVELOPERS.md This command creates a Holochain sandbox within the container. It specifies the root directory for the sandbox, the conductor configuration file path, and the data root path for Holochain. This setup ensures persistent storage is utilized for the conductor and its data. ```sh hc sandbox create --root /home/nonroot/ \ --conductor-config /etc/holochain/conductor-config.yaml \ --data-root-path /var/local/lib/holochain ``` -------------------------------- ### Init Zome Calls Configuration with Dynamic Node Names (JSON) Source: https://context7.com/holo-host/edgenode/llms.txt JSON configuration for hApp installation that includes `initZomeCalls`. This allows for automatic execution of zome functions after installation, with dynamic substitution of parameters like ``. Requires zome-call authorization via the admin API. ```json { "app": { "name": "profiles_app", "version": "1.0.0", "happUrl": "https://example.com/profiles.happ", "modifiers": { "networkSeed": "production-net", "properties": "" }, "initZomeCalls": [ { "zome": "profiles", "fn_name": "create_profile", "payload": { "nickname": "-node", "fields": { "location": "datacenter-01", "role": "relay" } } }, { "zome": "config", "fn_name": "initialize", "payload": { "node_id": "", "auto_relay": true } } ] }, "env": { "holochain": { "version": "", "flags": [""], "bootstrapUrl": "", "signalServerUrl": "", "stunServerUrls": [""] } } } ``` -------------------------------- ### Manual Conductor Execution and Log Viewing (Bash) Source: https://context7.com/holo-host/edgenode/llms.txt Provides bash commands for manually starting the Holochain conductor and viewing its startup logs. The conductor is typically managed by tini for automatic restarts. Log rotation is handled by logrotate. ```bash # Conductor automatically starts with container # Configuration persisted at /data/holochain/etc/conductor-config.yaml # Manual conductor execution (if needed) holochain --piped --config-path /etc/holochain/conductor-config.yaml # Process managed by tini with automatic restart on failure # View startup logs cat /data/logs/startup.log # Logs rotated daily, 7 days retention # Rotation configured in /etc/logrotate.d/holochain.conf ``` -------------------------------- ### Pulling the Edge Node Docker Image Source: https://github.com/holo-host/edgenode/blob/main/docker/README.md Instructions to log in to GitHub Container Registry and pull the latest Edge Node Docker image. Requires Docker to be installed and running. ```sh # Log in to GitHub Container Registry docker login ghcr.io # Pull the latest image docker pull ghcr.io/holo-host/edgenode ``` -------------------------------- ### Configuring WebRTC in Conductor Source: https://github.com/holo-host/edgenode/blob/main/docker/DEVELOPERS.md This snippet shows the YAML configuration required for WebRTC within the conductor configuration file. It specifies STUN servers for establishing peer-to-peer connections, essential for distributed applications. ```yaml webrtc_config: iceServers: - urls: - stun:stun.cloudflare.com:3478 - urls: - stun:stun.l.google.com:19302 ``` -------------------------------- ### Validate hApp Configuration File Source: https://github.com/holo-host/edgenode/blob/main/USAGE.md Command to validate the structure and content of a downloaded hApp configuration JSON file using the `happ_config_file` tool. This step ensures the configuration is correctly formatted before attempting to install the application. ```bash happ_config_file validate --input example_config.json ``` -------------------------------- ### Accessing the Edge Node Container Shell Source: https://github.com/holo-host/edgenode/blob/main/docker/README.md Command to get an interactive shell inside a running Edge Node container. Requires the container to be named 'edgenode'. ```sh docker exec -it edgenode su - nonroot ``` -------------------------------- ### Deploy Edge Node Docker Container Source: https://context7.com/holo-host/edgenode/llms.txt Instructions for pulling the Edge Node Docker image, running it with persistent storage, accessing its shell, and monitoring Holochain logs. This setup ensures the Holochain conductor is available and logs can be accessed. ```bash # Pull the container image from GitHub Container Registry docker pull ghcr.io/holo-host/edgenode # Run container with persistent data volume mounted docker run --name edgenode -dit \ -v $(pwd)/holo-data:/data \ -p 4444:4444 \ ghcr.io/holo-host/edgenode # Access interactive shell as nonroot user docker exec -it edgenode su - nonroot # Verify Holochain conductor is running ps -ef | grep holochain # View live Holochain logs docker exec -it edgenode tail -f /data/logs/holochain.log # Access logs from host system cat ./holo-data/logs/holochain.log ``` -------------------------------- ### Manage Holochain Applications Lifecycle Source: https://context7.com/holo-host/edgenode/llms.txt Covers the installation, enablement, disabling, and uninstallation of Holochain applications (hApps) using the `install_happ`, `list_happs`, `enable_happ`, `disable_happ`, and `uninstall_happ` scripts. It details how to specify configuration files, node names, and admin ports. ```bash # Download configuration file from remote source ... # Validate configuration before installation happ_config_file validate --input config.json # Install hApp with default admin port (4444) install_happ config.json # Install hApp with custom node name (replaces placeholder) install_happ config.json mynode01 # Install hApp with custom admin port install_happ -p 4444 config.json mynode01 # List all installed hApps list_happs # Enable a specific hApp by APP_ID enable_happ kando::0.14.0::uhCAkWCsAgoKkkfwyJAglj30xX_GLLV # Disable a running hApp disable_happ kando::0.14.0::uhCAkWCsAgoKkkfwyJAglj30xX_GLLV # Uninstall a hApp completely uninstall_happ kando::0.14.0::uhCAkWCsAgoKkkfwyJAglj30xX_GLLV # Management with custom admin port list_happs -p 4444 enable_happ -p 4444 my_app::1.0.0::uhCAk... ``` -------------------------------- ### Troubleshoot Holochain Logs Source: https://github.com/holo-host/edgenode/blob/main/docker/DEVELOPERS.md Provides commands to access and view Holochain logs stored within the container. Logs are redirected to '/data/logs/holochain.log' for persistence and can be accessed via volume mounts, direct copying, or by viewing live output. ```sh docker cp edgenode:/data/logs/holochain.log . ``` ```sh docker exec -it edgenode tail -f /data/logs/holochain.log ``` -------------------------------- ### HolOS Build System Commands (Make) Source: https://context7.com/holo-host/edgenode/llms.txt Makefile targets for building HoloOS ISO images. Includes commands for building the ISO, running in KVM, cleaning build artifacts, and customizing build configurations using menuconfig. Also shows how to save configurations and write the ISO to a USB stick. ```bash # Build complete HolOS ISO image cd holos make iso # Build and test in KVM virtual machine make run # Clean build artifacts but keep downloaded sources make clean # Remove all build artifacts including sources make distclean # Customize build configuration make -C tmp/buildroot-2025.08 O=../br-build menuconfig # Save updated configuration cp tmp/br-build/.config holos-buildroot-2025.08.config # Rebuild with changes make iso # Write ISO to USB stick for physical installation dd if=./holos-0.0.6.iso of=/dev/sdX bs=1024k conv=sync # Boot and configure networking on Holoport modprobe r8169 && ifconfig eth0 up && udhcpc eth0 # Boot and configure networking on KVM modprobe virtio_net && ifconfig eth0 up && udhcpc eth0 ``` -------------------------------- ### Available Make Targets Source: https://github.com/holo-host/edgenode/blob/main/holos/README.md A list of available Make targets for building, cleaning, and running the Holo Operating System. These commands are used to manage the build process and interact with the OS image. ```makefile Make targets: - help This output - all Build whole set of artifacts - iso Build hybrid-boot ISO - run Boot the ISO image inside KVM with QEMU on Linux - distclean Remove all build artifacts - clean Remove build artifacts, keeping downloaded sources ``` -------------------------------- ### Configure Daily Log Rotation with Gzip Compression Source: https://github.com/holo-host/edgenode/blob/main/docker/README.md This snippet shows the background loop in entrypoint.sh that executes log rotation daily. It uses the logrotate command with a specified configuration file and includes a sleep interval of 24 hours (86400 seconds) to ensure daily execution. Log compression is handled by gzip as defined in the holochain.conf file. ```bash while true; do logrotate /etc/logrotate.d/holochain.conf; sleep 86400; done ``` -------------------------------- ### Create hApp Configuration File (JSON) Source: https://github.com/holo-host/edgenode/blob/main/USAGE.md Template for creating a JSON configuration file for a Holochain Application (hApp). This file specifies application details, environment settings for Holochain and gateway, and economics-related fields. It allows for custom network seeds, initialization zome calls with dynamic payload substitution, and future economic integrations. ```json { "app": { "name": "example_happ", "version": "0.1.0", "happUrl": "https://github.com/example/v0.1.0/example_happ.happ", "modifiers": { "networkSeed": "", "properties": {} }, "init_zome_calls": [ { "fn_name": "some_zome_fn", "payload": {} } ] }, "env": { "holochain": { "version": "", "flags": [""], "bootstrapUrl": "", "signalServerUrl": "" }, "gw": { "enable": false, "allowedFns": [""], "dnsProps": [""] } }, "economics": { "payorUnytAgentPubKey": "", "agreementHash": "", "payeeUnytAgentPubKey": "", "priceSheetHash": "" } } ``` -------------------------------- ### Configure Wired Network (KVM VM) Source: https://github.com/holo-host/edgenode/blob/main/holos/README.md Commands to configure the wired network interface using DHCP within a KVM virtual machine. This loads the 'virtio_net' driver and uses DHCP to set up the 'eth0' interface. This is specific to KVM environments. ```bash modprobe virtio_net && ifconfig eth0 up && udhcpc eth0 ``` -------------------------------- ### Create Configuration File Template Source: https://github.com/holo-host/edgenode/blob/main/tools/happ_config_file/README.md Generates a JSON configuration file template for Edge Node tools. Options allow specifying an application name, including optional gateway and economics sections, and an initial zome calls block. ```bash happ_config_file create [--name ] [--gateway] [--economics] [--init-zome-calls] ``` -------------------------------- ### Run Sandbox in Debug Mode Source: https://github.com/holo-host/edgenode/blob/main/docker/DEVELOPERS.md Enables verbose logging for the Holochain sandbox by setting the RUST_LOG environment variable to 'debug'. This is useful for detailed troubleshooting of sandbox behavior. ```sh RUST_LOG=debug hc sandbox run 0 ``` -------------------------------- ### Modify OS Userspace Configuration Source: https://github.com/holo-host/edgenode/blob/main/holos/README.md Steps to modify the Holo Operating System's userspace using Buildroot's menuconfig. This involves building the ISO, configuring Buildroot, and updating the configuration file before rebuilding the ISO. ```bash 1. Build the current version using `make iso` 2. Use the buildroot `menuconfig` target to make the desired changes using `make -C tmp/buildroot-2025.08 O=../br-build menuconfig`. 3. Replace the holos configuration file with the buildroot-generated configuration file using `cp tmp/br-build/.config holos-buildroot-2025.08.config` 4. Build the changes using `make iso` ``` -------------------------------- ### Access Holochain Edgenode Container Shell Source: https://github.com/holo-host/edgenode/blob/main/DEVELOPERS.md Executes a command inside a running Holochain Edge Node Docker container to open an interactive shell. Requires the container to be running. ```bash docker exec -it edgenode-dev /bin/sh # Inside the container, switch to the nonroot user: su - nonroot ``` -------------------------------- ### Pulling the Edge Node Docker Image Source: https://github.com/holo-host/edgenode/blob/main/docker/DEVELOPERS.md This command pulls the latest Edge Node container image from GitHub Container Registry. Ensure you are logged in to the registry first. This is a prerequisite for running the container. ```sh docker login ghcr.io docker pull ghcr.io/holo-host/edgenode ``` -------------------------------- ### Running the Edge Node Container with Persistent Storage Source: https://github.com/holo-host/edgenode/blob/main/docker/README.md Command to run the Edge Node container in detached interactive mode, mapping a local directory for persistent data storage. Assumes Docker is running. ```sh docker run --name edgenode -dit \ -v $(pwd)/holo-data:/data \ ghcr.io/holo-host/edgenode ``` -------------------------------- ### Test Holochain Persistence with Docker Source: https://github.com/holo-host/edgenode/blob/main/docker/DEVELOPERS.md Executes a script to verify that data persistence is functioning correctly with the Docker container. The script creates, stops, restarts, and verifies data in a container using persistent volume mounts. ```sh docker/test_persistence.sh ``` -------------------------------- ### Persistent Storage Volume Mapping and Symlinks Source: https://github.com/holo-host/edgenode/blob/main/docker/README.md This section describes the persistent storage configuration for the Holo Host Edgenode. It details how the host directory './holo-data' is mounted to '/data' within the container. Furthermore, it explains the symlinks created from '/data/holochain/etc' to '/etc/holochain' and from '/data/holochain/var' to '/var/local/lib/holochain', ensuring data written to these container paths is persisted on the host. ```mermaid graph TD subgraph Host direction LR host_dir["./holo-data"] end subgraph Container direction LR subgraph "Volume Mount" direction LR data_vol["/data"] end subgraph "Persistent Storage" direction LR etc_holochain["/etc/holochain"] var_holochain["/var/local/lib/holochain"] end subgraph "Symlinks" direction LR data_etc["/data/holochain/etc"] data_var["/data/holochain/var"] end end host_dir -- "-v" --> data_vol data_etc -.-> etc_holochain data_var -.-> var_holochain ``` -------------------------------- ### Production Deployment of Holochain Conductor Source: https://github.com/holo-host/edgenode/blob/main/docker/DEVELOPERS.md Deploys the Holochain conductor in a Docker container for production. It stops and removes existing containers, runs a new container with persistent volume mounts and port forwarding, and outlines conductor configuration requirements. ```sh docker stop edgenode && docker rm edgenode ``` ```sh docker run --name edgenode -dit \ -v $(pwd)/holo-data:/data \ -p 4444:4444 \ ghcr.io/holo-host/edgenode ``` -------------------------------- ### Configure Wired Network (Holoport/Holoport Plus) Source: https://github.com/holo-host/edgenode/blob/main/holos/README.md Commands to configure the wired network interface using DHCP on Holoport and Holoport Plus devices. This involves loading the kernel driver and initiating DHCP. It assumes the network interface is named 'eth0'. ```bash modprobe r8169 && ifconfig eth0 up && udhcpc eth0 ``` -------------------------------- ### Build happ_config_file CLI with Cargo Source: https://github.com/holo-host/edgenode/blob/main/tools/happ_config_file/README.md Builds the happ_config_file CLI tool in release mode using Cargo, Rust's package manager. This command compiles the project and produces an optimized binary. ```bash cargo build --release ``` -------------------------------- ### Option Parsing with '--' Source: https://github.com/holo-host/edgenode/blob/main/docker/tests/libs/bats-assert/README.md Demonstrates disabling option parsing for subsequent arguments by using '--'. This allows arguments that are identical to options to be treated as literal values. ```bash assert_output -- '-p' ``` ```bash refute_line -- '--' ``` -------------------------------- ### Running the Edge Node Docker Container Source: https://github.com/holo-host/edgenode/blob/main/docker/DEVELOPERS.md This command runs the Edge Node container in detached mode and allocates a pseudo-TTY. It also maps a local directory for persistent storage to the container's /data volume. This ensures that data like configurations and app data are not lost when the container is stopped or removed. ```sh docker run --name edgenode -dit \ -v $(pwd)/holo-data:/data \ ghcr.io/holo-host/edgenode ``` -------------------------------- ### Create and Validate Holochain Application Configuration Source: https://context7.com/holo-host/edgenode/llms.txt Demonstrates using the `happ_config_file` CLI tool to generate and validate JSON configuration files for Holochain applications. This includes creating configurations with various options and validating their structure. ```bash # Create configuration with all optional sections happ_config_file create --name my_app --gateway --economics --init-zome-calls # Create minimal configuration with defaults (example_happ_config.json) happ_config_file create # Validate a configuration file happ_config_file validate --input ./my_app_config.json # Example configuration file structure cat > kando_config.json << 'EOF' { "app": { "name": "kando", "version": "0.14.0", "happUrl": "https://github.com/holochain-apps/kando/releases/download/v0.14.0/kando.happ", "happSha256": "3d156f802dbcad7364c7fa7aa9d72ba253fa40dd806db56f18fc6a2883cb6ce2", "modifiers": { "networkSeed": "", "properties": "" }, "initZomeCalls": [ { "zome": "profiles", "fn_name": "create_profile", "payload": {"nickname": "-aon", "fields":{}} } ] }, "env": { "holochain": { "version": "", "flags": [""], "bootstrapUrl": "", "signalServerUrl": "", "stunServerUrls": [""] } } } EOF ``` -------------------------------- ### assert_output() Regular Expression Matching Source: https://github.com/holo-host/edgenode/blob/main/docker/tests/libs/bats-assert/README.md Enables regular expression matching for assert_output, failing if the extended regular expression does not match the output. Anchors ^ and $ bind to the entire output. Mutually exclusive with --partial. Displays regexp and output on failure. ```bash @test 'assert_output() regular expression matching' { run echo 'Foobar 0.1.0' assert_output --regexp '^Foobar v[0-9]+\.[0-9]+\.[0-9]$' } ``` -------------------------------- ### refute_output() Regular Expression Matching Source: https://github.com/holo-host/edgenode/blob/main/docker/tests/libs/bats-assert/README.md Enables regular expression matching for refute_output, failing if the extended regular expression matches the output. Anchors ^ and $ bind to the entire output. Mutually exclusive with --partial. Displays regexp and output on failure. ```bash @test 'refute_output() regular expression matching' { run echo 'Foobar v0.1.0' refute_output --regexp '^Foobar v[0-9]+\.[0-9]+\.[0-9]$' } ``` -------------------------------- ### refute_output() Partial Matching Source: https://github.com/holo-host/edgenode/blob/main/docker/tests/libs/bats-assert/README.md Enables partial matching for refute_output, failing if the unexpected substring is found in the output. Mutually exclusive with --regexp. Displays substring and output on failure. ```bash @test 'refute_output() partial matching' { run echo 'ERROR: no such file or directory' refute_output --partial 'ERROR' } ``` -------------------------------- ### Production Deployment: Running the Edge Node Container Source: https://github.com/holo-host/edgenode/blob/main/docker/README.md Command to run the Edge Node container for production, including port mapping for the conductor and persistent storage. Stops and removes any existing container with the same name. ```sh # Remove any prior containers if you need to: docker stop edgenode && docker rm edgenode docker run --name edgenode -dit \ -v $(pwd)/holo-data:/data \ -p 4444:4444 \ ghcr.io/holo-host/edgenode ``` -------------------------------- ### Persistent Storage Architecture: Host Directory Structure Source: https://context7.com/holo-host/edgenode/llms.txt Illustrates the host directory structure for managing persistent Holochain data. It shows how conductor configuration and application data are organized, with symlinks pointing to the actual data locations within the container. ```bash # Host directory structure ./holo-data/ ├── holochain/ │ ├── etc/ # Symlinked to /etc/holochain │ └── var/ # Symlinked to /var/local/lib/holochain │ ├── ks/ # Keystore (lair) │ └── tmp/ # Downloaded hApp files └── logs/ ├── holochain.log # Conductor logs └── startup.log # Container startup logs # Container symlinks created by entrypoint.sh ln -sf /data/holochain/etc /etc/holochain ln -sf /data/holochain/var /var/local/lib/holochain ``` -------------------------------- ### Happ Config File CLI Tool Source: https://github.com/holo-host/edgenode/blob/main/tools/README.md Command-line interface for managing hApp configuration files. It allows creating template configuration files and validating existing ones against expected schemas. No external dependencies are required beyond the tool itself. ```shell $ happ_config_file Create and validate JSON config files Usage: happ_config_file Commands: create Create a template configuration file validate Validate a configuration file help Print this message or the help of the given subcommand(s) Options: -h, --help Print help -V, --version Print version ``` -------------------------------- ### assert_output() Partial Matching Source: https://github.com/holo-host/edgenode/blob/main/docker/tests/libs/bats-assert/README.md Enables partial matching for assert_output, failing if the expected substring is not found in the output. Mutually exclusive with --regexp. Displays substring and output on failure. ```bash @test 'assert_output() partial matching' { run echo 'ERROR: no such file or directory' assert_output --partial 'SUCCESS' } ``` -------------------------------- ### Asserting Non-Empty Command Output with bats-assert Source: https://github.com/holo-host/edgenode/blob/main/docker/tests/libs/bats-assert/README.md Asserts that the last executed command (`run`) produced any non-empty output. This is useful when you only need to confirm that a command generated some result, without specifying the exact content. ```bash @test 'assert_output()' { run echo 'have' assert_output } ``` -------------------------------- ### assert_output() with Standard Input Source: https://github.com/holo-host/edgenode/blob/main/docker/tests/libs/bats-assert/README.md Specifies expected output for assert_output via standard input using the -/--stdin option, supporting pipes, heredocs, and herestrings. ```bash @test 'assert_output() with pipe' { run echo 'hello' echo 'hello' | assert_output - } @test 'assert_output() with herestring' { run echo 'hello' assert_output - <<< hello } ``` -------------------------------- ### Asserting Command Output (Literal Match) with bats-assert Source: https://github.com/holo-host/edgenode/blob/main/docker/tests/libs/bats-assert/README.md Checks if the output of the last executed command (`run`) literally matches the expected output string. If the outputs differ, the assertion fails and shows both the expected and actual output. Multi-line outputs are formatted. ```bash @test 'assert_output()' { run echo 'have' assert_output 'want' } ```