Contexts & Applications
An application is a WASM bundle on a node; a context is a running instance
of its shared state. This guide walks the lifecycle install → create context →
join, all on mero.admin. Every method is a suspend fun. The full surface is in
the admin API reference.
The lifecycle
Section titled “The lifecycle”Install an application
Section titled “Install an application”From a hosted bundle URL (metadata is a byte list — pass emptyList() if none):
val installed = mero.admin.installApplication( InstallApplicationRequest(url = "https://example.com/app.wasm", metadata = emptyList()))val applicationId = installed.applicationIdFrom a registry package — mero-kotlin resolves the manifest, derives the bundle artifact URL, and installs it:
val versions = mero.admin.getRegistryVersions(registryUrl, packageName = "my-package") // newest first
val app = mero.admin.installFromRegistry( registryUrl, packageName = "my-package", version = versions.first())During development, install from a path with installDevApplication(request).
Inspect and manage:
val apps = mero.admin.listApplications().appsval app = mero.admin.getApplication(applicationId)mero.admin.uninstallApplication(applicationId)Create a context
Section titled “Create a context”val created = mero.admin.createContext( CreateContextRequest(applicationId = applicationId, groupId = groupId))val contextId = created.contextIdval memberKey = created.memberPublicKeyFor a multi-service application, name the service:
val ctx = mero.admin.createContext( CreateContextRequest(applicationId = applicationId, groupId = groupId, serviceName = "chat"))List and inspect:
val contexts = mero.admin.getContexts().contexts // List<ContextWithGroup>val one = mero.admin.getContext(contextId) // Contextval forApp = mero.admin.getContextsForApplication(applicationId)val storage = mero.admin.getContextStorage(contextId).sizeInBytesIdentities & joining
Section titled “Identities & joining”A context identity is your keypair within a context. Generate one, then join:
val identity = mero.admin.generateContextIdentity() // .publicKeymero.admin.joinContext(contextId)
val all = mero.admin.getContextIdentities(contextId).identitiesval mine = mero.admin.getContextIdentitiesOwned(contextId).identitiesKeeping state in sync
Section titled “Keeping state in sync”mero.admin.syncContext(contextId) // request a syncval r = mero.admin.resyncContext(contextId, ResyncContextRequest(force = true))- Executing methods — run WASM methods in a context.
- Groups & governance — namespaces, members, capabilities.