Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mistlib-examples

Client wrappers for mistlib (Python / Web / Unity) and usage examples.

The engine itself (the Rust core and its native / WebAssembly builds) lives in a separate repository. This repository contains only the client code and the samples.

日本語版: README.ja.md

Layout

Path Contents
wrappers/python/ Python wrapper (the mist package, calling the native library through ctypes)
wrappers/web/ Web wrapper (an ES module that loads the WebAssembly build)
wrappers/unity/ Unity package (com.tik-choco.mistlib, via P/Invoke)
examples/python/ CLI / GUI clients and a gRPC log collection sample
examples/web/ Browser demos (3D metaverse, media, optimization)

Setup

Every wrapper needs a prebuilt engine binary. Those binaries are not part of this repository — they are published by mistlib:

  • Web — the WebAssembly build is on npm as @tik-choco/mistlib.
  • Python / Unity — the native library ships in each release as mistlib-native-<platform>-<version>.zip.

Drop them at the paths below, or let the helper script do it if you have a checkout of the engine sources:

cp .env.example .env   # configure the source repository and branch
just sync              # or ./scripts/sync-mistlib.sh

The web demos load the engine from a CDN through each page's import map, so they need no local build; point that map at ../../mistlib-wasm/pkg/mistlib_wasm.js to use one. The other wrappers read the artifacts from disk (all untracked).

Destination Referenced by
target/release/libmistlib.so wrappers/python/mist/core.py
mistlib-wasm/pkg/ wrappers/web/index.js
wrappers/unity/MistLib/Runtime/Plugins/ Unity native plugins

See .env.example for the available settings. If MISTLIB_DEV_PATH points at an existing local checkout, the script leaves that checkout untouched — it neither fetches nor checks out. Leave it empty to have the script clone into .mistlib-dev/ and manage it itself.

Commands

We use just. Run just to list the recipes.

Command Description
just sync Build the engine and place the artifacts
just sync-fast Skip the build and only copy existing artifacts
just serve Start an HTTP server for the web samples
just deps Install the Python sample dependencies
just gui / just cli / just bot Run the Python samples
just log-server Start the gRPC log collection server
just proto Regenerate the Python stubs from log.proto
just check Syntax-check the Python and JavaScript sources
just clean Remove the fetched artifacts

Signaling

Signaling is Nostr. Peers find each other only if their inviteSalt and inviteCode both match, so the wrappers ship no defaults for them — pick values unique to your application:

new MistNode(id, { signaling: { mode: "nostr", nostr: {
  inviteSalt: "my-app", inviteCode: "a-shared-secret",
} } });

Relays differ per wrapper: Python and Unity point at a local relay on ws://127.0.0.1:7777, while the web wrapper leaves relays empty and lets the engine fetch a relay list at startup. Set it explicitly to use your own.

License

Apache License 2.0

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages