Skip to content

HelloVolla/VollaCloudExample

Repository files navigation

VollaCloudExample

An Android example application demonstrating how to integrate Holochain into a native kotlin application. The app connects to the Volla Cloud Service, installs a hApp bundle, and sends greeting messages to a Holochain DNA via zome calls.

Architecture

The project is a hybrid Kotlin/Rust codebase with three main layers:

┌─────────────────────────────────┐
│           app (Kotlin)          │  Android UI with Jetpack Compose
├─────────────────────────────────┤
│      libraries/client (Kotlin)  │  Client library wrapping the FFI bridge
├─────────────────────────────────┤
│   crates/client-ffi (Rust)      │  UniFFI-generated FFI bindings to Holochain
├─────────────────────────────────┤
│   crates/dnas/example (Rust)    │  Holochain DNA (integrity + coordinator zomes)
└─────────────────────────────────┘

Components

app/ — Android Application

The main Android app module. A Jetpack Compose UI that connects to the Volla Cloud Service, lets the user type a greeting message, and sends it as a zome call to the Holochain conductor.

libraries/client/ — Kotlin Client Library

An Android library providing a high-level API for communicating with the Holochain conductor. It handles connecting to the Volla Cloud Service, installing the hApp bundle, managing the agent's ed25519 signing key (persisted in SharedPreferences), and exposing the FFI-bridged ExampleClient to the app layer.

crates/client-ffi/ — Rust FFI Bridge

A Rust library compiled as a native shared library and exposed to Kotlin via UniFFI. It wraps the Holochain WebSocket client, handles zome call nonce generation and ed25519 signing, and provides FFI-compatible type definitions (CellIdFfi, ZomeCallParamsFfi, AppInfoFfi, etc.) with bidirectional conversions to/from Holochain's internal types.

crates/uniffi-bindgen-cli/ — UniFFI Bindgen CLI

A small Rust binary wrapping the UniFFI CLI tool, used to generate Kotlin bindings from the Rust proc-macro definitions.

crates/dnas/example/ — Holochain DNA

The example Holochain DNA with two zomes:

  • Integrity zome — Defines the Greeting entry type and AgentToGreeting link type. Validates that greeting messages are non-empty.
  • Coordinator zome — Provides zome functions to create greetings on the DHT, retrieve them by action hash, and list all greetings linked to an agent.

workdir/ — hApp Bundle

Contains the hApp manifest (happ.yaml) and pre-built example.happ bundle that the Android app loads from assets.

Root Configuration

  • Cargo.toml — Rust workspace with shared dependencies (Holochain SDK, UniFFI, ed25519-dalek, etc.).
  • build.gradle.kts / settings.gradle.kts — Gradle multi-project build with :app and libraries:client modules.
  • flake.nix — Nix dev shell with Holochain tooling (holochain, hc, lair-keystore, etc.).
  • package.json — npm scripts for building zomes, packaging the hApp, and launching a local dev network.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages