Repository navigation
remotable
A Remotable object is passable by reference across vats. When
another vat receives a Remotable via marshaling, it gets a remote
presence (a proxy) that forwards method calls via E().
import { Far } from '@endo/far';
const obj = Far('MyInterface', {
method: (arg) => { /* ... */ },
});import { makeExo } from '@endo/exo';
const obj = makeExo('MyInterface', M.interface('MyInterface', { ... }), {
method: (arg) => { /* ... */ },
});const obj = zone.exo('MyInterface', M.interface('MyInterface', { ... }), {
method: (arg) => { /* ... */ },
});zone.exo() is the preferred API going forward — it integrates with
durable object lifecycle (vintage upgrade, persistence). makeExo()
adds an interfaceGuard for runtime type checking of method
arguments. Far() is the simplest but least featured; suitable for
prototyping.
-
All property values must be functions. Accessors (
get/set) are not allowed. Data properties throw. -
The methods object must NOT already be hardened.
Far()/makeExo()/zone.exo()harden it before returning. -
interfaceNameis for debugging — shows up inconsole.log. It is NOT a type check (unless paired with a guard inmakeExo).
Without Far(), a hardened object is passable by copy — it gets
serialized and deserialized into a new object in the receiving vat.
With Remotable, the object is passable by reference — the receiving
vat gets a proxy that forwards messages back. This enables
distributed ocap: capabilities are not copied, they are shared.
If an object is NOT a Remotable but is accidentally passed across a vat boundary, marshaling throws an error. This prevents accidental exposure of local-only objects.
Navigation
- Home
- Governance
- Endo / object capabilities
- Retrospectives and source material