Skip to main content

ARC 2.0.0-beta.28

Package and instance

Keep the shipped Blocklet package distinct from a particular running or configured instance.

ARC treats a package and an instance as different objects. Confusing them blurs source ownership, configuration, data, and release.

Package versus instance

PackageInstance
What it isVersioned, reusable application artifactOne configured run or deployment of a package
Typical identityid / did / version in blocklet.yamlRuntime binding: port, host, owner, data mounts
MutabilitySource + published tree at a versionConfig and data can change while the package version stays fixed
Local evidenceDirectory with blocklet.yaml (or convention entry), arc blocklet inspectarc blocklet run / arc service start --blocklet serving URLs
Build productdist/ + .afs/manifest.json + blocklet.dist.jsonNot produced by build alone — requires a serve or deploy step
Analogynpm package / container imageRunning container / deployed service

Code-backed anchors (ArcBlock/arc, package types and CLI):

  • Package shape: blocklet.yaml parsed as BlockletManifest (packages/core/src/blocklet/types.ts)
  • Scaffold writes package identity (specVersion, id, name, did, version) via arc blocklet create
  • Local instance serve: arc blocklet run <path> registers the parent directory with the daemon and prints access URLs
  • Build stamps instance requirements into the flat manifest (e.g. instance.required: false for a basic package; minimal-app build reports instance: requires /instance DID Space)

Diagram

StageObjectTypical command
Author sourcePackage source treeeditor + create
Validate / packagePackage contract + dist/check, build, inspect
Local runLocal instanceblocklet run / service start --blocklet
Remote pathRemote instancedeploy --server / Pages — separate, often experimental

Flow from source through package check and build to a local or remote instance

A package is the versioned application unit. An instance is a particular run or deployment of that package.

What belongs where

ConcernLives on the packageLives on the instance
blocklet.yaml identity, scope, mounts, sites, replicated declarationsYesNo (read as declared by the package)
Built file tree under dist/Yes (artifact)Consumed when deployed
Daemon port, extra blocklet dirsNoYes
/instance DID Space data (when required)Seed only (seed/)Runtime data ownership
Domain binding for a public deploymentDeclared candidates (sites.domains)Actual binding for this deployment

Manifest fields that name the split

From the current parser (BlockletManifest):

FieldPackage meaningInstance implication
id, did, version, specVersionPackage identityStable package coordinates for a run
scopeNamespace visibility model (app default, also user / root / agent)Session AFS shape for the run
instance.required / instance.mount / instance.seedDeclares whether a real /instance DID Space is requiredRuntime must fail closed if required and missing
mountsProvider dependencies declared by the packageMounted into the running AFS
sites / surfacesDeclared routing and exposureResolved by the host that serves the instance
replicatedCollection contracts in the packageWrites and copies at instance/user spaces

Minimal package written by arc blocklet create --recipe basic (verified):

yaml
specVersion: 2
id: demo-basic
name: demo-basic
did: did:blocklet:demo-basic
version: 0.1.0
description: ""

After arc blocklet build, the flat manifest for that package included:

json
{
  "specVersion": 2,
  "id": "demo-basic",
  "instance": { "required": false, "mount": "/instance" },
  "scope": "app",
  "mounts": []
}

Local instance without remote deploy

A local instance is enough for acceptance:

bash
arc blocklet run ./demo-min
# or
arc service start --blocklet ./demo-min --port 4939

Verified (2.0.0-beta.28; seed-instance port override, today prefer a named instance):

text
Serving blocklet "demo-min" on port 4941
  http://demo-min.localhost:4941/
  http://localhost:4941/?blocklet=demo-min  (Safari / universal)

GET with Host: demo-min.localhost:4941 returned HTTP 200. No DID Space publish was required.

Rules of reading

  1. Source edits change the package. Rebuild and re-check when you change declared files.
  2. Runtime state belongs to the instance environment (daemon config, ports, DID Space data). Do not treat a successful local serve as proof that a remote instance is healthy.
  3. instance: requires /instance DID Space on a build means stateful features of that package need a real instance space. Local HTTP 200 on a shell page does not prove those writes work — see Publish and deploy and Data and AFS.

Next: Create and run locally.