API documentation of Agoric SDK / Exports / @agoric/swingset-vat
Module: @agoric/swingset-vat
Table of contents
Namespaces
Interfaces
Type Aliases
- Bundle
- BundleCap
- BundleFormat
- BundleID
- BundleName
- BundleRef
- BundleSpec
- DeviceInvocation
- DeviceInvocationResult
- DeviceInvocationResultError
- DeviceInvocationResultOk
- DynamicVatOptions
- EndoZipBase64Bundle
- GetExportBundle
- KVStore
- KernelDeliveryBringOutYourDead
- KernelDeliveryChangeVatOptions
- KernelDeliveryDropExports
- KernelDeliveryMessage
- KernelDeliveryNotify
- KernelDeliveryObject
- KernelDeliveryOneNotify
- KernelDeliveryRetireExports
- KernelDeliveryRetireImports
- KernelDeliveryStartVat
- KernelDeliveryStopVat
- KernelKeeper
- KernelOneResolution
- KernelOptions
- KernelSlog
- KernelSyscallAbandonExports
- KernelSyscallCallKernelHook
- KernelSyscallDropImports
- KernelSyscallExit
- KernelSyscallInvoke
- KernelSyscallObject
- KernelSyscallResolve
- KernelSyscallResult
- KernelSyscallResultError
- KernelSyscallResultOk
- KernelSyscallRetireExports
- KernelSyscallRetireImports
- KernelSyscallSend
- KernelSyscallSubscribe
- KernelSyscallVatstoreDelete
- KernelSyscallVatstoreGet
- KernelSyscallVatstoreGetNextKey
- KernelSyscallVatstoreSet
- ManagerType
- Message
- Meter
- MeteringVatPowers
- NestedEvaluateBundle
- OptEnableDisavow
- OptManagerType
- OptMeter
- OptNodeOptions
- PolicyInput
- PolicyInputCrankComplete
- PolicyInputCrankFailed
- PolicyInputCreateVat
- PolicyInputDetails
- PolicyInputNone
- PolicyOutput
- ResolutionPolicy
- RunPolicy
- ShutdownWithFailure
- SlogFinishDelivery
- SlogFinishSyscall
- SnapStore
- SnapshotResult
- SourceOfBundle
- SourceSpec
- StaticVatOptions
- StaticVatPowers
- SwingSetCapData
- SwingSetConfig
- SwingSetConfigDescriptor
- SwingSetConfigProperties
- SwingSetKernelConfig
- SwingStore
- SwingStoreHostStorage
- SwingStoreKernelStorage
- TerminationVatPowers
- TranscriptStore
- VatDeliveryObject
- VatDeliveryResult
- VatKeeper
- VatPowers
- VatSlog
- VatStats
- VatSyscallObject
- VatSyscallResult
- VatUpgradeOptions
- VatUpgradeResults
- WaitUntilQuiescent
- XSnap
Functions
- buildBridge
- buildCommand
- buildKernelBundles
- buildMailbox
- buildMailboxStateMap
- buildPlugin
- buildTimer
- buildVatController
- initializeSwingset
- loadBasedir
- loadSwingsetConfigFile
- makeSwingsetController
- swingsetIsInitialized
Type Aliases
Bundle
Ƭ Bundle: EndoZipBase64Bundle
| GetExportBundle
| NestedEvaluateBundle
Defined in
packages/SwingSet/src/types-external.js:20
BundleCap
Ƭ BundleCap: any
Defined in
packages/SwingSet/src/types-external.js:238
BundleFormat
Ƭ BundleFormat: "getExport"
| "nestedEvaluate"
| "endoZipBase64"
Defined in
packages/SwingSet/src/types-external.js:10
BundleID
Ƭ BundleID: string
Defined in
packages/SwingSet/src/types-external.js:237
BundleName
Ƭ BundleName: Object
Type declaration
Name | Type |
---|---|
bundleName | string |
Defined in
packages/SwingSet/src/types-external.js:163
BundleRef
Ƭ BundleRef: Object
Type declaration
Name | Type |
---|---|
bundle | Bundle |
Defined in
packages/SwingSet/src/types-external.js:160
BundleSpec
Ƭ BundleSpec: Object
Type declaration
Name | Type |
---|---|
bundleSpec | string |
Defined in
packages/SwingSet/src/types-external.js:157
DeviceInvocation
Ƭ DeviceInvocation: [string
, string
, SwingSetCapData
]
Defined in
packages/SwingSet/src/types-external.js:111
DeviceInvocationResult
Ƭ DeviceInvocationResult: DeviceInvocationResultOk
| DeviceInvocationResultError
Defined in
packages/SwingSet/src/types-external.js:118
DeviceInvocationResultError
Ƭ DeviceInvocationResultError: [tag: "error", problem: string]
Defined in
packages/SwingSet/src/types-external.js:117
DeviceInvocationResultOk
Ƭ DeviceInvocationResultOk: [tag: "ok", data: SwingSetCapData]
Defined in
packages/SwingSet/src/types-external.js:116
DynamicVatOptions
Ƭ DynamicVatOptions: BaseVatOptions
& OptMeter
& OptManagerType
config.vats[name].creationOptions: StaticVatOptions
Defined in
packages/SwingSet/src/types-external.js:312
EndoZipBase64Bundle
Ƭ EndoZipBase64Bundle: Object
Type declaration
Name | Type |
---|---|
endoZipBase64 | string |
endoZipBase64Sha512 | string |
moduleFormat | "endoZipBase64" |
Defined in
packages/SwingSet/src/types-external.js:239
GetExportBundle
Ƭ GetExportBundle: Object
Type declaration
Name | Type |
---|---|
moduleFormat | "getExport" |
source | string |
sourceMap? | string |
Defined in
packages/SwingSet/src/types-external.js:18
KVStore
Ƭ KVStore: KVStore
Defined in
packages/SwingSet/src/types-external.js:206
KernelDeliveryBringOutYourDead
Ƭ KernelDeliveryBringOutYourDead: [tag: "bringOutYourDead"]
Defined in
packages/SwingSet/src/types-external.js:80
KernelDeliveryChangeVatOptions
Ƭ KernelDeliveryChangeVatOptions: [tag: "changeVatOptions", options: Record<string, unknown>]
Defined in
packages/SwingSet/src/types-external.js:77
KernelDeliveryDropExports
Ƭ KernelDeliveryDropExports: [tag: "dropExports", krefs: string[]]
Defined in
packages/SwingSet/src/types-external.js:74
KernelDeliveryMessage
Ƭ KernelDeliveryMessage: [tag: "message", target: string, msg: Message]
Defined in
packages/SwingSet/src/types-external.js:71
KernelDeliveryNotify
Ƭ KernelDeliveryNotify: [tag: "notify", resolutions: KernelDeliveryOneNotify[]]
Defined in
packages/SwingSet/src/types-external.js:73
KernelDeliveryObject
Ƭ KernelDeliveryObject: KernelDeliveryMessage
| KernelDeliveryNotify
| KernelDeliveryDropExports
| KernelDeliveryRetireExports
| KernelDeliveryRetireImports
| KernelDeliveryChangeVatOptions
| KernelDeliveryStartVat
| KernelDeliveryStopVat
| KernelDeliveryBringOutYourDead
Defined in
packages/SwingSet/src/types-external.js:84
KernelDeliveryOneNotify
Ƭ KernelDeliveryOneNotify: [kpid: string, kp: Object]
Defined in
packages/SwingSet/src/types-external.js:72
KernelDeliveryRetireExports
Ƭ KernelDeliveryRetireExports: [tag: "retireExports", krefs: string[]]
Defined in
packages/SwingSet/src/types-external.js:75
KernelDeliveryRetireImports
Ƭ KernelDeliveryRetireImports: [tag: "retireImports", krefs: string[]]
Defined in
packages/SwingSet/src/types-external.js:76
KernelDeliveryStartVat
Ƭ KernelDeliveryStartVat: [tag: "startVat", vatParameters: SwingSetCapData]
Defined in
packages/SwingSet/src/types-external.js:78
KernelDeliveryStopVat
Ƭ KernelDeliveryStopVat: [tag: "stopVat", disconnectObject: SwingSetCapData]
Defined in
packages/SwingSet/src/types-external.js:79
KernelKeeper
Ƭ KernelKeeper: ReturnType
<default
>
Defined in
packages/SwingSet/src/types-external.js:122
KernelOneResolution
Ƭ KernelOneResolution: [kpid: string, rejected: boolean, data: SwingSetCapData]
Defined in
packages/SwingSet/src/types-external.js:88
KernelOptions
Ƭ KernelOptions: Object
Type declaration
Name | Type |
---|---|
defaultManagerType? | ManagerType |
defaultReapInterval? | number | "never" |
pinBootstrapRoot? | boolean |
relaxDurabilityRules? | boolean |
snapshotInitial? | number |
snapshotInterval? | number |
Defined in
packages/SwingSet/src/types-external.js:33
KernelSlog
Ƭ KernelSlog: Object
Type declaration
Name | Type |
---|---|
delivery | (vatID : string , newCrankNum : BigInt , newDeliveryNum : BigInt , kd : KernelDeliveryObject , vd : VatDeliveryObject , replay? : boolean ) => SlogFinishDelivery |
provideVatSlogger | (vatID : string , dynamic? : boolean , description? : string , name? : string , vatSourceBundle? : unknown , managerType? : string , vatParameters? : unknown ) => { vatSlog : VatSlog } |
syscall | (vatID : string , ksc : KernelSyscallObject | undefined , vsc : VatSyscallObject ) => SlogFinishSyscall |
terminateVat | (vatID : string , shouldReject : boolean , info : SwingSetCapData ) => void |
vatConsole | (vatID : string , origConsole : {}) => {} |
write | ({} : any ) => void |
Defined in
packages/SwingSet/src/types-external.js:143
KernelSyscallAbandonExports
Ƭ KernelSyscallAbandonExports: [tag: "abandonExports", vatID: string, krefs: string[]]
Defined in
packages/SwingSet/src/types-external.js:98
KernelSyscallCallKernelHook
Ƭ KernelSyscallCallKernelHook: [tag: "callKernelHook", hookName: string, args: SwingSetCapData]
Defined in
packages/SwingSet/src/types-external.js:99
KernelSyscallDropImports
Ƭ KernelSyscallDropImports: [tag: "dropImports", krefs: string[]]
Defined in
packages/SwingSet/src/types-external.js:95
KernelSyscallExit
Ƭ KernelSyscallExit: [tag: "exit", vatID: string, isFailure: boolean, info: SwingSetCapData]
Defined in
packages/SwingSet/src/types-external.js:90
KernelSyscallInvoke
Ƭ KernelSyscallInvoke: [tag: "invoke", target: string, method: string, args: SwingSetCapData]
Defined in
packages/SwingSet/src/types-external.js:86
KernelSyscallObject
Ƭ KernelSyscallObject: KernelSyscallSend
| KernelSyscallInvoke
| KernelSyscallSubscribe
| KernelSyscallResolve
| KernelSyscallExit
| KernelSyscallVatstoreGet
| KernelSyscallVatstoreGetNextKey
| KernelSyscallVatstoreSet
| KernelSyscallVatstoreDelete
| KernelSyscallDropImports
| KernelSyscallRetireImports
| KernelSyscallRetireExports
| KernelSyscallAbandonExports
| KernelSyscallCallKernelHook
Defined in
packages/SwingSet/src/types-external.js:106
KernelSyscallResolve
Ƭ KernelSyscallResolve: [tag: "resolve", vatID: string, resolutions: KernelOneResolution[]]
Defined in
packages/SwingSet/src/types-external.js:89
KernelSyscallResult
Ƭ KernelSyscallResult: KernelSyscallResultOk
| KernelSyscallResultError
Defined in
packages/SwingSet/src/types-external.js:109
KernelSyscallResultError
Ƭ KernelSyscallResultError: [tag: "error", err: string]
Defined in
packages/SwingSet/src/types-external.js:108
KernelSyscallResultOk
Ƭ KernelSyscallResultOk: [tag: "ok", data: SwingSetCapData | string | string[] | undefined[] | null]
Defined in
packages/SwingSet/src/types-external.js:107
KernelSyscallRetireExports
Ƭ KernelSyscallRetireExports: [tag: "retireExports", krefs: string[]]
Defined in
packages/SwingSet/src/types-external.js:97
KernelSyscallRetireImports
Ƭ KernelSyscallRetireImports: [tag: "retireImports", krefs: string[]]
Defined in
packages/SwingSet/src/types-external.js:96
KernelSyscallSend
Ƭ KernelSyscallSend: [tag: "send", target: string, msg: Message]
Defined in
packages/SwingSet/src/types-external.js:85
KernelSyscallSubscribe
Ƭ KernelSyscallSubscribe: [tag: "subscribe", vatID: string, kpid: string]
Defined in
packages/SwingSet/src/types-external.js:87
KernelSyscallVatstoreDelete
Ƭ KernelSyscallVatstoreDelete: [tag: "vatstoreDelete", vatID: string, key: string]
Defined in
packages/SwingSet/src/types-external.js:94
KernelSyscallVatstoreGet
Ƭ KernelSyscallVatstoreGet: [tag: "vatstoreGet", vatID: string, key: string]
Defined in
packages/SwingSet/src/types-external.js:91
KernelSyscallVatstoreGetNextKey
Ƭ KernelSyscallVatstoreGetNextKey: [tag: "vatstoreGetNextKey", vatID: string, priorKey: string]
Defined in
packages/SwingSet/src/types-external.js:92
KernelSyscallVatstoreSet
Ƭ KernelSyscallVatstoreSet: [tag: "vatstoreSet", vatID: string, key: string, data: string]
Defined in
packages/SwingSet/src/types-external.js:93
ManagerType
Ƭ ManagerType: "local"
| "node-subprocess"
| "xsnap"
| "xs-worker"
Defined in
packages/SwingSet/src/types-external.js:22
Message
Ƭ Message: Object
Type declaration
Name | Type |
---|---|
methargs | SwingSetCapData |
result | string | undefined | null |
Defined in
packages/swingset-liveslots/src/types.js:36
Meter
Ƭ Meter: unknown
E(vatAdminService).createVat(bundle, options: DynamicVatOptions)
Defined in
packages/SwingSet/src/types-external.js:241
MeteringVatPowers
Ƭ MeteringVatPowers: Object
Type declaration
Name | Type |
---|---|
makeGetMeter | unknown |
transformMetering | unknown |
Defined in
packages/SwingSet/src/types-external.js:46
NestedEvaluateBundle
Ƭ NestedEvaluateBundle: Object
Type declaration
Name | Type |
---|---|
moduleFormat | "nestedEvaluate" |
source | string |
sourceMap? | string |
Defined in
packages/SwingSet/src/types-external.js:19
OptEnableDisavow
Ƭ OptEnableDisavow: Object
Type declaration
Name | Type |
---|---|
enableDisavow? | boolean |
Defined in
packages/SwingSet/src/types-external.js:316
OptManagerType
Ƭ OptManagerType: Object
Type declaration
Name | Type |
---|---|
managerType? | ManagerType |
Defined in
packages/SwingSet/src/types-external.js:311
OptMeter
Ƭ OptMeter: Object
If a meter is provided, the new dynamic vat is limited to a fixed amount of computation and allocation that can occur during any given crank. Peak stack frames are limited as well. In addition, the given meter's "remaining" value will be reduced by the amount of computation used by each crank. The meter will eventually underflow unless it is topped up, at which point the vat is terminated. If undefined, the vat is unmetered. Static vats cannot be metered.
Type declaration
Name | Type |
---|---|
meter? | Meter |
Defined in
packages/SwingSet/src/types-external.js:301
OptNodeOptions
Ƭ OptNodeOptions: Object
Type declaration
Name | Type |
---|---|
nodeOptions? | string [] |
Defined in
packages/SwingSet/src/types-external.js:317
PolicyInput
Ƭ PolicyInput: PolicyInputNone
| PolicyInputCreateVat
| PolicyInputCrankComplete
| PolicyInputCrankFailed
Defined in
packages/SwingSet/src/types-external.js:221
PolicyInputCrankComplete
Ƭ PolicyInputCrankComplete: [tag: "crank", details: PolicyInputDetails]
Defined in
packages/SwingSet/src/types-external.js:219
PolicyInputCrankFailed
Ƭ PolicyInputCrankFailed: [tag: "crank-failed", details: PolicyInputDetails]
Defined in
packages/SwingSet/src/types-external.js:220
PolicyInputCreateVat
Ƭ PolicyInputCreateVat: [tag: "create-vat", details: PolicyInputDetails]
Defined in
packages/SwingSet/src/types-external.js:218
PolicyInputDetails
Ƭ PolicyInputDetails: Object
Type declaration
Name | Type |
---|---|
computrons? | bigint |
Defined in
packages/SwingSet/src/types-external.js:216
PolicyInputNone
Ƭ PolicyInputNone: [tag: "none", details: PolicyInputDetails]
Defined in
packages/SwingSet/src/types-external.js:217
PolicyOutput
Ƭ PolicyOutput: boolean
Defined in
packages/SwingSet/src/types-external.js:222
ResolutionPolicy
Ƭ ResolutionPolicy: "none"
| "ignore"
| "logAlways"
| "logFailure"
| "panic"
Defined in
packages/SwingSet/src/types-external.js:64
RunPolicy
Ƭ RunPolicy: Object
Type declaration
Name | Type |
---|---|
crankComplete | (details : { computrons? : bigint }) => PolicyOutput |
crankFailed | (details : {}) => PolicyOutput |
emptyCrank | () => PolicyOutput |
vatCreated | (details : {}) => PolicyOutput |
Defined in
packages/SwingSet/src/types-external.js:227
ShutdownWithFailure
Ƭ ShutdownWithFailure: (reason
: Error
) => void
Called to shut something down because something went wrong, where the reason is supposed to be an Error that describes what went wrong. Some valid implementations of ShutdownWithFailure
will never return, either because they throw or because they immediately shutdown the enclosing unit of computation. However, they also might return, so the caller should follow this call by their own defensive throw reason;
if appropriate.
Type declaration
▸ (reason
): void
Parameters
Name | Type |
---|---|
reason | Error |
Returns
void
Defined in
packages/SwingSet/src/types-external.js:323
SlogFinishDelivery
Ƭ SlogFinishDelivery: (dr
: VatDeliveryResult
) => void
Type declaration
▸ (dr
): void
Parameters
Name | Type |
---|---|
dr | VatDeliveryResult |
Returns
void
Defined in
packages/SwingSet/src/types-external.js:124
SlogFinishSyscall
Ƭ SlogFinishSyscall: (ksr
: KernelSyscallResult
, vsr
: VatSyscallResult
) => void
Type declaration
▸ (ksr
, vsr
): void
Parameters
Name | Type |
---|---|
ksr | KernelSyscallResult |
vsr | VatSyscallResult |
Returns
void
Defined in
packages/SwingSet/src/types-external.js:125
SnapStore
Ƭ SnapStore: SnapStore
Defined in
packages/SwingSet/src/types-external.js:207
SnapshotResult
Ƭ SnapshotResult: SnapshotResult
Defined in
packages/SwingSet/src/types-external.js:208
SourceOfBundle
Ƭ SourceOfBundle: { bundleName
: string
} | { bundle
: Bundle
} | { bundleID
: BundleID
}
Defined in
packages/SwingSet/src/types-external.js:203
SourceSpec
Ƭ SourceSpec: Object
Type declaration
Name | Type |
---|---|
sourceSpec | string |
Defined in
packages/SwingSet/src/types-external.js:154
StaticVatOptions
Ƭ StaticVatOptions: BaseVatOptions
& OptManagerType
& OptEnableDisavow
& OptNodeOptions
Defined in
packages/SwingSet/src/types-external.js:318
StaticVatPowers
Ƭ StaticVatPowers: VatPowers
& MeteringVatPowers
Defined in
packages/SwingSet/src/types-external.js:41
SwingSetCapData
Ƭ SwingSetCapData: CapData
Defined in
packages/SwingSet/src/types-external.js:14
SwingSetConfig
Ƭ SwingSetConfig: KernelOptions
& SwingSetOptions
a swingset config object
Defined in
packages/SwingSet/src/types-external.js:192
SwingSetConfigDescriptor
Ƭ SwingSetConfigDescriptor: Record
<string
, SwingSetConfigProperties
>
Where the property name is the name of the vat. Note that the bootstrap
property names the vat that should be used as the bootstrap vat. Although a swingset configuration can designate any vat as its bootstrap vat, loadBasedir
will always look for a file named 'bootstrap.js' and use that (note that if there is no 'bootstrap.js', there will be no bootstrap vat).
Defined in
packages/SwingSet/src/types-external.js:171
SwingSetConfigProperties
Ƭ SwingSetConfigProperties: SourceSpec
| BundleSpec
| BundleRef
| BundleName
& { creationOptions?
: Record
<string
, any
> ; parameters?
: Record
<string
, any
> }
Defined in
packages/SwingSet/src/types-external.js:167
SwingSetKernelConfig
Ƭ SwingSetKernelConfig: SwingSetConfig
& { idToBundle
: Record
<BundleID
, Bundle
> ; namedBundleIDs
: Record
<string
, BundleID
> }
the config object passed to initializeKernel
Defined in
packages/SwingSet/src/types-external.js:199
SwingStore
Ƭ SwingStore: SwingStore
Defined in
packages/SwingSet/src/types-external.js:210
SwingStoreHostStorage
Ƭ SwingStoreHostStorage: SwingStoreHostStorage
Defined in
packages/SwingSet/src/types-external.js:212
SwingStoreKernelStorage
Ƭ SwingStoreKernelStorage: SwingStoreKernelStorage
Defined in
packages/SwingSet/src/types-external.js:211
TerminationVatPowers
Ƭ TerminationVatPowers: Object
Type declaration
Name | Type |
---|---|
exitVat | (unknown : any ) => void |
exitVatWithFailure | (reason : Error ) => void |
Defined in
packages/SwingSet/src/types-external.js:51
TranscriptStore
Ƭ TranscriptStore: TranscriptStore
Defined in
packages/SwingSet/src/types-external.js:209
VatDeliveryObject
Ƭ VatDeliveryObject: VatDeliveryMessage
| VatDeliveryNotify
| VatDeliveryDropExports
| VatDeliveryRetireExports
| VatDeliveryRetireImports
| VatDeliveryChangeVatOptions
| VatDeliveryStartVat
| VatDeliveryStopVat
| VatDeliveryBringOutYourDead
Defined in
packages/swingset-liveslots/src/types.js:50
VatDeliveryResult
Ƭ VatDeliveryResult: [tag: "ok", results: any, usage: MeterConsumption | null] | [tag: "error", message: string, usage: MeterConsumption | null]
Defined in
packages/swingset-liveslots/src/types.js:54
VatKeeper
Ƭ VatKeeper: ReturnType
<makeVatKeeper
>
Defined in
packages/SwingSet/src/types-external.js:121
VatPowers
Ƭ VatPowers: TerminationVatPowers
Defined in
packages/SwingSet/src/types-external.js:39
VatSlog
Ƭ VatSlog: Object
Type declaration
Name | Type |
---|---|
delivery | (crankNum : bigint , deliveryNum : bigint , kd : KernelDeliveryObject , vd : VatDeliveryObject ) => SlogFinishDelivery |
Defined in
packages/SwingSet/src/types-external.js:146
VatStats
Ƭ VatStats: Object
Type declaration
Name | Type |
---|---|
transcriptCount | number |
Defined in
packages/SwingSet/src/types-external.js:120
VatSyscallObject
Ƭ VatSyscallObject: VatSyscallSend
| VatSyscallCallNow
| VatSyscallSubscribe
| VatSyscallResolve
| VatSyscallExit
| VatSyscallVatstoreGet
| VatSyscallVatstoreGetNextKey
| VatSyscallVatstoreSet
| VatSyscallVatstoreDelete
| VatSyscallDropImports
| VatSyscallRetireImports
| VatSyscallRetireExports
| VatSyscallAbandonExports
Defined in
packages/swingset-liveslots/src/types.js:75
VatSyscallResult
Ƭ VatSyscallResult: VatSyscallResultOk
| VatSyscallResultError
Defined in
packages/swingset-liveslots/src/types.js:79
VatUpgradeOptions
Ƭ VatUpgradeOptions: Object
Type declaration
Name | Type |
---|---|
upgradeMessage? | string |
vatParameters? | object |
Defined in
packages/SwingSet/src/types-external.js:320
VatUpgradeResults
Ƭ VatUpgradeResults: Object
Type declaration
Name | Type |
---|---|
incarnationNumber | number |
Defined in
packages/SwingSet/src/types-external.js:321
WaitUntilQuiescent
Ƭ WaitUntilQuiescent: () => Promise
<void
>
Type declaration
▸ (): Promise
<void
>
Returns
Promise
<void
>
Defined in
packages/SwingSet/src/types-external.js:148
XSnap
Ƭ XSnap: Awaited
<ReturnType
<xsnap
>>
Defined in
packages/SwingSet/src/types-external.js:123
Functions
buildBridge
▸ buildBridge(outboundCallback
): Object
Parameters
Name | Type |
---|---|
outboundCallback | any |
Returns
Object
Name | Type |
---|---|
deliverInbound | (...args : any []) => void |
endowments | { callOutbound : (...args : any []) => any ; registerInboundCallback : (inbound : any ) => void } |
endowments.callOutbound | (...args : any []) => any |
endowments.registerInboundCallback | (inbound : any ) => void |
srcPath | string |
Defined in
packages/SwingSet/src/devices/bridge/bridge.js:97
buildCommand
▸ buildCommand(broadcastCallback
): Object
Parameters
Name | Type |
---|---|
broadcastCallback | any |
Returns
Object
Name | Type |
---|---|
endowments | { deliverResponse : (kCount : any , kIsReject : any , kResponseString : any ) => void ; registerInboundCallback : (cb : any ) => void ; sendBroadcast : (kBodyString : any ) => void } |
endowments.deliverResponse | (kCount : any , kIsReject : any , kResponseString : any ) => void |
endowments.registerInboundCallback | (cb : any ) => void |
endowments.sendBroadcast | (kBodyString : any ) => void |
inboundCommand | (obj : any ) => Promise <any > |
srcPath | string |
Defined in
packages/SwingSet/src/devices/command/command.js:6
buildKernelBundles
▸ buildKernelBundles(): Promise
<{ kernel
: any
= kernelBundle }>
Returns
Promise
<{ kernel
: any
= kernelBundle }>
Defined in
packages/SwingSet/src/controller/initializeSwingset.js:81
buildMailbox
▸ buildMailbox(state
): Object
Parameters
Name | Type |
---|---|
state | any |
Returns
Object
Name | Type |
---|---|
deliverInbound | (peer : any , messages : any , ack : any ) => boolean |
endowments | { add : (peer : any , msgnum : any , body : any ) => void ; registerInboundCallback : (cb : any ) => void ; remove : (peer : any , msgnum : any ) => void ; setAcknum : (peer : any , msgnum : any ) => void } |
endowments.add | (peer : any , msgnum : any , body : any ) => void |
endowments.registerInboundCallback | (cb : any ) => void |
endowments.remove | (peer : any , msgnum : any ) => void |
endowments.setAcknum | (peer : any , msgnum : any ) => void |
srcPath | string |
Defined in
packages/SwingSet/src/devices/mailbox/mailbox.js:158
buildMailboxStateMap
▸ buildMailboxStateMap(state?
): Object
Parameters
Name | Type |
---|---|
state | Map <any , any > |
Returns
Object
Name | Type |
---|---|
add | (peer : any , msgnum : any , body : any ) => void |
exportToData | () => {} |
populateFromData | (data : any ) => void |
remove | (peer : any , msgnum : any ) => void |
setAcknum | (peer : any , msgnum : any ) => void |
Defined in
packages/SwingSet/src/devices/mailbox/mailbox.js:97
buildPlugin
▸ buildPlugin(pluginDir
, importPlugin
, queueThunkForKernel
): Object
Parameters
Name | Type |
---|---|
pluginDir | any |
importPlugin | any |
queueThunkForKernel | any |
Returns
Object
Name | Type |
---|---|
endowments | { getPluginDir : () => any ; import : any = importPlugin; queueThunkForKernel : any ; registerResetter : (init : any ) => void } |
endowments.getPluginDir | () => any |
endowments.import | any |
endowments.queueThunkForKernel | any |
endowments.registerResetter | (init : any ) => void |
reset | () => void |
srcPath | string |
Defined in
packages/SwingSet/src/devices/plugin/plugin.js:1
buildTimer
▸ buildTimer(): Object
Endowments for a Timer device that can be made available to SwingSet vats.
This is code that runs in the outer half of the device, which is in the primal realm. We provide a poll() function, which calls a device-level function that will be provided later when the device root node is created.
The host loop should call poll on a regular basis, and then call controller.run() when it returns true.
Returns
Object
Name | Type |
---|---|
endowments | { registerDevicePollFunction : (pollFn : any ) => void } |
endowments.registerDevicePollFunction | (pollFn : any ) => void |
poll | (time : number | bigint ) => boolean |
srcPath | string |
Defined in
packages/SwingSet/src/devices/timer/timer.js:15
buildVatController
▸ buildVatController(config
, argv?
, runtimeOptions?
, deviceEndowments?
): Promise
<{ bootstrapResult
: undefined
| string
; debug
: { addDeviceHook
: (deviceName
: any
, hookName
: any
, hook
: any
) => void
= kernel.addDeviceHook } ; shutdown
: () => Promise
<void
> ; validateAndInstallBundle
: (bundle
: EndoZipBase64Bundle
, allegedBundleID?
: string
) => Promise
<string
> ; writeSlogObject
: (obj
: any
) => void
; changeKernelOptions
: (options
: any
) => void
; deviceNameToID
: (deviceName
: any
) => undefined
| string
; dump
: () => { acceptanceQueue
: any
[] ; gcActions
: any
[] ; kernelTable
: any
[] ; log
: string
[] = ephemeral.log; objects
: any
[][] ; promises
: { id
: string
= kpid; state
: string
}[] ; reapQueue
: any
; runQueue
: any
[] ; vatTables
: { state
: { transcript
: [number
, TranscriptEntry
][] } ; vatID
: string
}[] } ; getActivityhash
: () => string
; getStats
: () => {} ; getStatus
: () => { activeVats
: { id
: string
; options
: RecordedVatOptions
}[] } ; kpResolution
: (kpid
: any
, options
: any
) => any
; kpStatus
: (kpid
: any
) => string
; log
: (str
: any
) => void
; pinVatRoot
: (vatName
: any
) => string
; queueToVatObject
: (target
: any
, method
: string
| symbol
, args
: unknown
[], resultPolicy
: ResolutionPolicy
) => undefined
| string
; queueToVatRoot
: (vatName
: string
, method
: string
| symbol
, args
: unknown
[], resultPolicy
: ResolutionPolicy
) => undefined
| string
; reapAllVats
: () => void
; run
: (policy?
: RunPolicy
) => Promise
<number
> ; step
: () => Promise
<0
| 1
> ; upgradeStaticVat
: (vatName
: any
, shouldPauseFirst
: any
, bundleID
: any
, options
: {}) => undefined
| string
; vatNameToID
: (vatName
: any
) => string
; verboseDebugMode
: (flag
: any
) => void
}>
NB: To be used only in tests. An app with this may not survive a reboot.
This helper makes Swingset controllers and automatically initializes the SwingSet if it isn't already. It will not work for use cases that need to configure devices.
The official API does these as two separate steps because the two sometimes need to happen at different times. In particular, sometimes you need the host to be able to control whether or not to initialize independent of the SwingSet's history. Also sometimes you want different runtime options for the two stages; this can happen, for example, in some debugging cases.
Parameters
Name | Type | Default value |
---|---|---|
config | SwingSetConfig | undefined |
argv | string [] | [] |
runtimeOptions | Object | {} |
runtimeOptions.debugPrefix? | string | undefined |
runtimeOptions.env? | Record <string , string > | undefined |
runtimeOptions.kernelBundles? | Record <string , Bundle > | undefined |
runtimeOptions.kernelStorage? | SwingStoreKernelStorage | undefined |
runtimeOptions.slogCallbacks? | unknown | undefined |
runtimeOptions.slogSender? | SlogSender | undefined |
runtimeOptions.testTrackDecref? | unknown | undefined |
runtimeOptions.verbose? | boolean | undefined |
runtimeOptions.warehousePolicy? | VatWarehousePolicy | undefined |
deviceEndowments | Record <string , unknown > | {} |
Returns
Promise
<{ bootstrapResult
: undefined
| string
; debug
: { addDeviceHook
: (deviceName
: any
, hookName
: any
, hook
: any
) => void
= kernel.addDeviceHook } ; shutdown
: () => Promise
<void
> ; validateAndInstallBundle
: (bundle
: EndoZipBase64Bundle
, allegedBundleID?
: string
) => Promise
<string
> ; writeSlogObject
: (obj
: any
) => void
; changeKernelOptions
: (options
: any
) => void
; deviceNameToID
: (deviceName
: any
) => undefined
| string
; dump
: () => { acceptanceQueue
: any
[] ; gcActions
: any
[] ; kernelTable
: any
[] ; log
: string
[] = ephemeral.log; objects
: any
[][] ; promises
: { id
: string
= kpid; state
: string
}[] ; reapQueue
: any
; runQueue
: any
[] ; vatTables
: { state
: { transcript
: [number
, TranscriptEntry
][] } ; vatID
: string
}[] } ; getActivityhash
: () => string
; getStats
: () => {} ; getStatus
: () => { activeVats
: { id
: string
; options
: RecordedVatOptions
}[] } ; kpResolution
: (kpid
: any
, options
: any
) => any
; kpStatus
: (kpid
: any
) => string
; log
: (str
: any
) => void
; pinVatRoot
: (vatName
: any
) => string
; queueToVatObject
: (target
: any
, method
: string
| symbol
, args
: unknown
[], resultPolicy
: ResolutionPolicy
) => undefined
| string
; queueToVatRoot
: (vatName
: string
, method
: string
| symbol
, args
: unknown
[], resultPolicy
: ResolutionPolicy
) => undefined
| string
; reapAllVats
: () => void
; run
: (policy?
: RunPolicy
) => Promise
<number
> ; step
: () => Promise
<0
| 1
> ; upgradeStaticVat
: (vatName
: any
, shouldPauseFirst
: any
, bundleID
: any
, options
: {}) => undefined
| string
; vatNameToID
: (vatName
: any
) => string
; verboseDebugMode
: (flag
: any
) => void
}>
Defined in
packages/SwingSet/src/controller/controller.js:480
initializeSwingset
▸ initializeSwingset(config
, bootstrapArgs
, kernelStorage
, initializationOptions?
, runtimeOptions?
): Promise
<undefined
| string
>
Parameters
Name | Type |
---|---|
config | SwingSetConfig |
bootstrapArgs | unknown |
kernelStorage | SwingStoreKernelStorage |
initializationOptions | InitializationOptions |
runtimeOptions | Object |
runtimeOptions.bundleHandler? | BundleHandler |
runtimeOptions.env? | Record <string , undefined | string > |
Returns
Promise
<undefined
| string
>
KPID of the bootstrap message result promise
Defined in
packages/SwingSet/src/controller/initializeSwingset.js:295
loadBasedir
▸ loadBasedir(basedir
, options?
): SwingSetConfig
Scan a directory for files defining the vats to bootstrap for a swingset, and produce a swingset config object for what was found there. Looks for files with names of the pattern vat-NAME.js
as well as a file named 'bootstrap.js'.
Parameters
Name | Type | Description |
---|---|---|
basedir | string | The directory to scan |
options? | Object | - |
options.bundleFormat | undefined | BundleFormat | the bundle format to use |
options.includeDevDependencies | undefined | boolean | whether to include devDependencies |
Returns
a swingset config object: { bootstrap: "bootstrap", vats: { NAME: { sourceSpec: PATHSTRING } } }
Where NAME is the name of the vat; sourceSpec
contains the path to the vat with that name. Note that the bootstrap
property names the vat that should be used as the bootstrap vat. Although a swingset configuration can designate any vat as its bootstrap vat, loadBasedir
will always look for a file named 'bootstrap.js' and use that (note that if there is no 'bootstrap.js', there will be no bootstrap vat).
Swingsets defined by scanning a directory in this manner define no devices.
Defined in
packages/SwingSet/src/controller/initializeSwingset.js:125
loadSwingsetConfigFile
▸ loadSwingsetConfigFile(configPath
): Promise
<null
| SwingSetConfig
>
Read and parse a swingset config file and return it in normalized form.
Parameters
Name | Type | Description |
---|---|---|
configPath | string | Path to the config file to be processed |
Returns
Promise
<null
| SwingSetConfig
>
the contained config object, in normalized form, or null if the requested config file did not exist.
Throws
if the file existed but was inaccessible, malformed, or otherwise invalid.
Defined in
packages/SwingSet/src/controller/initializeSwingset.js:236
makeSwingsetController
▸ makeSwingsetController(kernelStorage?
, deviceEndowments?
, runtimeOptions?
): Promise
<{ debug
: { addDeviceHook
: (deviceName
: any
, hookName
: any
, hook
: any
) => void
= kernel.addDeviceHook } ; validateAndInstallBundle
: (bundle
: EndoZipBase64Bundle
, allegedBundleID?
: string
) => Promise
<string
> ; writeSlogObject
: (obj
: any
) => void
; changeKernelOptions
: (options
: any
) => void
; deviceNameToID
: (deviceName
: any
) => undefined
| string
; dump
: () => { acceptanceQueue
: any
[] ; gcActions
: any
[] ; kernelTable
: any
[] ; log
: string
[] = ephemeral.log; objects
: any
[][] ; promises
: { id
: string
= kpid; state
: string
}[] ; reapQueue
: any
; runQueue
: any
[] ; vatTables
: { state
: { transcript
: [number
, TranscriptEntry
][] } ; vatID
: string
}[] } ; getActivityhash
: () => string
; getStats
: () => {} ; getStatus
: () => { activeVats
: { id
: string
; options
: RecordedVatOptions
}[] } ; kpResolution
: (kpid
: any
, options
: any
) => any
; kpStatus
: (kpid
: any
) => string
; log
: (str
: any
) => void
; pinVatRoot
: (vatName
: any
) => string
; queueToVatObject
: (target
: any
, method
: string
| symbol
, args
: unknown
[], resultPolicy
: ResolutionPolicy
) => undefined
| string
; queueToVatRoot
: (vatName
: string
, method
: string
| symbol
, args
: unknown
[], resultPolicy
: ResolutionPolicy
) => undefined
| string
; reapAllVats
: () => void
; run
: (policy?
: RunPolicy
) => Promise
<number
> ; shutdown
: () => Promise
<void
> ; step
: () => Promise
<0
| 1
> ; upgradeStaticVat
: (vatName
: any
, shouldPauseFirst
: any
, bundleID
: any
, options
: {}) => undefined
| string
; vatNameToID
: (vatName
: any
) => string
; verboseDebugMode
: (flag
: any
) => void
}>
Parameters
Name | Type |
---|---|
kernelStorage | SwingStoreKernelStorage |
deviceEndowments | Record <string , unknown > |
runtimeOptions | Object |
runtimeOptions.bundleHandler? | BundleHandler |
runtimeOptions.debugPrefix? | string |
runtimeOptions.debugVats? | string [] |
runtimeOptions.env? | Record <string , undefined | string > |
runtimeOptions.kernelBundle? | Bundle |
runtimeOptions.overrideVatManagerOptions? | unknown |
runtimeOptions.profileVats? | string [] |
runtimeOptions.slogCallbacks? | unknown |
runtimeOptions.slogSender? | SlogSender |
runtimeOptions.spawn? | (command : string , options? : SpawnOptionsWithoutStdio ) => ChildProcessWithoutNullStreams (command : string , options : SpawnOptionsWithStdioTuple <StdioPipe , StdioPipe , StdioPipe >) => ChildProcessByStdio <Writable , Readable , Readable >(command : string , options : SpawnOptionsWithStdioTuple <StdioPipe , StdioPipe , StdioNull >) => ChildProcessByStdio <Writable , Readable , null >(command : string , options : SpawnOptionsWithStdioTuple <StdioPipe , StdioNull , StdioPipe >) => ChildProcessByStdio <Writable , null , Readable >(command : string , options : SpawnOptionsWithStdioTuple <StdioNull , StdioPipe , StdioPipe >) => ChildProcessByStdio <null , Readable , Readable >(command : string , options : SpawnOptionsWithStdioTuple <StdioPipe , StdioNull , StdioNull >) => ChildProcessByStdio <Writable , null , null >(command : string , options : SpawnOptionsWithStdioTuple <StdioNull , StdioPipe , StdioNull >) => ChildProcessByStdio <null , Readable , null >(command : string , options : SpawnOptionsWithStdioTuple <StdioNull , StdioNull , StdioPipe >) => ChildProcessByStdio <null , null , Readable >(command : string , options : SpawnOptionsWithStdioTuple <StdioNull , StdioNull , StdioNull >) => ChildProcessByStdio <null , null , null >(command : string , options : SpawnOptions ) => ChildProcess (command : string , args? : readonly string [], options? : SpawnOptionsWithoutStdio ) => ChildProcessWithoutNullStreams (command : string , args : readonly string [], options : SpawnOptionsWithStdioTuple <StdioPipe , StdioPipe , StdioPipe >) => ChildProcessByStdio <Writable , Readable , Readable >(command : string , args : readonly string [], options : SpawnOptionsWithStdioTuple <StdioPipe , StdioPipe , StdioNull >) => ChildProcessByStdio <Writable , Readable , null >(command : string , args : readonly string [], options : SpawnOptionsWithStdioTuple <StdioPipe , StdioNull , StdioPipe >) => ChildProcessByStdio <Writable , null , Readable >(command : string , args : readonly string [], options : SpawnOptionsWithStdioTuple <StdioNull , StdioPipe , StdioPipe >) => ChildProcessByStdio <null , Readable , Readable >(command : string , args : readonly string [], options : SpawnOptionsWithStdioTuple <StdioPipe , StdioNull , StdioNull >) => ChildProcessByStdio <Writable , null , null >(command : string , args : readonly string [], options : SpawnOptionsWithStdioTuple <StdioNull , StdioPipe , StdioNull >) => ChildProcessByStdio <null , Readable , null >(command : string , args : readonly string [], options : SpawnOptionsWithStdioTuple <StdioNull , StdioNull , StdioPipe >) => ChildProcessByStdio <null , null , Readable >(command : string , args : readonly string [], options : SpawnOptionsWithStdioTuple <StdioNull , StdioNull , StdioNull >) => ChildProcessByStdio <null , null , null >(command : string , args : readonly string [], options : SpawnOptions ) => ChildProcess |
runtimeOptions.testTrackDecref? | unknown |
runtimeOptions.verbose? | boolean |
runtimeOptions.warehousePolicy? | VatWarehousePolicy |
runtimeOptions.xsnapBundleData? | Object |
runtimeOptions.xsnapBundleData.getLockdownBundle | () => Promise <Bundle > |
runtimeOptions.xsnapBundleData.getLockdownBundleSHA256 | () => Promise <string > |
runtimeOptions.xsnapBundleData.getSupervisorBundle | () => Promise <Bundle > |
runtimeOptions.xsnapBundleData.getSupervisorBundleSHA256 | () => Promise <string > |
Returns
Promise
<{ debug
: { addDeviceHook
: (deviceName
: any
, hookName
: any
, hook
: any
) => void
= kernel.addDeviceHook } ; validateAndInstallBundle
: (bundle
: EndoZipBase64Bundle
, allegedBundleID?
: string
) => Promise
<string
> ; writeSlogObject
: (obj
: any
) => void
; changeKernelOptions
: (options
: any
) => void
; deviceNameToID
: (deviceName
: any
) => undefined
| string
; dump
: () => { acceptanceQueue
: any
[] ; gcActions
: any
[] ; kernelTable
: any
[] ; log
: string
[] = ephemeral.log; objects
: any
[][] ; promises
: { id
: string
= kpid; state
: string
}[] ; reapQueue
: any
; runQueue
: any
[] ; vatTables
: { state
: { transcript
: [number
, TranscriptEntry
][] } ; vatID
: string
}[] } ; getActivityhash
: () => string
; getStats
: () => {} ; getStatus
: () => { activeVats
: { id
: string
; options
: RecordedVatOptions
}[] } ; kpResolution
: (kpid
: any
, options
: any
) => any
; kpStatus
: (kpid
: any
) => string
; log
: (str
: any
) => void
; pinVatRoot
: (vatName
: any
) => string
; queueToVatObject
: (target
: any
, method
: string
| symbol
, args
: unknown
[], resultPolicy
: ResolutionPolicy
) => undefined
| string
; queueToVatRoot
: (vatName
: string
, method
: string
| symbol
, args
: unknown
[], resultPolicy
: ResolutionPolicy
) => undefined
| string
; reapAllVats
: () => void
; run
: (policy?
: RunPolicy
) => Promise
<number
> ; shutdown
: () => Promise
<void
> ; step
: () => Promise
<0
| 1
> ; upgradeStaticVat
: (vatName
: any
, shouldPauseFirst
: any
, bundleID
: any
, options
: {}) => undefined
| string
; vatNameToID
: (vatName
: any
) => string
; verboseDebugMode
: (flag
: any
) => void
}>
Defined in
packages/SwingSet/src/controller/controller.js:109
swingsetIsInitialized
▸ swingsetIsInitialized(kernelStorage
): boolean
Parameters
Name | Type |
---|---|
kernelStorage | any |
Returns
boolean