Package 

Class HolochainServiceAdminClient

    • Constructor Detail

      • HolochainServiceAdminClient

        HolochainServiceAdminClient(Activity activity, ComponentName serviceComponentName)
    • Method Detail

      • connect

         final Unit connect()

        Connects to the Holochain service using the Admin API.

        This must be called before any other methods can be used.

      • setupApp

         final AppAuthFfi setupApp(InstallAppPayloadFfi installAppPayload, Boolean enableAfterInstall)

        Full process to setup a Holochain app.

        This function will:

        • Check if the app is installed

        • If not installed, install it

        • Optionally optionally enable it

        • Ensure there is an app websocket and authentication for it

        If an app is already installed, it will not be enabled automatically. It is only enabled after a successful install. The reasoning is that if an app is disabled after initial installation, it is assumed to have been manually disabled via the admin UI, which we don't want to override.

        Parameters:
        installAppPayload - The payload containing app installation data
        enableAfterInstall - Whether to enable the app after installation
      • connectSetupApp

         final AppAuthFfi connectSetupApp(InstallAppPayloadFfi installAppPayload, Boolean enableAfterInstall)

        Connects to service, waits for connection to be ready, and sets up an app.

        Convenience method that combines connect(), waitForConnectReady(), and setupApp() into a single call.

        Parameters:
        installAppPayload - The payload containing app installation data
        enableAfterInstall - Whether to enable the app after installation
      • stop

         final Unit stop()

        Stops the Holochain service.

        This will shutdown the Holochain conductor and stop the service process.

      • isReady

         final Boolean isReady()

        Checks if the service is ready to receive calls.

      • isAppInstalled

         final Boolean isAppInstalled(String installedAppId)

        Checks if an app with the given app ID is installed.

        Parameters:
        installedAppId - The ID of the app to check
      • uninstallApp

         final Unit uninstallApp(String installedAppId)

        Uninstalls an installed Holochain app.

        Parameters:
        installedAppId - The ID of the app to uninstall
      • enableApp

         final AppInfoFfi enableApp(String installedAppId)

        Enables an installed Holochain app.

        Parameters:
        installedAppId - The ID of the app to enable
      • disableApp

         final Unit disableApp(String installedAppId)

        Disables an installed Holochain app.

        Parameters:
        installedAppId - The ID of the app to disable
      • ensureAppWebsocket

         final AppAuthFfi ensureAppWebsocket(String installedAppId)

        Gets or creates an app websocket with authentication token.

        Parameters:
        installedAppId - The ID of the app to create a websocket for
      • signZomeCall

         final ZomeCallFfi signZomeCall(ZomeCallUnsignedFfi args)

        Signs a zome call with the agent's private key.

        This is required for making authenticated calls to Holochain zome functions.

        Parameters:
        args - The unsigned zome call to sign
      • waitForConnectReady

         final Unit waitForConnectReady(Long timeoutMs)

        Polls until connected to the service, or the timeout has elapsed.

        Parameters:
        timeoutMs - Maximum time to wait for connection in milliseconds (default: 100ms)