@mysten-incubation/devstack 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +189 -0
- package/README.md +94 -0
- package/dist/_virtual/_rolldown/runtime.mjs +13 -0
- package/dist/api/define-capabilities.d.mts +25 -0
- package/dist/api/define-capabilities.mjs +19 -0
- package/dist/api/define-capabilities.mjs.map +1 -0
- package/dist/api/define-devstack-with.d.mts +41 -0
- package/dist/api/define-devstack-with.mjs +24 -0
- package/dist/api/define-devstack-with.mjs.map +1 -0
- package/dist/api/define-devstack.d.mts +62 -0
- package/dist/api/define-devstack.mjs +108 -0
- package/dist/api/define-devstack.mjs.map +1 -0
- package/dist/api/define-plugin.d.mts +1 -0
- package/dist/api/inference-network.mjs +122 -0
- package/dist/api/inference-network.mjs.map +1 -0
- package/dist/api/mode-narrowed-factory.d.mts +26 -0
- package/dist/api/mode-narrowed-factory.mjs +8 -0
- package/dist/api/mode-narrowed-factory.mjs.map +1 -0
- package/dist/api/plugin-errors.mjs +10 -0
- package/dist/api/plugin-errors.mjs.map +1 -0
- package/dist/api/run-stack.d.mts +82 -0
- package/dist/api/run-stack.mjs +127 -0
- package/dist/api/run-stack.mjs.map +1 -0
- package/dist/build-integrations/playwright/config.d.mts +92 -0
- package/dist/build-integrations/playwright/config.mjs +71 -0
- package/dist/build-integrations/playwright/config.mjs.map +1 -0
- package/dist/build-integrations/playwright/errors.d.mts +82 -0
- package/dist/build-integrations/playwright/errors.mjs +43 -0
- package/dist/build-integrations/playwright/errors.mjs.map +1 -0
- package/dist/build-integrations/playwright/global-setup.d.mts +64 -0
- package/dist/build-integrations/playwright/global-setup.mjs +44 -0
- package/dist/build-integrations/playwright/global-setup.mjs.map +1 -0
- package/dist/build-integrations/playwright/index.d.mts +6 -0
- package/dist/build-integrations/playwright/index.mjs +6 -0
- package/dist/build-integrations/playwright/stack-context.d.mts +95 -0
- package/dist/build-integrations/playwright/stack-context.mjs +277 -0
- package/dist/build-integrations/playwright/stack-context.mjs.map +1 -0
- package/dist/build-integrations/playwright/wallet-context.d.mts +87 -0
- package/dist/build-integrations/playwright/wallet-context.mjs +148 -0
- package/dist/build-integrations/playwright/wallet-context.mjs.map +1 -0
- package/dist/build-integrations/runtime/cold-start-url.d.mts +67 -0
- package/dist/build-integrations/runtime/cold-start-url.mjs +56 -0
- package/dist/build-integrations/runtime/cold-start-url.mjs.map +1 -0
- package/dist/build-integrations/runtime/dapp-kit-slot.mjs +10 -0
- package/dist/build-integrations/runtime/dapp-kit-slot.mjs.map +1 -0
- package/dist/build-integrations/runtime/discover.d.mts +78 -0
- package/dist/build-integrations/runtime/discover.mjs +124 -0
- package/dist/build-integrations/runtime/discover.mjs.map +1 -0
- package/dist/build-integrations/runtime/endpoint-registry.d.mts +26 -0
- package/dist/build-integrations/runtime/endpoint-registry.mjs +41 -0
- package/dist/build-integrations/runtime/endpoint-registry.mjs.map +1 -0
- package/dist/build-integrations/runtime/errors.d.mts +64 -0
- package/dist/build-integrations/runtime/errors.mjs +51 -0
- package/dist/build-integrations/runtime/errors.mjs.map +1 -0
- package/dist/build-integrations/runtime/index.d.mts +7 -0
- package/dist/build-integrations/runtime/index.mjs +6 -0
- package/dist/build-integrations/runtime/read-stack-context.d.mts +38 -0
- package/dist/build-integrations/runtime/read-stack-context.mjs +130 -0
- package/dist/build-integrations/runtime/read-stack-context.mjs.map +1 -0
- package/dist/build-integrations/runtime/stack-context.d.mts +53 -0
- package/dist/build-integrations/vitest/config.d.mts +62 -0
- package/dist/build-integrations/vitest/config.mjs +80 -0
- package/dist/build-integrations/vitest/config.mjs.map +1 -0
- package/dist/build-integrations/vitest/env.d.mts +48 -0
- package/dist/build-integrations/vitest/env.mjs +50 -0
- package/dist/build-integrations/vitest/env.mjs.map +1 -0
- package/dist/build-integrations/vitest/errors.d.mts +44 -0
- package/dist/build-integrations/vitest/errors.mjs +18 -0
- package/dist/build-integrations/vitest/errors.mjs.map +1 -0
- package/dist/build-integrations/vitest/index.d.mts +6 -0
- package/dist/build-integrations/vitest/index.mjs +6 -0
- package/dist/build-integrations/vitest/setup.d.mts +53 -0
- package/dist/build-integrations/vitest/setup.mjs +56 -0
- package/dist/build-integrations/vitest/setup.mjs.map +1 -0
- package/dist/build-integrations/vitest/stack-context.d.mts +58 -0
- package/dist/build-integrations/vitest/stack-context.mjs +67 -0
- package/dist/build-integrations/vitest/stack-context.mjs.map +1 -0
- package/dist/cli/main.d.mts +5 -0
- package/dist/cli/main.mjs +586 -0
- package/dist/cli/main.mjs.map +1 -0
- package/dist/cli/prune-direct.mjs +216 -0
- package/dist/cli/prune-direct.mjs.map +1 -0
- package/dist/cli/snapshot-reader.mjs +73 -0
- package/dist/cli/snapshot-reader.mjs.map +1 -0
- package/dist/cli/up-lifecycle.mjs +28 -0
- package/dist/cli/up-lifecycle.mjs.map +1 -0
- package/dist/contracts/capability-decl.d.mts +42 -0
- package/dist/contracts/chain-probe.d.mts +26 -0
- package/dist/contracts/chain-probe.mjs +8 -0
- package/dist/contracts/chain-probe.mjs.map +1 -0
- package/dist/contracts/codegenable.d.mts +43 -0
- package/dist/contracts/container-runtime.d.mts +245 -0
- package/dist/contracts/liveness-classifier.d.mts +19 -0
- package/dist/contracts/network-resolver.d.mts +15 -0
- package/dist/contracts/network-resolver.mjs +7 -0
- package/dist/contracts/network-resolver.mjs.map +1 -0
- package/dist/contracts/projection.d.mts +15 -0
- package/dist/contracts/routable.d.mts +53 -0
- package/dist/contracts/snapshotable.d.mts +39 -0
- package/dist/contracts/strategy-contributor.d.mts +26 -0
- package/dist/index.d.mts +89 -0
- package/dist/index.mjs +37 -0
- package/dist/orchestrators/codegen/bindings.d.mts +2 -0
- package/dist/orchestrators/codegen/bindings.mjs +340 -0
- package/dist/orchestrators/codegen/bindings.mjs.map +1 -0
- package/dist/orchestrators/codegen/emit.mjs +56 -0
- package/dist/orchestrators/codegen/emit.mjs.map +1 -0
- package/dist/orchestrators/codegen/errors.d.mts +1 -0
- package/dist/orchestrators/codegen/errors.mjs +66 -0
- package/dist/orchestrators/codegen/errors.mjs.map +1 -0
- package/dist/orchestrators/codegen/extras.mjs +16 -0
- package/dist/orchestrators/codegen/extras.mjs.map +1 -0
- package/dist/orchestrators/codegen/format.mjs +109 -0
- package/dist/orchestrators/codegen/format.mjs.map +1 -0
- package/dist/orchestrators/codegen/gitignore.mjs +67 -0
- package/dist/orchestrators/codegen/gitignore.mjs.map +1 -0
- package/dist/orchestrators/codegen/paths.d.mts +1 -0
- package/dist/orchestrators/codegen/paths.mjs +33 -0
- package/dist/orchestrators/codegen/paths.mjs.map +1 -0
- package/dist/orchestrators/codegen/permissions.mjs +6 -0
- package/dist/orchestrators/codegen/permissions.mjs.map +1 -0
- package/dist/orchestrators/codegen/service.d.mts +1 -0
- package/dist/orchestrators/codegen/service.mjs +276 -0
- package/dist/orchestrators/codegen/service.mjs.map +1 -0
- package/dist/orchestrators/router/cleanup.mjs +58 -0
- package/dist/orchestrators/router/cleanup.mjs.map +1 -0
- package/dist/orchestrators/router/cors.mjs +31 -0
- package/dist/orchestrators/router/cors.mjs.map +1 -0
- package/dist/orchestrators/router/entrypoints.d.mts +1 -0
- package/dist/orchestrators/router/entrypoints.mjs +80 -0
- package/dist/orchestrators/router/entrypoints.mjs.map +1 -0
- package/dist/orchestrators/router/errors.d.mts +1 -0
- package/dist/orchestrators/router/errors.mjs +103 -0
- package/dist/orchestrators/router/errors.mjs.map +1 -0
- package/dist/orchestrators/router/file-provider.d.mts +1 -0
- package/dist/orchestrators/router/file-provider.mjs +320 -0
- package/dist/orchestrators/router/file-provider.mjs.map +1 -0
- package/dist/orchestrators/router/hostname.d.mts +1 -0
- package/dist/orchestrators/router/hostname.mjs +107 -0
- package/dist/orchestrators/router/hostname.mjs.map +1 -0
- package/dist/orchestrators/router/index.d.mts +1 -0
- package/dist/orchestrators/router/profile.d.mts +1 -0
- package/dist/orchestrators/router/profile.mjs +109 -0
- package/dist/orchestrators/router/profile.mjs.map +1 -0
- package/dist/orchestrators/router/service.d.mts +3 -0
- package/dist/orchestrators/router/service.mjs +421 -0
- package/dist/orchestrators/router/service.mjs.map +1 -0
- package/dist/orchestrators/router/traefik-container.d.mts +1 -0
- package/dist/orchestrators/router/traefik-container.mjs +229 -0
- package/dist/orchestrators/router/traefik-container.mjs.map +1 -0
- package/dist/orchestrators/runtime-composition.d.mts +10 -0
- package/dist/orchestrators/runtime-composition.mjs +168 -0
- package/dist/orchestrators/runtime-composition.mjs.map +1 -0
- package/dist/orchestrators/snapshot/capture.d.mts +1 -0
- package/dist/orchestrators/snapshot/capture.mjs +350 -0
- package/dist/orchestrators/snapshot/capture.mjs.map +1 -0
- package/dist/orchestrators/snapshot/descriptor.d.mts +1 -0
- package/dist/orchestrators/snapshot/descriptor.mjs +109 -0
- package/dist/orchestrators/snapshot/descriptor.mjs.map +1 -0
- package/dist/orchestrators/snapshot/identity-guard.d.mts +1 -0
- package/dist/orchestrators/snapshot/identity-guard.mjs +132 -0
- package/dist/orchestrators/snapshot/identity-guard.mjs.map +1 -0
- package/dist/orchestrators/snapshot/image-bundle-tags.mjs +207 -0
- package/dist/orchestrators/snapshot/image-bundle-tags.mjs.map +1 -0
- package/dist/orchestrators/snapshot/index.d.mts +1 -0
- package/dist/orchestrators/snapshot/integrity.d.mts +1 -0
- package/dist/orchestrators/snapshot/integrity.mjs +74 -0
- package/dist/orchestrators/snapshot/integrity.mjs.map +1 -0
- package/dist/orchestrators/snapshot/prune.d.mts +1 -0
- package/dist/orchestrators/snapshot/prune.mjs +110 -0
- package/dist/orchestrators/snapshot/prune.mjs.map +1 -0
- package/dist/orchestrators/snapshot/restore.d.mts +1 -0
- package/dist/orchestrators/snapshot/restore.mjs +404 -0
- package/dist/orchestrators/snapshot/restore.mjs.map +1 -0
- package/dist/orchestrators/snapshot/service.d.mts +1 -0
- package/dist/orchestrators/snapshot/service.mjs +296 -0
- package/dist/orchestrators/snapshot/service.mjs.map +1 -0
- package/dist/orchestrators/snapshot/state-document.mjs +18 -0
- package/dist/orchestrators/snapshot/state-document.mjs.map +1 -0
- package/dist/orchestrators/snapshot/wipe.d.mts +1 -0
- package/dist/orchestrators/snapshot/wipe.mjs +59 -0
- package/dist/orchestrators/snapshot/wipe.mjs.map +1 -0
- package/dist/plugins/account/codegen.d.mts +12 -0
- package/dist/plugins/account/codegen.mjs +22 -0
- package/dist/plugins/account/codegen.mjs.map +1 -0
- package/dist/plugins/account/errors.d.mts +44 -0
- package/dist/plugins/account/errors.mjs +16 -0
- package/dist/plugins/account/errors.mjs.map +1 -0
- package/dist/plugins/account/funding.d.mts +94 -0
- package/dist/plugins/account/funding.mjs +199 -0
- package/dist/plugins/account/funding.mjs.map +1 -0
- package/dist/plugins/account/index.d.mts +54 -0
- package/dist/plugins/account/index.mjs +151 -0
- package/dist/plugins/account/index.mjs.map +1 -0
- package/dist/plugins/account/keypair.d.mts +32 -0
- package/dist/plugins/account/keypair.mjs +99 -0
- package/dist/plugins/account/keypair.mjs.map +1 -0
- package/dist/plugins/account/lease.mjs +21 -0
- package/dist/plugins/account/lease.mjs.map +1 -0
- package/dist/plugins/account/registry.d.mts +33 -0
- package/dist/plugins/account/registry.mjs +36 -0
- package/dist/plugins/account/registry.mjs.map +1 -0
- package/dist/plugins/account/service.d.mts +104 -0
- package/dist/plugins/account/service.mjs +405 -0
- package/dist/plugins/account/service.mjs.map +1 -0
- package/dist/plugins/account/snapshot.mjs +33 -0
- package/dist/plugins/account/snapshot.mjs.map +1 -0
- package/dist/plugins/account/variants/env.mjs +24 -0
- package/dist/plugins/account/variants/env.mjs.map +1 -0
- package/dist/plugins/account/variants/ephemeral.mjs +72 -0
- package/dist/plugins/account/variants/ephemeral.mjs.map +1 -0
- package/dist/plugins/account/variants/impersonate.d.mts +16 -0
- package/dist/plugins/account/variants/impersonate.mjs +48 -0
- package/dist/plugins/account/variants/impersonate.mjs.map +1 -0
- package/dist/plugins/account/variants/inline.mjs +13 -0
- package/dist/plugins/account/variants/inline.mjs.map +1 -0
- package/dist/plugins/account/variants/keystore.mjs +93 -0
- package/dist/plugins/account/variants/keystore.mjs.map +1 -0
- package/dist/plugins/account/variants/signer.mjs +31 -0
- package/dist/plugins/account/variants/signer.mjs.map +1 -0
- package/dist/plugins/action/build-context.d.mts +41 -0
- package/dist/plugins/action/discriminator.d.mts +20 -0
- package/dist/plugins/action/discriminator.mjs +13 -0
- package/dist/plugins/action/discriminator.mjs.map +1 -0
- package/dist/plugins/action/errors.d.mts +31 -0
- package/dist/plugins/action/errors.mjs +13 -0
- package/dist/plugins/action/errors.mjs.map +1 -0
- package/dist/plugins/action/execute.d.mts +2 -0
- package/dist/plugins/action/execute.mjs +145 -0
- package/dist/plugins/action/execute.mjs.map +1 -0
- package/dist/plugins/action/index.d.mts +56 -0
- package/dist/plugins/action/index.mjs +82 -0
- package/dist/plugins/action/index.mjs.map +1 -0
- package/dist/plugins/action/service.d.mts +26 -0
- package/dist/plugins/action/service.mjs +84 -0
- package/dist/plugins/action/service.mjs.map +1 -0
- package/dist/plugins/coin/address-resolution.d.mts +34 -0
- package/dist/plugins/coin/address-resolution.mjs +80 -0
- package/dist/plugins/coin/address-resolution.mjs.map +1 -0
- package/dist/plugins/coin/codegen.d.mts +16 -0
- package/dist/plugins/coin/codegen.mjs +21 -0
- package/dist/plugins/coin/codegen.mjs.map +1 -0
- package/dist/plugins/coin/discovery.d.mts +26 -0
- package/dist/plugins/coin/discovery.mjs +112 -0
- package/dist/plugins/coin/discovery.mjs.map +1 -0
- package/dist/plugins/coin/errors.d.mts +48 -0
- package/dist/plugins/coin/errors.mjs +13 -0
- package/dist/plugins/coin/errors.mjs.map +1 -0
- package/dist/plugins/coin/index.d.mts +95 -0
- package/dist/plugins/coin/index.mjs +172 -0
- package/dist/plugins/coin/index.mjs.map +1 -0
- package/dist/plugins/coin/metadata.d.mts +15 -0
- package/dist/plugins/coin/metadata.mjs +99 -0
- package/dist/plugins/coin/metadata.mjs.map +1 -0
- package/dist/plugins/coin/mint.d.mts +34 -0
- package/dist/plugins/coin/mint.mjs +164 -0
- package/dist/plugins/coin/mint.mjs.map +1 -0
- package/dist/plugins/coin/registry.d.mts +1 -0
- package/dist/plugins/coin/registry.mjs +37 -0
- package/dist/plugins/coin/registry.mjs.map +1 -0
- package/dist/plugins/coin/service.d.mts +47 -0
- package/dist/plugins/coin/service.mjs +51 -0
- package/dist/plugins/coin/service.mjs.map +1 -0
- package/dist/plugins/coin/snapshot.mjs +19 -0
- package/dist/plugins/coin/snapshot.mjs.map +1 -0
- package/dist/plugins/coin/type-strings.mjs +49 -0
- package/dist/plugins/coin/type-strings.mjs.map +1 -0
- package/dist/plugins/deepbook/codegen.d.mts +39 -0
- package/dist/plugins/deepbook/codegen.mjs +15 -0
- package/dist/plugins/deepbook/codegen.mjs.map +1 -0
- package/dist/plugins/deepbook/deploy.mjs +437 -0
- package/dist/plugins/deepbook/deploy.mjs.map +1 -0
- package/dist/plugins/deepbook/errors.d.mts +29 -0
- package/dist/plugins/deepbook/errors.mjs +26 -0
- package/dist/plugins/deepbook/errors.mjs.map +1 -0
- package/dist/plugins/deepbook/faucet-strategy.d.mts +8 -0
- package/dist/plugins/deepbook/faucet-strategy.mjs +81 -0
- package/dist/plugins/deepbook/faucet-strategy.mjs.map +1 -0
- package/dist/plugins/deepbook/index.d.mts +171 -0
- package/dist/plugins/deepbook/index.mjs +359 -0
- package/dist/plugins/deepbook/index.mjs.map +1 -0
- package/dist/plugins/deepbook/plugin-key.mjs +7 -0
- package/dist/plugins/deepbook/plugin-key.mjs.map +1 -0
- package/dist/plugins/deepbook/pyth/index.mjs +226 -0
- package/dist/plugins/deepbook/pyth/index.mjs.map +1 -0
- package/dist/plugins/deepbook/routable.mjs +21 -0
- package/dist/plugins/deepbook/routable.mjs.map +1 -0
- package/dist/plugins/deepbook/snapshot.mjs +49 -0
- package/dist/plugins/deepbook/snapshot.mjs.map +1 -0
- package/dist/plugins/deepbook/types.d.mts +125 -0
- package/dist/plugins/deepbook/types.mjs +12 -0
- package/dist/plugins/deepbook/types.mjs.map +1 -0
- package/dist/plugins/faucet/dispatcher.d.mts +9 -0
- package/dist/plugins/faucet/dispatcher.mjs +13 -0
- package/dist/plugins/faucet/dispatcher.mjs.map +1 -0
- package/dist/plugins/faucet/errors.d.mts +86 -0
- package/dist/plugins/faucet/errors.mjs +19 -0
- package/dist/plugins/faucet/errors.mjs.map +1 -0
- package/dist/plugins/faucet/http.mjs +127 -0
- package/dist/plugins/faucet/http.mjs.map +1 -0
- package/dist/plugins/faucet/index.d.mts +43 -0
- package/dist/plugins/faucet/index.mjs +42 -0
- package/dist/plugins/faucet/index.mjs.map +1 -0
- package/dist/plugins/faucet/service.d.mts +20 -0
- package/dist/plugins/faucet/strategies/sui-local.d.mts +23 -0
- package/dist/plugins/faucet/strategies/sui-local.mjs +29 -0
- package/dist/plugins/faucet/strategies/sui-local.mjs.map +1 -0
- package/dist/plugins/host-service/errors.d.mts +27 -0
- package/dist/plugins/host-service/errors.mjs +14 -0
- package/dist/plugins/host-service/errors.mjs.map +1 -0
- package/dist/plugins/host-service/index.d.mts +10 -0
- package/dist/plugins/host-service/index.mjs +48 -0
- package/dist/plugins/host-service/index.mjs.map +1 -0
- package/dist/plugins/host-service/routable.mjs +24 -0
- package/dist/plugins/host-service/routable.mjs.map +1 -0
- package/dist/plugins/host-service/service.d.mts +49 -0
- package/dist/plugins/host-service/service.mjs +375 -0
- package/dist/plugins/host-service/service.mjs.map +1 -0
- package/dist/plugins/package/build.d.mts +1 -0
- package/dist/plugins/package/build.mjs +24 -0
- package/dist/plugins/package/build.mjs.map +1 -0
- package/dist/plugins/package/codegen.d.mts +19 -0
- package/dist/plugins/package/codegen.mjs +41 -0
- package/dist/plugins/package/codegen.mjs.map +1 -0
- package/dist/plugins/package/dep-resolution.mjs +10 -0
- package/dist/plugins/package/dep-resolution.mjs.map +1 -0
- package/dist/plugins/package/errors.d.mts +34 -0
- package/dist/plugins/package/errors.mjs +13 -0
- package/dist/plugins/package/errors.mjs.map +1 -0
- package/dist/plugins/package/index.d.mts +109 -0
- package/dist/plugins/package/index.mjs +207 -0
- package/dist/plugins/package/index.mjs.map +1 -0
- package/dist/plugins/package/mode-known.mjs +41 -0
- package/dist/plugins/package/mode-known.mjs.map +1 -0
- package/dist/plugins/package/mode-local.d.mts +1 -0
- package/dist/plugins/package/mode-local.mjs +183 -0
- package/dist/plugins/package/mode-local.mjs.map +1 -0
- package/dist/plugins/package/publish-executor.mjs +202 -0
- package/dist/plugins/package/publish-executor.mjs.map +1 -0
- package/dist/plugins/package/publish-output.d.mts +28 -0
- package/dist/plugins/package/publish-output.mjs +45 -0
- package/dist/plugins/package/publish-output.mjs.map +1 -0
- package/dist/plugins/package/registry.d.mts +25 -0
- package/dist/plugins/package/registry.mjs +30 -0
- package/dist/plugins/package/registry.mjs.map +1 -0
- package/dist/plugins/package/service.mjs +20 -0
- package/dist/plugins/package/service.mjs.map +1 -0
- package/dist/plugins/package/snapshot.mjs +25 -0
- package/dist/plugins/package/snapshot.mjs.map +1 -0
- package/dist/plugins/postgres/codegen.mjs +42 -0
- package/dist/plugins/postgres/codegen.mjs.map +1 -0
- package/dist/plugins/postgres/connection.d.mts +33 -0
- package/dist/plugins/postgres/connection.mjs +19 -0
- package/dist/plugins/postgres/connection.mjs.map +1 -0
- package/dist/plugins/postgres/db-ensure.mjs +100 -0
- package/dist/plugins/postgres/db-ensure.mjs.map +1 -0
- package/dist/plugins/postgres/errors.d.mts +55 -0
- package/dist/plugins/postgres/errors.mjs +29 -0
- package/dist/plugins/postgres/errors.mjs.map +1 -0
- package/dist/plugins/postgres/index.d.mts +37 -0
- package/dist/plugins/postgres/index.mjs +75 -0
- package/dist/plugins/postgres/index.mjs.map +1 -0
- package/dist/plugins/postgres/routable.mjs +33 -0
- package/dist/plugins/postgres/routable.mjs.map +1 -0
- package/dist/plugins/postgres/service.d.mts +50 -0
- package/dist/plugins/postgres/service.mjs +145 -0
- package/dist/plugins/postgres/service.mjs.map +1 -0
- package/dist/plugins/postgres/snapshot.d.mts +1 -0
- package/dist/plugins/postgres/snapshot.mjs +32 -0
- package/dist/plugins/postgres/snapshot.mjs.map +1 -0
- package/dist/plugins/router-entrypoints.mjs +21 -0
- package/dist/plugins/router-entrypoints.mjs.map +1 -0
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs +59 -0
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs.map +1 -0
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs +132 -0
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs.map +1 -0
- package/dist/plugins/seal/codegen.d.mts +19 -0
- package/dist/plugins/seal/codegen.mjs +16 -0
- package/dist/plugins/seal/codegen.mjs.map +1 -0
- package/dist/plugins/seal/config-render.mjs +82 -0
- package/dist/plugins/seal/config-render.mjs.map +1 -0
- package/dist/plugins/seal/deploy.mjs +198 -0
- package/dist/plugins/seal/deploy.mjs.map +1 -0
- package/dist/plugins/seal/errors.d.mts +52 -0
- package/dist/plugins/seal/errors.mjs +19 -0
- package/dist/plugins/seal/errors.mjs.map +1 -0
- package/dist/plugins/seal/index.d.mts +161 -0
- package/dist/plugins/seal/index.mjs +235 -0
- package/dist/plugins/seal/index.mjs.map +1 -0
- package/dist/plugins/seal/key-manager.d.mts +22 -0
- package/dist/plugins/seal/key-manager.mjs +22 -0
- package/dist/plugins/seal/key-manager.mjs.map +1 -0
- package/dist/plugins/seal/key-server.mjs +175 -0
- package/dist/plugins/seal/key-server.mjs.map +1 -0
- package/dist/plugins/seal/keygen.mjs +96 -0
- package/dist/plugins/seal/keygen.mjs.map +1 -0
- package/dist/plugins/seal/mode/fork-known.d.mts +8 -0
- package/dist/plugins/seal/mode/fork-known.mjs +23 -0
- package/dist/plugins/seal/mode/fork-known.mjs.map +1 -0
- package/dist/plugins/seal/mode/live.d.mts +18 -0
- package/dist/plugins/seal/mode/live.mjs +64 -0
- package/dist/plugins/seal/mode/live.mjs.map +1 -0
- package/dist/plugins/seal/mode/local-keygen.mjs +180 -0
- package/dist/plugins/seal/mode/local-keygen.mjs.map +1 -0
- package/dist/plugins/seal/plugin-key.mjs +7 -0
- package/dist/plugins/seal/plugin-key.mjs.map +1 -0
- package/dist/plugins/seal/registry-publish.d.mts +43 -0
- package/dist/plugins/seal/registry-publish.mjs +9 -0
- package/dist/plugins/seal/registry-publish.mjs.map +1 -0
- package/dist/plugins/seal/routable.mjs +57 -0
- package/dist/plugins/seal/routable.mjs.map +1 -0
- package/dist/plugins/seal/service.mjs +17 -0
- package/dist/plugins/seal/service.mjs.map +1 -0
- package/dist/plugins/seal/snapshot.mjs +51 -0
- package/dist/plugins/seal/snapshot.mjs.map +1 -0
- package/dist/plugins/sui/auto-tick.mjs +45 -0
- package/dist/plugins/sui/auto-tick.mjs.map +1 -0
- package/dist/plugins/sui/chain-build-container.d.mts +1 -0
- package/dist/plugins/sui/chain-probe.d.mts +85 -0
- package/dist/plugins/sui/chain-probe.mjs +104 -0
- package/dist/plugins/sui/chain-probe.mjs.map +1 -0
- package/dist/plugins/sui/codegen.d.mts +14 -0
- package/dist/plugins/sui/codegen.mjs +26 -0
- package/dist/plugins/sui/codegen.mjs.map +1 -0
- package/dist/plugins/sui/errors.d.mts +74 -0
- package/dist/plugins/sui/errors.mjs +28 -0
- package/dist/plugins/sui/errors.mjs.map +1 -0
- package/dist/plugins/sui/fork-orchestration.mjs +24 -0
- package/dist/plugins/sui/fork-orchestration.mjs.map +1 -0
- package/dist/plugins/sui/fork-transaction.mjs +96 -0
- package/dist/plugins/sui/fork-transaction.mjs.map +1 -0
- package/dist/plugins/sui/index.d.mts +318 -0
- package/dist/plugins/sui/index.mjs +182 -0
- package/dist/plugins/sui/index.mjs.map +1 -0
- package/dist/plugins/sui/mode/external.mjs +60 -0
- package/dist/plugins/sui/mode/external.mjs.map +1 -0
- package/dist/plugins/sui/mode/fork.mjs +283 -0
- package/dist/plugins/sui/mode/fork.mjs.map +1 -0
- package/dist/plugins/sui/mode/live.mjs +103 -0
- package/dist/plugins/sui/mode/live.mjs.map +1 -0
- package/dist/plugins/sui/mode/local.mjs +293 -0
- package/dist/plugins/sui/mode/local.mjs.map +1 -0
- package/dist/plugins/sui/mode/shared-boot.mjs +254 -0
- package/dist/plugins/sui/mode/shared-boot.mjs.map +1 -0
- package/dist/plugins/sui/mode/shared.d.mts +103 -0
- package/dist/plugins/sui/mode/shared.mjs +12 -0
- package/dist/plugins/sui/mode/shared.mjs.map +1 -0
- package/dist/plugins/sui/mode/spec.d.mts +94 -0
- package/dist/plugins/sui/network-resolver.d.mts +23 -0
- package/dist/plugins/sui/routable.mjs +88 -0
- package/dist/plugins/sui/routable.mjs.map +1 -0
- package/dist/plugins/sui/seed-objects.d.mts +18 -0
- package/dist/plugins/sui/seed-objects.mjs +25 -0
- package/dist/plugins/sui/seed-objects.mjs.map +1 -0
- package/dist/plugins/sui/service.mjs +38 -0
- package/dist/plugins/sui/service.mjs.map +1 -0
- package/dist/plugins/sui/snapshot.mjs +53 -0
- package/dist/plugins/sui/snapshot.mjs.map +1 -0
- package/dist/plugins/wallet/codegen.d.mts +33 -0
- package/dist/plugins/wallet/codegen.mjs +34 -0
- package/dist/plugins/wallet/codegen.mjs.map +1 -0
- package/dist/plugins/wallet/errors.d.mts +66 -0
- package/dist/plugins/wallet/errors.mjs +16 -0
- package/dist/plugins/wallet/errors.mjs.map +1 -0
- package/dist/plugins/wallet/index.d.mts +63 -0
- package/dist/plugins/wallet/index.mjs +126 -0
- package/dist/plugins/wallet/index.mjs.map +1 -0
- package/dist/plugins/wallet/origin-policy.d.mts +1 -0
- package/dist/plugins/wallet/origin-policy.mjs +65 -0
- package/dist/plugins/wallet/origin-policy.mjs.map +1 -0
- package/dist/plugins/wallet/pairing.d.mts +11 -0
- package/dist/plugins/wallet/pairing.mjs +125 -0
- package/dist/plugins/wallet/pairing.mjs.map +1 -0
- package/dist/plugins/wallet/protocol.d.mts +1 -0
- package/dist/plugins/wallet/protocol.mjs +96 -0
- package/dist/plugins/wallet/protocol.mjs.map +1 -0
- package/dist/plugins/wallet/routable.mjs +32 -0
- package/dist/plugins/wallet/routable.mjs.map +1 -0
- package/dist/plugins/wallet/server.d.mts +12 -0
- package/dist/plugins/wallet/server.mjs +317 -0
- package/dist/plugins/wallet/server.mjs.map +1 -0
- package/dist/plugins/wallet/service.d.mts +68 -0
- package/dist/plugins/wallet/service.mjs +97 -0
- package/dist/plugins/wallet/service.mjs.map +1 -0
- package/dist/plugins/wallet/snapshot.d.mts +1 -0
- package/dist/plugins/wallet/snapshot.mjs +14 -0
- package/dist/plugins/wallet/snapshot.mjs.map +1 -0
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs +42 -0
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs.map +1 -0
- package/dist/plugins/walrus/codegen.d.mts +38 -0
- package/dist/plugins/walrus/codegen.mjs +34 -0
- package/dist/plugins/walrus/codegen.mjs.map +1 -0
- package/dist/plugins/walrus/deploy-paths.mjs +14 -0
- package/dist/plugins/walrus/deploy-paths.mjs.map +1 -0
- package/dist/plugins/walrus/deploy.d.mts +1 -0
- package/dist/plugins/walrus/deploy.mjs +224 -0
- package/dist/plugins/walrus/deploy.mjs.map +1 -0
- package/dist/plugins/walrus/errors.d.mts +38 -0
- package/dist/plugins/walrus/errors.mjs +26 -0
- package/dist/plugins/walrus/errors.mjs.map +1 -0
- package/dist/plugins/walrus/faucet-strategy.d.mts +12 -0
- package/dist/plugins/walrus/faucet-strategy.mjs +62 -0
- package/dist/plugins/walrus/faucet-strategy.mjs.map +1 -0
- package/dist/plugins/walrus/index.d.mts +177 -0
- package/dist/plugins/walrus/index.mjs +284 -0
- package/dist/plugins/walrus/index.mjs.map +1 -0
- package/dist/plugins/walrus/mode/known-deploy.d.mts +25 -0
- package/dist/plugins/walrus/mode/known-deploy.mjs +71 -0
- package/dist/plugins/walrus/mode/known-deploy.mjs.map +1 -0
- package/dist/plugins/walrus/mode/local-cluster.d.mts +34 -0
- package/dist/plugins/walrus/mode/local-cluster.mjs +153 -0
- package/dist/plugins/walrus/mode/local-cluster.mjs.map +1 -0
- package/dist/plugins/walrus/plugin-key.mjs +7 -0
- package/dist/plugins/walrus/plugin-key.mjs.map +1 -0
- package/dist/plugins/walrus/registry-publish.d.mts +24 -0
- package/dist/plugins/walrus/registry-publish.mjs +7 -0
- package/dist/plugins/walrus/registry-publish.mjs.map +1 -0
- package/dist/plugins/walrus/routable.mjs +99 -0
- package/dist/plugins/walrus/routable.mjs.map +1 -0
- package/dist/plugins/walrus/service.mjs +20 -0
- package/dist/plugins/walrus/service.mjs.map +1 -0
- package/dist/plugins/walrus/snapshot.mjs +53 -0
- package/dist/plugins/walrus/snapshot.mjs.map +1 -0
- package/dist/plugins/walrus/storage-nodes.d.mts +15 -0
- package/dist/plugins/walrus/storage-nodes.mjs +154 -0
- package/dist/plugins/walrus/storage-nodes.mjs.map +1 -0
- package/dist/plugins/walrus/wal-swap.d.mts +2 -0
- package/dist/plugins/walrus/wal-swap.mjs +58 -0
- package/dist/plugins/walrus/wal-swap.mjs.map +1 -0
- package/dist/primitives/artifact-publisher.d.mts +12 -0
- package/dist/primitives/cache.d.mts +1 -0
- package/dist/runtime/built-in-plugin-layers.mjs +49 -0
- package/dist/runtime/built-in-plugin-layers.mjs.map +1 -0
- package/dist/runtime/docker/client.d.mts +2 -0
- package/dist/runtime/docker/client.mjs +54 -0
- package/dist/runtime/docker/client.mjs.map +1 -0
- package/dist/runtime/docker/container.d.mts +1 -0
- package/dist/runtime/docker/container.mjs +562 -0
- package/dist/runtime/docker/container.mjs.map +1 -0
- package/dist/runtime/docker/errors.d.mts +1 -0
- package/dist/runtime/docker/errors.mjs +187 -0
- package/dist/runtime/docker/errors.mjs.map +1 -0
- package/dist/runtime/docker/exec.d.mts +1 -0
- package/dist/runtime/docker/exec.mjs +63 -0
- package/dist/runtime/docker/exec.mjs.map +1 -0
- package/dist/runtime/docker/image.d.mts +1 -0
- package/dist/runtime/docker/image.mjs +278 -0
- package/dist/runtime/docker/image.mjs.map +1 -0
- package/dist/runtime/docker/index.d.mts +1 -0
- package/dist/runtime/docker/inventory.d.mts +1 -0
- package/dist/runtime/docker/inventory.mjs +167 -0
- package/dist/runtime/docker/inventory.mjs.map +1 -0
- package/dist/runtime/docker/labels.d.mts +1 -0
- package/dist/runtime/docker/labels.mjs +97 -0
- package/dist/runtime/docker/labels.mjs.map +1 -0
- package/dist/runtime/docker/logs.d.mts +1 -0
- package/dist/runtime/docker/logs.mjs +34 -0
- package/dist/runtime/docker/logs.mjs.map +1 -0
- package/dist/runtime/docker/network.d.mts +1 -0
- package/dist/runtime/docker/network.mjs +168 -0
- package/dist/runtime/docker/network.mjs.map +1 -0
- package/dist/runtime/docker/service.d.mts +9 -0
- package/dist/runtime/docker/service.mjs +266 -0
- package/dist/runtime/docker/service.mjs.map +1 -0
- package/dist/runtime/docker/sweep.d.mts +1 -0
- package/dist/runtime/docker/sweep.mjs +220 -0
- package/dist/runtime/docker/sweep.mjs.map +1 -0
- package/dist/runtime/docker/volume.d.mts +1 -0
- package/dist/runtime/docker/volume.mjs +24 -0
- package/dist/runtime/docker/volume.mjs.map +1 -0
- package/dist/runtime/docker/wrap.d.mts +1 -0
- package/dist/runtime/docker/wrap.mjs +131 -0
- package/dist/runtime/docker/wrap.mjs.map +1 -0
- package/dist/substrate/brand.d.mts +24 -0
- package/dist/substrate/brand.mjs +14 -0
- package/dist/substrate/brand.mjs.map +1 -0
- package/dist/substrate/cross-process.d.mts +1 -0
- package/dist/substrate/cross-process.mjs +28 -0
- package/dist/substrate/cross-process.mjs.map +1 -0
- package/dist/substrate/events.d.mts +117 -0
- package/dist/substrate/identity.d.mts +13 -0
- package/dist/substrate/lifecycle.d.mts +12 -0
- package/dist/substrate/manifest.d.mts +39 -0
- package/dist/substrate/manifest.mjs +33 -0
- package/dist/substrate/manifest.mjs.map +1 -0
- package/dist/substrate/network.d.mts +34 -0
- package/dist/substrate/options.d.mts +23 -0
- package/dist/substrate/plugin.d.mts +101 -0
- package/dist/substrate/plugin.mjs +61 -0
- package/dist/substrate/plugin.mjs.map +1 -0
- package/dist/substrate/projection.d.mts +100 -0
- package/dist/substrate/runtime/artifact-publisher/index.mjs +76 -0
- package/dist/substrate/runtime/artifact-publisher/index.mjs.map +1 -0
- package/dist/substrate/runtime/atomic-write.mjs +106 -0
- package/dist/substrate/runtime/atomic-write.mjs.map +1 -0
- package/dist/substrate/runtime/cache/index.d.mts +1 -0
- package/dist/substrate/runtime/cache/schema.d.mts +1 -0
- package/dist/substrate/runtime/cache/schema.mjs +22 -0
- package/dist/substrate/runtime/cache/schema.mjs.map +1 -0
- package/dist/substrate/runtime/cache/service.d.mts +1 -0
- package/dist/substrate/runtime/cache/service.mjs +89 -0
- package/dist/substrate/runtime/cache/service.mjs.map +1 -0
- package/dist/substrate/runtime/capability-sinks/index.d.mts +1 -0
- package/dist/substrate/runtime/capability-sinks/layer.d.mts +1 -0
- package/dist/substrate/runtime/capability-sinks/layer.mjs +31 -0
- package/dist/substrate/runtime/capability-sinks/layer.mjs.map +1 -0
- package/dist/substrate/runtime/capability-sinks/service.d.mts +36 -0
- package/dist/substrate/runtime/capability-sinks/service.mjs +74 -0
- package/dist/substrate/runtime/capability-sinks/service.mjs.map +1 -0
- package/dist/substrate/runtime/config-validation.d.mts +38 -0
- package/dist/substrate/runtime/config-validation.mjs +137 -0
- package/dist/substrate/runtime/config-validation.mjs.map +1 -0
- package/dist/substrate/runtime/context-helpers.mjs +32 -0
- package/dist/substrate/runtime/context-helpers.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs +128 -0
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs +136 -0
- package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs +49 -0
- package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs +9 -0
- package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/liveness.mjs +119 -0
- package/dist/substrate/runtime/cross-process/liveness.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/roster.mjs +275 -0
- package/dist/substrate/runtime/cross-process/roster.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/snapshot-reservation.d.mts +1 -0
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs +117 -0
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/stack-lock.d.mts +1 -0
- package/dist/substrate/runtime/cross-process/stack-lock.mjs +142 -0
- package/dist/substrate/runtime/cross-process/stack-lock.mjs.map +1 -0
- package/dist/substrate/runtime/current-plugin.mjs +15 -0
- package/dist/substrate/runtime/current-plugin.mjs.map +1 -0
- package/dist/substrate/runtime/errors.d.mts +1 -0
- package/dist/substrate/runtime/errors.mjs +76 -0
- package/dist/substrate/runtime/errors.mjs.map +1 -0
- package/dist/substrate/runtime/host-tree-tar/index.mjs +364 -0
- package/dist/substrate/runtime/host-tree-tar/index.mjs.map +1 -0
- package/dist/substrate/runtime/http-probe.d.mts +35 -0
- package/dist/substrate/runtime/http-probe.mjs +65 -0
- package/dist/substrate/runtime/http-probe.mjs.map +1 -0
- package/dist/substrate/runtime/lease-broker/index.d.mts +1 -0
- package/dist/substrate/runtime/lease-broker/service.d.mts +64 -0
- package/dist/substrate/runtime/lease-broker/service.mjs +155 -0
- package/dist/substrate/runtime/lease-broker/service.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/dep-graph.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs +138 -0
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/index.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs +31 -0
- package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/plugin-registry.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs +133 -0
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/ready-gate.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/ready-gate.mjs +34 -0
- package/dist/substrate/runtime/lifecycle/ready-gate.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/selective-restart.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/selective-restart.mjs +43 -0
- package/dist/substrate/runtime/lifecycle/selective-restart.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/signals.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/signals.mjs +64 -0
- package/dist/substrate/runtime/lifecycle/signals.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/state-machine.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/state-machine.mjs +38 -0
- package/dist/substrate/runtime/lifecycle/state-machine.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/watch-attribution.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/watch-attribution.mjs +27 -0
- package/dist/substrate/runtime/lifecycle/watch-attribution.mjs.map +1 -0
- package/dist/substrate/runtime/managed-container.d.mts +30 -0
- package/dist/substrate/runtime/managed-container.mjs +32 -0
- package/dist/substrate/runtime/managed-container.mjs.map +1 -0
- package/dist/substrate/runtime/manifest/manifest.mjs +73 -0
- package/dist/substrate/runtime/manifest/manifest.mjs.map +1 -0
- package/dist/substrate/runtime/mode-errors.d.mts +36 -0
- package/dist/substrate/runtime/observability/cascade-formatter.d.mts +1 -0
- package/dist/substrate/runtime/observability/cascade-formatter.mjs +135 -0
- package/dist/substrate/runtime/observability/cascade-formatter.mjs.map +1 -0
- package/dist/substrate/runtime/observability/formatter-registry.d.mts +1 -0
- package/dist/substrate/runtime/observability/formatter-registry.mjs +65 -0
- package/dist/substrate/runtime/observability/formatter-registry.mjs.map +1 -0
- package/dist/substrate/runtime/observability/index.d.mts +3 -0
- package/dist/substrate/runtime/observability/logger.d.mts +58 -0
- package/dist/substrate/runtime/observability/logger.mjs +89 -0
- package/dist/substrate/runtime/observability/logger.mjs.map +1 -0
- package/dist/substrate/runtime/observability/pretty-error.d.mts +1 -0
- package/dist/substrate/runtime/observability/pretty-error.mjs +119 -0
- package/dist/substrate/runtime/observability/pretty-error.mjs.map +1 -0
- package/dist/substrate/runtime/observability/process-lines.d.mts +31 -0
- package/dist/substrate/runtime/observability/process-lines.mjs +40 -0
- package/dist/substrate/runtime/observability/process-lines.mjs.map +1 -0
- package/dist/substrate/runtime/observability/redaction.d.mts +28 -0
- package/dist/substrate/runtime/observability/redaction.mjs +45 -0
- package/dist/substrate/runtime/observability/redaction.mjs.map +1 -0
- package/dist/substrate/runtime/observability/spans.d.mts +1 -0
- package/dist/substrate/runtime/observability/spans.mjs +87 -0
- package/dist/substrate/runtime/observability/spans.mjs.map +1 -0
- package/dist/substrate/runtime/observability/subprocess-capture.d.mts +2 -0
- package/dist/substrate/runtime/observability/subprocess-capture.mjs +82 -0
- package/dist/substrate/runtime/observability/subprocess-capture.mjs.map +1 -0
- package/dist/substrate/runtime/paths.d.mts +17 -0
- package/dist/substrate/runtime/paths.mjs +61 -0
- package/dist/substrate/runtime/paths.mjs.map +1 -0
- package/dist/substrate/runtime/port-broker/index.d.mts +1 -0
- package/dist/substrate/runtime/port-broker/service.d.mts +1 -0
- package/dist/substrate/runtime/port-broker/service.mjs +319 -0
- package/dist/substrate/runtime/port-broker/service.mjs.map +1 -0
- package/dist/substrate/runtime/post-acquire-tasks.d.mts +1 -0
- package/dist/substrate/runtime/post-acquire-tasks.mjs +34 -0
- package/dist/substrate/runtime/post-acquire-tasks.mjs.map +1 -0
- package/dist/substrate/runtime/probes.d.mts +51 -0
- package/dist/substrate/runtime/probes.mjs +84 -0
- package/dist/substrate/runtime/probes.mjs.map +1 -0
- package/dist/substrate/runtime/process-supervisor.d.mts +57 -0
- package/dist/substrate/runtime/process-supervisor.mjs +73 -0
- package/dist/substrate/runtime/process-supervisor.mjs.map +1 -0
- package/dist/substrate/runtime/projection/operational-endpoints.mjs +44 -0
- package/dist/substrate/runtime/projection/operational-endpoints.mjs.map +1 -0
- package/dist/substrate/runtime/projection/persisted.mjs +195 -0
- package/dist/substrate/runtime/projection/persisted.mjs.map +1 -0
- package/dist/substrate/runtime/projection/state-ref.mjs +48 -0
- package/dist/substrate/runtime/projection/state-ref.mjs.map +1 -0
- package/dist/substrate/runtime/projection/update.mjs +200 -0
- package/dist/substrate/runtime/projection/update.mjs.map +1 -0
- package/dist/substrate/runtime/retry-policy.d.mts +18 -0
- package/dist/substrate/runtime/retry-policy.mjs +16 -0
- package/dist/substrate/runtime/retry-policy.mjs.map +1 -0
- package/dist/substrate/runtime/run.mjs +86 -0
- package/dist/substrate/runtime/run.mjs.map +1 -0
- package/dist/substrate/runtime/runtime-decode.d.mts +32 -0
- package/dist/substrate/runtime/runtime-decode.mjs +53 -0
- package/dist/substrate/runtime/runtime-decode.mjs.map +1 -0
- package/dist/substrate/runtime/scoped-http-server.mjs +36 -0
- package/dist/substrate/runtime/scoped-http-server.mjs.map +1 -0
- package/dist/substrate/runtime/scoped-ref-map/service.mjs +83 -0
- package/dist/substrate/runtime/scoped-ref-map/service.mjs.map +1 -0
- package/dist/substrate/runtime/stage-and-swap/index.d.mts +1 -0
- package/dist/substrate/runtime/stage-and-swap/index.mjs +131 -0
- package/dist/substrate/runtime/stage-and-swap/index.mjs.map +1 -0
- package/dist/substrate/runtime/state-store/schema.mjs +36 -0
- package/dist/substrate/runtime/state-store/schema.mjs.map +1 -0
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.d.mts +1 -0
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs +22 -0
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs.map +1 -0
- package/dist/substrate/runtime/strategy-registry/faucet-capability-for.d.mts +1 -0
- package/dist/substrate/runtime/strategy-registry/faucet-capability-for.mjs +30 -0
- package/dist/substrate/runtime/strategy-registry/faucet-capability-for.mjs.map +1 -0
- package/dist/substrate/runtime/strategy-registry/index.d.mts +1 -0
- package/dist/substrate/runtime/strategy-registry/service.d.mts +1 -0
- package/dist/substrate/runtime/strategy-registry/service.mjs +67 -0
- package/dist/substrate/runtime/strategy-registry/service.mjs.map +1 -0
- package/dist/substrate/runtime/sui-execute/index.d.mts +11 -0
- package/dist/substrate/runtime/sui-execute/index.mjs +144 -0
- package/dist/substrate/runtime/sui-execute/index.mjs.map +1 -0
- package/dist/substrate/runtime/sui-move-build/index.d.mts +1 -0
- package/dist/substrate/runtime/sui-move-build/index.mjs +283 -0
- package/dist/substrate/runtime/sui-move-build/index.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor.d.mts +1 -0
- package/dist/substrate/runtime/supervisor.mjs +831 -0
- package/dist/substrate/runtime/supervisor.mjs.map +1 -0
- package/dist/surfaces/cli/command-tree.mjs +276 -0
- package/dist/surfaces/cli/command-tree.mjs.map +1 -0
- package/dist/surfaces/cli/commands/config.mjs +31 -0
- package/dist/surfaces/cli/commands/config.mjs.map +1 -0
- package/dist/surfaces/cli/commands/confirm-node.mjs +26 -0
- package/dist/surfaces/cli/commands/confirm-node.mjs.map +1 -0
- package/dist/surfaces/cli/commands/confirm.mjs +26 -0
- package/dist/surfaces/cli/commands/confirm.mjs.map +1 -0
- package/dist/surfaces/cli/commands/doctor-probes.mjs +452 -0
- package/dist/surfaces/cli/commands/doctor-probes.mjs.map +1 -0
- package/dist/surfaces/cli/commands/doctor.mjs +38 -0
- package/dist/surfaces/cli/commands/doctor.mjs.map +1 -0
- package/dist/surfaces/cli/commands/prune-picker.mjs +347 -0
- package/dist/surfaces/cli/commands/prune-picker.mjs.map +1 -0
- package/dist/surfaces/cli/commands/prune.mjs +178 -0
- package/dist/surfaces/cli/commands/prune.mjs.map +1 -0
- package/dist/surfaces/cli/commands/snapshot.mjs +141 -0
- package/dist/surfaces/cli/commands/snapshot.mjs.map +1 -0
- package/dist/surfaces/cli/commands/status.mjs +95 -0
- package/dist/surfaces/cli/commands/status.mjs.map +1 -0
- package/dist/surfaces/cli/commands/supervisor-presence.mjs +33 -0
- package/dist/surfaces/cli/commands/supervisor-presence.mjs.map +1 -0
- package/dist/surfaces/cli/commands/wipe.mjs +28 -0
- package/dist/surfaces/cli/commands/wipe.mjs.map +1 -0
- package/dist/surfaces/cli/envelope.mjs +43 -0
- package/dist/surfaces/cli/envelope.mjs.map +1 -0
- package/dist/surfaces/cli/errors.mjs +110 -0
- package/dist/surfaces/cli/errors.mjs.map +1 -0
- package/dist/surfaces/cli/flags.mjs +56 -0
- package/dist/surfaces/cli/flags.mjs.map +1 -0
- package/dist/surfaces/cli/index.mjs +418 -0
- package/dist/surfaces/cli/index.mjs.map +1 -0
- package/dist/surfaces/cli/output.mjs +115 -0
- package/dist/surfaces/cli/output.mjs.map +1 -0
- package/dist/surfaces/cli/sysexits.mjs +139 -0
- package/dist/surfaces/cli/sysexits.mjs.map +1 -0
- package/dist/surfaces/tui/app.mjs +104 -0
- package/dist/surfaces/tui/app.mjs.map +1 -0
- package/dist/surfaces/tui/dashboard.mjs +261 -0
- package/dist/surfaces/tui/dashboard.mjs.map +1 -0
- package/dist/surfaces/tui/display-derivation.mjs +395 -0
- package/dist/surfaces/tui/display-derivation.mjs.map +1 -0
- package/dist/surfaces/tui/errors.mjs +11 -0
- package/dist/surfaces/tui/errors.mjs.map +1 -0
- package/dist/surfaces/tui/event-log.mjs +155 -0
- package/dist/surfaces/tui/event-log.mjs.map +1 -0
- package/dist/surfaces/tui/heartbeat.mjs +33 -0
- package/dist/surfaces/tui/heartbeat.mjs.map +1 -0
- package/dist/surfaces/tui/index.mjs +50 -0
- package/dist/surfaces/tui/index.mjs.map +1 -0
- package/dist/surfaces/tui/input.mjs +104 -0
- package/dist/surfaces/tui/input.mjs.map +1 -0
- package/dist/surfaces/tui/mode-detect.mjs +32 -0
- package/dist/surfaces/tui/mode-detect.mjs.map +1 -0
- package/dist/surfaces/tui/mount-ink.mjs +31 -0
- package/dist/surfaces/tui/mount-ink.mjs.map +1 -0
- package/dist/surfaces/tui/plain-renderer.mjs +170 -0
- package/dist/surfaces/tui/plain-renderer.mjs.map +1 -0
- package/dist/surfaces/tui/resource-table.mjs +507 -0
- package/dist/surfaces/tui/resource-table.mjs.map +1 -0
- package/images/_shared/signal-forward.sh +77 -0
- package/images/postgres/Dockerfile +32 -0
- package/images/seal/Dockerfile +68 -0
- package/images/seal/entrypoint.sh +65 -0
- package/images/sui/Dockerfile +73 -0
- package/images/sui/entrypoint.sh +244 -0
- package/images/sui-fork/Dockerfile +53 -0
- package/images/sui-fork/entrypoint.sh +51 -0
- package/images/walrus/Dockerfile +122 -0
- package/images/walrus/deploy-walrus.sh +305 -0
- package/images/walrus/run-walrus.sh +53 -0
- package/package.json +94 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/plugins/walrus/index.ts"],"sourcesContent":["// Walrus plugin — barrel + factories.\n//\n// Architecture: Walrus is a service plugin that owns a local cluster\n// or describes a known deployment. The factory at this file folds the\n// four modes behind:\n//\n// - `walrus(opts?)` — local-cluster shorthand. No env\n// defaulting; use `walrusFor(...)`\n// for known deployments.\n// - `walrusFor(network)` — mode-narrowed factory namespace\n// (architecture Tension 11). Returns\n// `{ local: …, known: … }` narrowed\n// to the network's mode. Crucially,\n// the fork branch exposes ONLY\n// `.known` — `.local` is a compile\n// error on a fork-mode network.\n//\n// The plugin emits FOUR capability decls (per mode):\n//\n// Local mode (full local cluster):\n// 1. `snapshotable` — runtime/walrus/<name>/deploy/ subtree\n// + storage-node managed containers.\n// 2. `codegenable` — `walrus-network` bindings.\n// 3. `routable` × (N + 2) — per-node + aggregator + publisher.\n// 4. `strategy-contributor:walrus-state-registry` — local entry.\n// 5. `strategy-contributor:endpoint-registry` — N+2 entries.\n// 6. `strategy-contributor:package-registry` — `walrus.<name>`.\n// 7. `strategy-contributor:coinType:<WAL fullCoinType>`\n// — WAL faucet\n// strategy\n// (when exchange exists).\n//\n// Known mode (read-only deployment):\n// 1. `snapshotable` — identity-guard only; no subtrees.\n// 2. `codegenable` — `walrus-network` bindings (mode='known').\n// 3. `strategy-contributor:walrus-state-registry` — known entry.\n//\n// Resource id: `'walrus'` (singular). The plugin's substrate-level\n// plugin key is the same string.\n\nimport { Effect, Path } from 'effect';\n\nimport { defineModeNamespace } from '../../api/mode-narrowed-factory.ts';\nimport { definePlugin, resource, type ResourceRef } from '../../api/define-plugin.ts';\nimport { pluginErrorContributions } from '../../api/plugin-errors.ts';\nimport type { CodegenableDecl } from '../../contracts/codegenable.ts';\nimport type { ContainerRuntime, EnsureNetworkSpec } from '../../contracts/container-runtime.ts';\nimport type { RoutableDecl } from '../../contracts/routable.ts';\nimport type { SnapshotableDecl } from '../../contracts/snapshotable.ts';\nimport type { StrategyContributorDecl } from '../../contracts/strategy-contributor.ts';\nimport { ContainerRuntimeService } from '../../runtime/docker/service.ts';\nimport { IdentityContext, StackPathsService } from '../../substrate/runtime/paths.ts';\nimport { ArtifactPublisherService } from '../../substrate/runtime/artifact-publisher/index.ts';\nimport type { AcquireContext } from '../../substrate/plugin.ts';\nimport type { AccountFundingCoinValue } from '../account/index.ts';\nimport { coinResourceId, type CoinResourceId } from '../coin/index.ts';\nimport type { SuiProbeKey } from '../sui/chain-probe.ts';\nimport { suiResource } from '../sui/index.ts';\n\nimport { chainProbeFor } from '../../substrate/runtime/strategy-registry/index.ts';\n\nimport { makeCodegenable } from './codegen.ts';\nimport { walrusPluginKey } from './plugin-key.ts';\nimport { WALRUS_ERROR_TAGS, walrusPluginError, type WalrusPluginError } from './errors.ts';\nimport { walFaucetStrategyKey, type WalFaucetStrategy } from './faucet-strategy.ts';\nimport { bootWalrusService, type WalrusMode } from './service.ts';\nimport {\n\tresolveLocalClusterOptions,\n\ttype WalrusLocalClusterOptions,\n} from './mode/local-cluster.ts';\nimport {\n\tresolveKnownDeploymentOptions,\n\ttype WalrusKnownDeploymentOptions,\n} from './mode/known-deploy.ts';\nimport { makeSnapshotable, type WalrusSnapshotMode } from './snapshot.ts';\nimport { makeLocalRoutables } from './routable.ts';\nimport { WALRUS_STATE_REGISTRY_KEY, type WalrusStateEntry } from './registry-publish.ts';\nimport { buildWalrusNetworkName, type WalrusStorageNode } from './storage-nodes.ts';\n\n// ---------------------------------------------------------------------------\n// Resource — the resolved value all consumers read\n// ---------------------------------------------------------------------------\n\n/** The Walrus resolved value carried by the resource. */\nexport interface WalrusResolved {\n\treadonly mode: 'local' | 'known';\n\treadonly chain: string;\n\treadonly walrusPackageId: string | null;\n\treadonly walPackageId: string | null;\n\t/** SDK-ready `packageConfig` — structurally compatible with\n\t * `@mysten/walrus`'s `WalrusPackageConfig`. */\n\treadonly packageConfig: {\n\t\treadonly systemObjectId: string;\n\t\treadonly stakingPoolId: string;\n\t\treadonly exchangeIds?: ReadonlyArray<string>;\n\t};\n\treadonly nodes: ReadonlyArray<WalrusStorageNode>;\n\treadonly proxyUrl: string | null;\n\treadonly aggregatorUrl: string | null;\n\treadonly publisherUrl: string | null;\n\treadonly walFaucetStrategy: WalFaucetStrategy | null;\n\treadonly walCoinType: string | null;\n}\n\n/** Walrus plugin resource. */\nexport const walrusResource = resource<'walrus', WalrusResolved>('walrus');\nconst walrusErrorContributions = pluginErrorContributions(WALRUS_ERROR_TAGS);\n\nexport interface WalrusNetworkIdentity {\n\treadonly app: string;\n\treadonly stack: string;\n\treadonly walrusName: string;\n}\n\n/** Walrus deploy records storage-node listening IPs under this /24.\n * Docker network create requests the matching subnet explicitly, with\n * the prefix derived from the Walrus network identity so parallel\n * stacks don't all claim the same Docker IPAM range. */\nexport const deriveWalrusSubnetPrefix = (identity: WalrusNetworkIdentity): string => {\n\tconst key = `${identity.app}\\0${identity.stack}\\0${identity.walrusName}`;\n\tlet hash = 0x811c9dc5;\n\tfor (let i = 0; i < key.length; i += 1) {\n\t\thash ^= key.charCodeAt(i);\n\t\thash = Math.imul(hash, 0x01000193) >>> 0;\n\t}\n\tconst bucket = hash % (64 * 256);\n\tconst secondOctet = 64 + Math.floor(bucket / 256);\n\tconst thirdOctet = bucket % 256;\n\treturn `10.${secondOctet}.${thirdOctet}`;\n};\n\nexport const walrusNetworkCreateSpec = <Spec extends EnsureNetworkSpec>(\n\tspec: Spec,\n\tsubnetPrefix: string,\n): Spec & Required<Pick<EnsureNetworkSpec, 'subnet' | 'gateway'>> => ({\n\t...spec,\n\tsubnet: `${subnetPrefix}.0/24`,\n\tgateway: `${subnetPrefix}.1`,\n});\n\nconst withWalrusNetworkAddressing = (\n\truntime: ContainerRuntime,\n\twalrusNetworkName: string,\n\tsubnetPrefix: string,\n): ContainerRuntime => ({\n\t...runtime,\n\tensureNetwork: (spec) =>\n\t\truntime.ensureNetwork(\n\t\t\tspec.name === walrusNetworkName ? walrusNetworkCreateSpec(spec, subnetPrefix) : spec,\n\t\t),\n});\n\n// ---------------------------------------------------------------------------\n// Plugin construction (internal — used by walrus() + walrusFor())\n// ---------------------------------------------------------------------------\n\nconst buildLocalPlugin = (opts: WalrusLocalClusterOptions) => {\n\t// Synchronous factory-time validation (distilled-doc invariants\n\t// 11 — `nodeCount >= 1` + `shards >= nodeCount`).\n\tconst resolved = resolveLocalClusterOptions(opts);\n\n\tconst walrusKey = walrusPluginKey(resolved.name);\n\n\treturn definePlugin({\n\t\tid: walrusResource.id,\n\t\tdependsOn: [suiResource] as const,\n\t\trole: 'service',\n\t\tpluginKey: walrusKey,\n\t\tstart: (deps) =>\n\t\t\tEffect.gen(function* () {\n\t\t\t\tconst [sui] = deps;\n\n\t\t\t\t// Substrate-context primitives:\n\t\t\t\t// - `ContainerRuntimeService` + `IdentityContext` arrive\n\t\t\t\t// via the supervisor's plugin runtime context.\n\t\t\t\t// - `ArtifactPublisher` is the substrate-level\n\t\t\t\t// publisher (cache → verify → produce → register cycle).\n\t\t\t\t// - `ChainProbe<SuiProbeKey>` is looked up via the\n\t\t\t\t// StrategyRegistry under `chain-probe:<chainId>`;\n\t\t\t\t// Sui registered itself there at its own acquire.\n\t\t\t\t// - `StackPathsService` resolves the per-stack on-disk\n\t\t\t\t// root so the deploy-output bind-mount source is a\n\t\t\t\t// real path (not the `<runtime>/...` template).\n\t\t\t\tconst runtime = yield* ContainerRuntimeService;\n\t\t\t\tconst identity = yield* IdentityContext;\n\t\t\t\tconst stackPaths = yield* StackPathsService;\n\t\t\t\tconst path = yield* Path.Path;\n\t\t\t\tconst publisher = yield* ArtifactPublisherService;\n\t\t\t\tconst probe = yield* chainProbeFor<SuiProbeKey>(sui.chain);\n\n\t\t\t\t// Resolve the deploy-output bind-mount source from the\n\t\t\t\t// per-stack paths bundle. The deploy one-shot owns preparing\n\t\t\t\t// the directory immediately before its Docker bind mount.\n\t\t\t\tconst deployHostMountPath = path.join(\n\t\t\t\t\tstackPaths.stackRoot,\n\t\t\t\t\t'walrus',\n\t\t\t\t\tresolved.name,\n\t\t\t\t\t'deploy',\n\t\t\t\t);\n\n\t\t\t\t// Cross-container DNS: walrus containers (deploy one-shot\n\t\t\t\t// + N storage nodes) dial sui RPC + faucet via\n\t\t\t\t// `host.docker.internal`. The sui plugin binds brokered\n\t\t\t\t// host ports — no shared docker network needed.\n\t\t\t\t//\n\t\t\t\t// Architectural decision (B5): walrus owns its OWN docker\n\t\t\t\t// network for storage-node ↔ deploy connectivity; sui-side\n\t\t\t\t// hops go through the host gateway.\n\t\t\t\t// On Linux this requires Docker Desktop or the\n\t\t\t\t// `host.docker.internal:host-gateway` runtime hint (the\n\t\t\t\t// established devstack convention — see plugins/deepbook\n\t\t\t\t// which uses the same pattern).\n\t\t\t\tconst walrusNetworkName = buildWalrusNetworkName(\n\t\t\t\t\tidentity.app,\n\t\t\t\t\tidentity.stack,\n\t\t\t\t\tresolved.name,\n\t\t\t\t);\n\t\t\t\tconst walrusSubnetPrefix = deriveWalrusSubnetPrefix({\n\t\t\t\t\tapp: identity.app,\n\t\t\t\t\tstack: identity.stack,\n\t\t\t\t\twalrusName: resolved.name,\n\t\t\t\t});\n\t\t\t\tconst walrusRuntime = withWalrusNetworkAddressing(\n\t\t\t\t\truntime,\n\t\t\t\t\twalrusNetworkName,\n\t\t\t\t\twalrusSubnetPrefix,\n\t\t\t\t);\n\t\t\t\tconst suiRpcUrlInNetwork = sui.hostGateway.rpcUrl;\n\t\t\t\t// sui-faucet v2 endpoint — `/v2/gas` is the supported path\n\t\t\t\t// on devnet-v1.71.0+ (the binary still answers `/v1/gas`\n\t\t\t\t// for backwards-compat but new code targets v2).\n\t\t\t\tconst suiFaucetUrlInNetwork = sui.hostGateway.faucetUrl;\n\t\t\t\tif (suiFaucetUrlInNetwork === null) {\n\t\t\t\t\treturn yield* Effect.fail(\n\t\t\t\t\t\twalrusPluginError(\n\t\t\t\t\t\t\t'deploy',\n\t\t\t\t\t\t\t'walrus local-cluster requires a Sui faucet URL for deploy funding.',\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst walrusFaucetUrlInNetwork = `${suiFaucetUrlInNetwork}/v2/gas`;\n\n\t\t\t\tconst mode: WalrusMode = { mode: 'local', opts: resolved };\n\t\t\t\tconst boot = yield* bootWalrusService(\n\t\t\t\t\t{\n\t\t\t\t\t\truntime: walrusRuntime,\n\t\t\t\t\t\tpublisher,\n\t\t\t\t\t\tprobe,\n\t\t\t\t\t\tsuiSdk: sui.sdk,\n\t\t\t\t\t\tsuiChainId: sui.chain,\n\t\t\t\t\t\tsuiRpcUrlInNetwork,\n\t\t\t\t\t\twalrusFaucetUrlInNetwork,\n\t\t\t\t\t\twaitForFundsReady: sui.waitForTransactionsReady.wait,\n\t\t\t\t\t\tapp: identity.app,\n\t\t\t\t\t\tstack: identity.stack,\n\t\t\t\t\t\tsubnetPrefix: walrusSubnetPrefix,\n\t\t\t\t\t\twalrusNetworkName,\n\t\t\t\t\t\t// Walrus has no `sui-net` to attach to (sui binds\n\t\t\t\t\t\t// host ports). Reuse the walrus network so the\n\t\t\t\t\t\t// deploy one-shot + storage nodes land on a single\n\t\t\t\t\t\t// network and reach sui via `host.docker.internal`.\n\t\t\t\t\t\tsuiNetworkName: walrusNetworkName,\n\t\t\t\t\t\tdeployHostMountPath,\n\t\t\t\t\t},\n\t\t\t\t\tmode,\n\t\t\t\t);\n\n\t\t\t\tif (boot.mode !== 'local') {\n\t\t\t\t\t// Should be unreachable — dispatch is by mode. Defense.\n\t\t\t\t\treturn yield* Effect.die('walrus: mode mismatch in local plugin');\n\t\t\t\t}\n\n\t\t\t\tconst resolvedValue: WalrusResolved = {\n\t\t\t\t\tmode: 'local',\n\t\t\t\t\tchain: sui.chain,\n\t\t\t\t\twalrusPackageId: boot.walrusPackageId,\n\t\t\t\t\twalPackageId: boot.walPackageId,\n\t\t\t\t\tpackageConfig: {\n\t\t\t\t\t\tsystemObjectId: boot.deploy.systemObject,\n\t\t\t\t\t\tstakingPoolId: boot.deploy.stakingObject,\n\t\t\t\t\t\texchangeIds: boot.exchangeObjectId ? [boot.exchangeObjectId] : undefined,\n\t\t\t\t\t},\n\t\t\t\t\tnodes: boot.nodes,\n\t\t\t\t\tproxyUrl: boot.proxyUrl,\n\t\t\t\t\taggregatorUrl: boot.aggregatorUrl,\n\t\t\t\t\tpublisherUrl: boot.publisherUrl,\n\t\t\t\t\twalFaucetStrategy: boot.walFaucetStrategy,\n\t\t\t\t\twalCoinType: boot.walCoinType,\n\t\t\t\t};\n\t\t\t\treturn resolvedValue;\n\t\t\t}),\n\t\tcapabilities: ({ value: resolvedValue, runtime: acquireCtx }) =>\n\t\t\tmakeLocalCapabilities({\n\t\t\t\tname: resolved.name,\n\t\t\t\tnodeCount: resolved.nodeCount,\n\t\t\t\tcontainerApiPort: resolved.containerApiPort,\n\t\t\t\tserviceKey: String(walrusKey),\n\t\t\t\tresolved: resolvedValue,\n\t\t\t\tacquireCtx,\n\t\t\t}),\n\t\terrorContributions: walrusErrorContributions,\n\t});\n};\n\nconst buildKnownPlugin = (opts: WalrusKnownDeploymentOptions) => {\n\t// Synchronous factory-time validation for required deployment ids.\n\tconst resolved = resolveKnownDeploymentOptions(opts);\n\n\treturn definePlugin({\n\t\tid: walrusResource.id,\n\t\tdependsOn: [suiResource] as const,\n\t\t// Known deployment is a pure value-producer — no containers,\n\t\t// no long-running children.\n\t\trole: 'task',\n\t\tstart: () =>\n\t\t\tEffect.succeed({\n\t\t\t\tmode: 'known',\n\t\t\t\tchain: resolved.chain,\n\t\t\t\twalrusPackageId: null,\n\t\t\t\twalPackageId: null,\n\t\t\t\tpackageConfig: {\n\t\t\t\t\tsystemObjectId: resolved.systemObjectId,\n\t\t\t\t\tstakingPoolId: resolved.stakingPoolId,\n\t\t\t\t\texchangeIds: resolved.exchangeIds.length > 0 ? resolved.exchangeIds : undefined,\n\t\t\t\t},\n\t\t\t\tnodes: resolved.nodes,\n\t\t\t\tproxyUrl: resolved.proxyUrl,\n\t\t\t\taggregatorUrl: resolved.aggregatorUrl,\n\t\t\t\tpublisherUrl: resolved.publisherUrl,\n\t\t\t\twalFaucetStrategy: null,\n\t\t\t\twalCoinType: null,\n\t\t\t} satisfies WalrusResolved),\n\t\tcapabilities: ({ value: resolvedValue, runtime: acquireCtx }) =>\n\t\t\tmakeKnownCapabilities({\n\t\t\t\tresolved: resolvedValue,\n\t\t\t\tacquireCtx,\n\t\t\t}),\n\t\terrorContributions: walrusErrorContributions,\n\t});\n};\n\nconst makeLocalCapabilities = (parts: {\n\treadonly name: string;\n\treadonly nodeCount: number;\n\treadonly containerApiPort: number;\n\treadonly serviceKey: string;\n\treadonly resolved: WalrusResolved;\n\treadonly acquireCtx: AcquireContext;\n}) => {\n\tconst { name, nodeCount, containerApiPort, serviceKey, resolved, acquireCtx } = parts;\n\tconst snap: SnapshotableDecl = makeSnapshotable(\n\t\t'local' satisfies WalrusSnapshotMode,\n\t\tacquireCtx.identity.app,\n\t\tacquireCtx.identity.stack,\n\t\tname,\n\t\tresolved.chain,\n\t\tnodeCount,\n\t);\n\tconst codegen: CodegenableDecl<'walrus-network'> = makeCodegenable({\n\t\tmode: 'local',\n\t\tchain: resolved.chain,\n\t\twalrusPackageId: resolved.walrusPackageId,\n\t\twalPackageId: resolved.walPackageId,\n\t\twalCoinType: resolved.walCoinType,\n\t\tsystemObjectId: resolved.packageConfig.systemObjectId,\n\t\tstakingPoolId: resolved.packageConfig.stakingPoolId,\n\t\texchangeIds: resolved.packageConfig.exchangeIds ? [...resolved.packageConfig.exchangeIds] : [],\n\t\tproxyUrl: resolved.proxyUrl,\n\t\taggregatorUrl: resolved.aggregatorUrl,\n\t\tpublisherUrl: resolved.publisherUrl,\n\t\tnodes: resolved.nodes,\n\t});\n\tconst stateRegistry: StrategyContributorDecl<\n\t\ttypeof WALRUS_STATE_REGISTRY_KEY,\n\t\t{ readonly noteName: string }\n\t> = {\n\t\tkind: 'strategy-contributor',\n\t\tcapabilityKey: WALRUS_STATE_REGISTRY_KEY,\n\t\tstrategy: { noteName: name },\n\t\tautoMounted: true,\n\t};\n\tconst walFaucetContribution =\n\t\tresolved.walFaucetStrategy === null || resolved.walCoinType === null\n\t\t\t? []\n\t\t\t: [\n\t\t\t\t\t{\n\t\t\t\t\t\tkind: 'strategy-contributor',\n\t\t\t\t\t\tcapabilityKey: walFaucetStrategyKey(resolved.walCoinType),\n\t\t\t\t\t\tstrategy: resolved.walFaucetStrategy,\n\t\t\t\t\t\tautoMounted: true,\n\t\t\t\t\t} satisfies StrategyContributorDecl<\n\t\t\t\t\t\tReturnType<typeof walFaucetStrategyKey>,\n\t\t\t\t\t\tWalFaucetStrategy\n\t\t\t\t\t>,\n\t\t\t\t];\n\tconst routables = makeLocalRoutables({\n\t\tapp: acquireCtx.identity.app,\n\t\tstack: acquireCtx.identity.stack,\n\t\twalrusName: name,\n\t\tserviceKey,\n\t\tnodeCount,\n\t\tcontainerApiPort,\n\t});\n\treturn [\n\t\tsnap,\n\t\tcodegen,\n\t\tstateRegistry,\n\t\t...walFaucetContribution,\n\t\t...(routables as readonly RoutableDecl[]),\n\t] as const;\n};\n\nconst makeKnownCapabilities = (parts: {\n\treadonly resolved: WalrusResolved;\n\treadonly acquireCtx: AcquireContext;\n}) => {\n\tconst { resolved, acquireCtx } = parts;\n\tconst snap: SnapshotableDecl = makeSnapshotable(\n\t\t'known' satisfies WalrusSnapshotMode,\n\t\tacquireCtx.identity.app,\n\t\tacquireCtx.identity.stack,\n\t\t'walrusKnownDeployment',\n\t\tresolved.chain,\n\t);\n\tconst codegen: CodegenableDecl<'walrus-network'> = makeCodegenable({\n\t\tmode: 'known',\n\t\tchain: resolved.chain,\n\t\twalrusPackageId: resolved.walrusPackageId,\n\t\twalPackageId: resolved.walPackageId,\n\t\twalCoinType: resolved.walCoinType,\n\t\tsystemObjectId: resolved.packageConfig.systemObjectId,\n\t\tstakingPoolId: resolved.packageConfig.stakingPoolId,\n\t\texchangeIds: resolved.packageConfig.exchangeIds ? [...resolved.packageConfig.exchangeIds] : [],\n\t\tproxyUrl: resolved.proxyUrl,\n\t\taggregatorUrl: resolved.aggregatorUrl,\n\t\tpublisherUrl: resolved.publisherUrl,\n\t\tnodes: resolved.nodes,\n\t});\n\tconst stateRegistry: StrategyContributorDecl<typeof WALRUS_STATE_REGISTRY_KEY, WalrusStateEntry> =\n\t\t{\n\t\t\tkind: 'strategy-contributor',\n\t\t\tcapabilityKey: WALRUS_STATE_REGISTRY_KEY,\n\t\t\tstrategy: {\n\t\t\t\tname: 'walrusKnownDeployment',\n\t\t\t\tsystemObjectId: resolved.packageConfig.systemObjectId,\n\t\t\t\tstakingObjectId: resolved.packageConfig.stakingPoolId,\n\t\t\t\tchain: resolved.chain,\n\t\t\t},\n\t\t\tautoMounted: true,\n\t\t};\n\treturn [snap, codegen, stateRegistry] as const;\n};\n\nexport interface WalCoinValue extends AccountFundingCoinValue {\n\treadonly symbol: 'WAL';\n\treadonly fullCoinType: `${string}::wal::WAL`;\n\treadonly decimals: 9;\n\treadonly source: 'walrus';\n}\n\n/** Resolve the local Walrus deployment's WAL coin as an account-funding\n * coin ref. Accounts that need WAL should use:\n *\n * funding: [{ coin: walCoin(localWalrus), amount }]\n *\n * The funding strategy itself is contributed by the Walrus service\n * once its local exchange exists. */\nexport const walCoin = (walrusMember: ResourceRef<'walrus', WalrusResolved>) => {\n\tconst coinRef = resource<CoinResourceId<'wal'>, WalCoinValue>(coinResourceId('wal'));\n\n\treturn definePlugin({\n\t\tid: coinRef.id,\n\t\tdependsOn: walrusMember,\n\t\trole: 'task',\n\t\tstart: (resolved): Effect.Effect<WalCoinValue, WalrusPluginError> =>\n\t\t\tEffect.gen(function* () {\n\t\t\t\tif (resolved.walCoinType === null) {\n\t\t\t\t\treturn yield* Effect.fail(\n\t\t\t\t\t\twalrusPluginError(\n\t\t\t\t\t\t\t'exchange',\n\t\t\t\t\t\t\t'walCoin(...) requires a local Walrus deployment with a WAL package.',\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tsymbol: 'WAL',\n\t\t\t\t\tfullCoinType: resolved.walCoinType as `${string}::wal::WAL`,\n\t\t\t\t\tdecimals: 9,\n\t\t\t\t\tsource: 'walrus',\n\t\t\t\t} satisfies WalCoinValue;\n\t\t\t}),\n\t\terrorContributions: walrusErrorContributions,\n\t});\n};\n\n// ---------------------------------------------------------------------------\n// User-facing factories\n// ---------------------------------------------------------------------------\n\n/** Local-cluster shorthand. Known deployments are selected through\n * `walrusFor(network).known(...)` so network choice stays explicit. */\nexport const walrus = (opts?: { readonly local?: WalrusLocalClusterOptions }) => {\n\treturn buildLocalPlugin(opts?.local ?? {});\n};\n\n/** Mode-narrowed factory namespace.\n *\n * Usage:\n * const network = { mode: 'local', chain: 'sui:localnet' } as const;\n * walrusFor(network).local({...}) // OK\n * walrusFor(network).known({...}) // type error: 'known' not in 'local' branch\n *\n * Critically, the fork branch exposes ONLY `.known` — calling\n * `.local` on a fork-mode network is a **compile error** at the\n * call site (distilled-doc invariant 12 — type-level refusal).\n * Runtime defense-in-depth: see `mode/fork-refusal.ts`. */\nexport const walrusFor = defineModeNamespace({\n\tlocal: {\n\t\tlocal: (opts: WalrusLocalClusterOptions = {}) => buildLocalPlugin(opts),\n\t\tknown: (opts: WalrusKnownDeploymentOptions) => buildKnownPlugin(opts),\n\t},\n\tlive: {\n\t\tknown: (opts: WalrusKnownDeploymentOptions) => buildKnownPlugin(opts),\n\t},\n\tfork: {\n\t\t// `.local` is intentionally absent — calling\n\t\t// `walrusFor(forkNetwork).local(...)` is a compile error.\n\t\tknown: (opts: WalrusKnownDeploymentOptions) => buildKnownPlugin(opts),\n\t},\n});\n\n// ---------------------------------------------------------------------------\n// Re-exports for advanced callers\n// ---------------------------------------------------------------------------\n\nexport type { WalrusLocalClusterOptions } from './mode/local-cluster.ts';\nexport type { WalrusKnownDeploymentOptions, WalrusKnownNetwork } from './mode/known-deploy.ts';\nexport type { WalrusStorageNode } from './storage-nodes.ts';\nexport type { WalrusBindings, WalrusNodeBinding } from './codegen.ts';\nexport type { WalrusError, WalrusPluginError, WalrusConfigError, WalrusPhase } from './errors.ts';\n// `ForkIncompatibleError` is the cross-cutting mode-refusal shape owned\n// by `substrate/runtime/mode-errors.ts`; seal re-exports it\n// under its canonical name from its barrel, so walrus exposes the\n// SAME class under a walrus-namespaced alias to avoid a collision\n// when a downstream consumer imports both plugin barrels in the same\n// scope (STYLE_GUIDE §2 — one `_tag` literal per logical error type).\nexport type { ForkIncompatibleError as WalrusForkIncompatible } from './errors.ts';\nexport { WALRUS_ERROR_TAGS } from './errors.ts';\nexport {\n\twalCoinType,\n\twalFaucetStrategyKey,\n\ttype WalFaucetStrategy,\n\ttype WalFaucetRequest,\n} from './faucet-strategy.ts';\nexport {\n\tWALRUS_STATE_REGISTRY_KEY,\n\ttype WalrusStateEntry,\n\ttype WalrusLocalStateEntry,\n\ttype WalrusKnownStateEntry,\n} from './registry-publish.ts';\nexport { WALRUS_ROUTER_PORT } from './storage-nodes.ts';\n"],"mappings":"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"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { WalrusStorageNode } from "../storage-nodes.mjs";
|
|
2
|
+
import { Effect, Scope } from "effect";
|
|
3
|
+
|
|
4
|
+
//#region src/plugins/walrus/mode/known-deploy.d.ts
|
|
5
|
+
/** Known networks supported by the registry lookup. */
|
|
6
|
+
type WalrusKnownNetwork = 'testnet' | 'mainnet' | 'devnet';
|
|
7
|
+
/** Options for the known-deployment mode. */
|
|
8
|
+
interface WalrusKnownDeploymentOptions {
|
|
9
|
+
/** Network shortcut — looks up per-field defaults from a registry
|
|
10
|
+
* baked into this package. */
|
|
11
|
+
readonly network?: WalrusKnownNetwork;
|
|
12
|
+
/** Per-field overrides. Required when `network` is omitted. */
|
|
13
|
+
readonly systemObjectId?: string;
|
|
14
|
+
readonly stakingPoolId?: string;
|
|
15
|
+
readonly exchangeIds?: ReadonlyArray<string>;
|
|
16
|
+
/** Explicit storage-node committee. Required (throws if missing
|
|
17
|
+
* even when `network` is set — distilled-doc invariant 16). */
|
|
18
|
+
readonly nodes?: ReadonlyArray<WalrusStorageNode>;
|
|
19
|
+
readonly aggregatorUrl?: string;
|
|
20
|
+
readonly publisherUrl?: string;
|
|
21
|
+
readonly proxyUrl?: string;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { WalrusKnownDeploymentOptions, WalrusKnownNetwork };
|
|
25
|
+
//# sourceMappingURL=known-deploy.d.mts.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { expectNonEmptyString } from "../../../substrate/runtime/config-validation.mjs";
|
|
2
|
+
import { walrusConfigError } from "../errors.mjs";
|
|
3
|
+
import { Effect } from "effect";
|
|
4
|
+
//#region src/plugins/walrus/mode/known-deploy.ts
|
|
5
|
+
/** Known-deployment registry — baked-in record per network. The
|
|
6
|
+
* values here mirror v3's `knownDeployments.walrus.{testnet,
|
|
7
|
+
* mainnet}` entries. Devnet has no canonical record today. */
|
|
8
|
+
const KNOWN_DEPLOYMENT_REGISTRY = {
|
|
9
|
+
testnet: {
|
|
10
|
+
chain: "sui:testnet",
|
|
11
|
+
systemObjectId: void 0,
|
|
12
|
+
stakingPoolId: void 0,
|
|
13
|
+
exchangeIds: [],
|
|
14
|
+
aggregatorUrl: "https://aggregator.walrus-testnet.walrus.space",
|
|
15
|
+
publisherUrl: "https://publisher.walrus-testnet.walrus.space",
|
|
16
|
+
proxyUrl: "https://aggregator.walrus-testnet.walrus.space"
|
|
17
|
+
},
|
|
18
|
+
mainnet: {
|
|
19
|
+
chain: "sui:mainnet",
|
|
20
|
+
systemObjectId: void 0,
|
|
21
|
+
stakingPoolId: void 0,
|
|
22
|
+
exchangeIds: [],
|
|
23
|
+
aggregatorUrl: "https://aggregator.walrus.space",
|
|
24
|
+
publisherUrl: "https://publisher.walrus.space",
|
|
25
|
+
proxyUrl: "https://aggregator.walrus.space"
|
|
26
|
+
},
|
|
27
|
+
devnet: { chain: "sui:devnet" }
|
|
28
|
+
};
|
|
29
|
+
/** Synchronous factory-time validation + projection. Throws (NOT
|
|
30
|
+
* Effect-fail) on missing required fields so misconfiguration trips
|
|
31
|
+
* at the `defineDevstack` call site rather than at deferred
|
|
32
|
+
* Layer.build time. Distilled-doc invariants 14 + 16. */
|
|
33
|
+
const resolveKnownDeploymentOptions = (opts) => {
|
|
34
|
+
const reg = opts.network ? KNOWN_DEPLOYMENT_REGISTRY[opts.network] : void 0;
|
|
35
|
+
const systemObjectId = expectNonEmptyString(opts.systemObjectId ?? reg?.systemObjectId, {
|
|
36
|
+
field: "systemObjectId",
|
|
37
|
+
mkError: ({ field }) => walrusConfigError(field, `walrusKnownDeployment: 'systemObjectId' is required (pass it explicitly, or pass network with a registered entry)`)
|
|
38
|
+
});
|
|
39
|
+
const stakingPoolId = expectNonEmptyString(opts.stakingPoolId ?? reg?.stakingPoolId, {
|
|
40
|
+
field: "stakingPoolId",
|
|
41
|
+
mkError: ({ field }) => walrusConfigError(field, `walrusKnownDeployment: 'stakingPoolId' is required (pass it explicitly, or pass network with a registered entry)`)
|
|
42
|
+
});
|
|
43
|
+
const nodes = opts.nodes;
|
|
44
|
+
if (!nodes) throw walrusConfigError("nodes", `walrusKnownDeployment: explicit 'nodes' committee is required — Walrus ${opts.network ?? "custom"} has nodes fetched dynamically by the SDK`, "pass an empty array if you accept the SDK-driven committee lookup, or use walrus()/walrusFor(network).local({...}) for a local self-hosted cluster");
|
|
45
|
+
const aggregatorUrl = opts.aggregatorUrl ?? reg?.aggregatorUrl ?? null;
|
|
46
|
+
const publisherUrl = opts.publisherUrl ?? reg?.publisherUrl ?? null;
|
|
47
|
+
const proxyUrl = opts.proxyUrl ?? reg?.proxyUrl ?? aggregatorUrl ?? publisherUrl ?? null;
|
|
48
|
+
const allUrlsPresent = aggregatorUrl !== null && publisherUrl !== null && proxyUrl !== null;
|
|
49
|
+
return {
|
|
50
|
+
mode: "known",
|
|
51
|
+
chain: reg?.chain ?? "sui:custom",
|
|
52
|
+
systemObjectId,
|
|
53
|
+
stakingPoolId,
|
|
54
|
+
exchangeIds: opts.exchangeIds ?? reg?.exchangeIds ?? [],
|
|
55
|
+
nodes,
|
|
56
|
+
proxyUrl: allUrlsPresent ? proxyUrl : null,
|
|
57
|
+
aggregatorUrl: allUrlsPresent ? aggregatorUrl : null,
|
|
58
|
+
publisherUrl: allUrlsPresent ? publisherUrl : null
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
/** "Boot" the known deployment. Purely synchronous projection inside
|
|
62
|
+
* Effect.gen — no I/O, no Scope work. Surfaces as Effect for
|
|
63
|
+
* uniformity with the local-cluster boot signature. */
|
|
64
|
+
const bootKnownDeployment = (opts) => Effect.try({
|
|
65
|
+
try: () => resolveKnownDeploymentOptions(opts),
|
|
66
|
+
catch: (err) => err
|
|
67
|
+
});
|
|
68
|
+
//#endregion
|
|
69
|
+
export { bootKnownDeployment, resolveKnownDeploymentOptions };
|
|
70
|
+
|
|
71
|
+
//# sourceMappingURL=known-deploy.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"known-deploy.mjs","names":[],"sources":["../../../../src/plugins/walrus/mode/known-deploy.ts"],"sourcesContent":["// Walrus mode — known deployment (testnet / mainnet / *-fork via\n// upstream translation).\n//\n// Distilled-doc reference (06-walrus.md §\"Lifecycle: Startup —\n// known deployment\"). Purely synchronous body — no ordered phases.\n// The factory validates required deployment fields and returns a\n// resolved value whose tags are eager `Layer.succeed(...)` constants.\n//\n// Distilled-doc invariants honored:\n// - 15: `WalrusProxyTag` only when ALL three URLs (proxy,\n// aggregator, publisher) are present. Encoded as\n// `proxyUrl / aggregatorUrl / publisherUrl: string | null`\n// in the resolved shape; the plugin's projection step\n// hides the proxy tag when any is missing.\n// - 16: throw synchronously when `nodes` is missing for a\n// registered network. Testnet has 100+ nodes that the\n// `@mysten/walrus` SDK fetches dynamically; pinning them\n// statically would be misleading.\n\nimport { Effect, type Scope } from 'effect';\n\nimport { expectNonEmptyString } from '../../../substrate/runtime/config-validation.ts';\nimport { walrusConfigError, type WalrusConfigError } from '../errors.ts';\nimport type { WalrusStorageNode } from '../storage-nodes.ts';\n\n/** Known networks supported by the registry lookup. */\nexport type WalrusKnownNetwork = 'testnet' | 'mainnet' | 'devnet';\n\n/** Options for the known-deployment mode. */\nexport interface WalrusKnownDeploymentOptions {\n\t/** Network shortcut — looks up per-field defaults from a registry\n\t * baked into this package. */\n\treadonly network?: WalrusKnownNetwork;\n\t/** Per-field overrides. Required when `network` is omitted. */\n\treadonly systemObjectId?: string;\n\treadonly stakingPoolId?: string;\n\treadonly exchangeIds?: ReadonlyArray<string>;\n\t/** Explicit storage-node committee. Required (throws if missing\n\t * even when `network` is set — distilled-doc invariant 16). */\n\treadonly nodes?: ReadonlyArray<WalrusStorageNode>;\n\treadonly aggregatorUrl?: string;\n\treadonly publisherUrl?: string;\n\treadonly proxyUrl?: string;\n}\n\n/** Resolved known-deployment boot artifacts. */\nexport interface KnownDeploymentBootResult {\n\treadonly mode: 'known';\n\treadonly chain: string;\n\treadonly systemObjectId: string;\n\treadonly stakingPoolId: string;\n\treadonly exchangeIds: ReadonlyArray<string>;\n\treadonly nodes: ReadonlyArray<WalrusStorageNode>;\n\t/** Null when any of the three URLs are missing — distilled-doc\n\t * invariant 15. */\n\treadonly proxyUrl: string | null;\n\treadonly aggregatorUrl: string | null;\n\treadonly publisherUrl: string | null;\n}\n\n/** Known-deployment registry — baked-in record per network. The\n * values here mirror v3's `knownDeployments.walrus.{testnet,\n * mainnet}` entries. Devnet has no canonical record today. */\nconst KNOWN_DEPLOYMENT_REGISTRY: Readonly<\n\tRecord<\n\t\tWalrusKnownNetwork,\n\t\t{\n\t\t\treadonly chain: string;\n\t\t\treadonly systemObjectId?: string;\n\t\t\treadonly stakingPoolId?: string;\n\t\t\treadonly exchangeIds?: ReadonlyArray<string>;\n\t\t\treadonly aggregatorUrl?: string;\n\t\t\treadonly publisherUrl?: string;\n\t\t\treadonly proxyUrl?: string;\n\t\t}\n\t>\n> = {\n\ttestnet: {\n\t\tchain: 'sui:testnet',\n\t\t// Real ids must be supplied via the explicit options form\n\t\t// (`walrusFor(testnet).known({ systemObjectId, stakingPoolId, ... })`).\n\t\t// The known-deployment lookup table only canonicalises the URLs;\n\t\t// the on-chain ids are network-specific and live outside this\n\t\t// package.\n\t\tsystemObjectId: undefined,\n\t\tstakingPoolId: undefined,\n\t\texchangeIds: [],\n\t\taggregatorUrl: 'https://aggregator.walrus-testnet.walrus.space',\n\t\tpublisherUrl: 'https://publisher.walrus-testnet.walrus.space',\n\t\tproxyUrl: 'https://aggregator.walrus-testnet.walrus.space',\n\t},\n\tmainnet: {\n\t\tchain: 'sui:mainnet',\n\t\tsystemObjectId: undefined,\n\t\tstakingPoolId: undefined,\n\t\texchangeIds: [],\n\t\taggregatorUrl: 'https://aggregator.walrus.space',\n\t\tpublisherUrl: 'https://publisher.walrus.space',\n\t\tproxyUrl: 'https://aggregator.walrus.space',\n\t},\n\tdevnet: {\n\t\tchain: 'sui:devnet',\n\t},\n};\n\n/** Synchronous factory-time validation + projection. Throws (NOT\n * Effect-fail) on missing required fields so misconfiguration trips\n * at the `defineDevstack` call site rather than at deferred\n * Layer.build time. Distilled-doc invariants 14 + 16. */\nexport const resolveKnownDeploymentOptions = (\n\topts: WalrusKnownDeploymentOptions,\n): KnownDeploymentBootResult => {\n\tconst reg = opts.network ? KNOWN_DEPLOYMENT_REGISTRY[opts.network] : undefined;\n\n\tconst systemObjectId = expectNonEmptyString(opts.systemObjectId ?? reg?.systemObjectId, {\n\t\tfield: 'systemObjectId',\n\t\tmkError: ({ field }) =>\n\t\t\twalrusConfigError(\n\t\t\t\tfield,\n\t\t\t\t`walrusKnownDeployment: 'systemObjectId' is required (pass it explicitly, or pass network with a registered entry)`,\n\t\t\t),\n\t});\n\n\tconst stakingPoolId = expectNonEmptyString(opts.stakingPoolId ?? reg?.stakingPoolId, {\n\t\tfield: 'stakingPoolId',\n\t\tmkError: ({ field }) =>\n\t\t\twalrusConfigError(\n\t\t\t\tfield,\n\t\t\t\t`walrusKnownDeployment: 'stakingPoolId' is required (pass it explicitly, or pass network with a registered entry)`,\n\t\t\t),\n\t});\n\n\tconst nodes = opts.nodes;\n\tif (!nodes) {\n\t\t// Distilled-doc invariant 16: even when `network` is set, the\n\t\t// nodes must be explicit. Testnet has 100+ nodes the SDK\n\t\t// fetches dynamically; pinning would be misleading.\n\t\tthrow walrusConfigError(\n\t\t\t'nodes',\n\t\t\t`walrusKnownDeployment: explicit 'nodes' committee is required — ` +\n\t\t\t\t`Walrus ${opts.network ?? 'custom'} has nodes fetched dynamically by the SDK`,\n\t\t\t`pass an empty array if you accept the SDK-driven committee lookup, ` +\n\t\t\t\t`or use walrus()/walrusFor(network).local({...}) for a local self-hosted cluster`,\n\t\t);\n\t}\n\n\tconst aggregatorUrl = opts.aggregatorUrl ?? reg?.aggregatorUrl ?? null;\n\tconst publisherUrl = opts.publisherUrl ?? reg?.publisherUrl ?? null;\n\tconst proxyUrl = opts.proxyUrl ?? reg?.proxyUrl ?? aggregatorUrl ?? publisherUrl ?? null;\n\n\t// Invariant 15: surface null when any URL is missing so the\n\t// plugin's projection can conditionally publish the proxy tag.\n\tconst allUrlsPresent = aggregatorUrl !== null && publisherUrl !== null && proxyUrl !== null;\n\n\treturn {\n\t\tmode: 'known' as const,\n\t\tchain: reg?.chain ?? 'sui:custom',\n\t\tsystemObjectId,\n\t\tstakingPoolId,\n\t\texchangeIds: opts.exchangeIds ?? reg?.exchangeIds ?? [],\n\t\tnodes,\n\t\tproxyUrl: allUrlsPresent ? proxyUrl : null,\n\t\taggregatorUrl: allUrlsPresent ? aggregatorUrl : null,\n\t\tpublisherUrl: allUrlsPresent ? publisherUrl : null,\n\t};\n};\n\n/** \"Boot\" the known deployment. Purely synchronous projection inside\n * Effect.gen — no I/O, no Scope work. Surfaces as Effect for\n * uniformity with the local-cluster boot signature. */\nexport const bootKnownDeployment = (\n\topts: WalrusKnownDeploymentOptions,\n): Effect.Effect<KnownDeploymentBootResult, WalrusConfigError, Scope.Scope> =>\n\tEffect.try({\n\t\ttry: () => resolveKnownDeploymentOptions(opts),\n\t\t// `resolveKnownDeploymentOptions` throws our typed config error\n\t\t// shape; map straight back into the typed channel.\n\t\tcatch: (err) => err as WalrusConfigError,\n\t});\n"],"mappings":";;;;;;;AA+DA,MAAM,4BAaF;CACH,SAAS;EACR,OAAO;EAMP,gBAAgB,KAAA;EAChB,eAAe,KAAA;EACf,aAAa,EAAE;EACf,eAAe;EACf,cAAc;EACd,UAAU;EACV;CACD,SAAS;EACR,OAAO;EACP,gBAAgB,KAAA;EAChB,eAAe,KAAA;EACf,aAAa,EAAE;EACf,eAAe;EACf,cAAc;EACd,UAAU;EACV;CACD,QAAQ,EACP,OAAO,cACP;CACD;;;;;AAMD,MAAa,iCACZ,SAC+B;CAC/B,MAAM,MAAM,KAAK,UAAU,0BAA0B,KAAK,WAAW,KAAA;CAErE,MAAM,iBAAiB,qBAAqB,KAAK,kBAAkB,KAAK,gBAAgB;EACvF,OAAO;EACP,UAAU,EAAE,YACX,kBACC,OACA,oHACA;EACF,CAAC;CAEF,MAAM,gBAAgB,qBAAqB,KAAK,iBAAiB,KAAK,eAAe;EACpF,OAAO;EACP,UAAU,EAAE,YACX,kBACC,OACA,mHACA;EACF,CAAC;CAEF,MAAM,QAAQ,KAAK;AACnB,KAAI,CAAC,MAIJ,OAAM,kBACL,SACA,0EACW,KAAK,WAAW,SAAS,4CACpC,qJAEA;CAGF,MAAM,gBAAgB,KAAK,iBAAiB,KAAK,iBAAiB;CAClE,MAAM,eAAe,KAAK,gBAAgB,KAAK,gBAAgB;CAC/D,MAAM,WAAW,KAAK,YAAY,KAAK,YAAY,iBAAiB,gBAAgB;CAIpF,MAAM,iBAAiB,kBAAkB,QAAQ,iBAAiB,QAAQ,aAAa;AAEvF,QAAO;EACN,MAAM;EACN,OAAO,KAAK,SAAS;EACrB;EACA;EACA,aAAa,KAAK,eAAe,KAAK,eAAe,EAAE;EACvD;EACA,UAAU,iBAAiB,WAAW;EACtC,eAAe,iBAAiB,gBAAgB;EAChD,cAAc,iBAAiB,eAAe;EAC9C;;;;;AAMF,MAAa,uBACZ,SAEA,OAAO,IAAI;CACV,WAAW,8BAA8B,KAAK;CAG9C,QAAQ,QAAQ;CAChB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Effect, FileSystem, Path, Scope } from "effect";
|
|
2
|
+
|
|
3
|
+
//#region src/plugins/walrus/mode/local-cluster.d.ts
|
|
4
|
+
/** Options for the local-cluster mode. Mirrors v3
|
|
5
|
+
* `WalrusLocalClusterOptions<Name>` (06-walrus.md §"Configuration"). */
|
|
6
|
+
interface WalrusLocalClusterOptions {
|
|
7
|
+
/** Engine row name + on-disk dir suffix + registry key.
|
|
8
|
+
* Default `'walrus'`. */
|
|
9
|
+
readonly name?: string;
|
|
10
|
+
/** Number of storage-node containers. Must be `>= 1` (synchronous
|
|
11
|
+
* factory-time guard). Default `1`. */
|
|
12
|
+
readonly nodeCount?: number;
|
|
13
|
+
/** Total shards distributed across the committee. Must be
|
|
14
|
+
* `>= nodeCount`. Default `100` (distilled-doc default block). */
|
|
15
|
+
readonly shards?: number;
|
|
16
|
+
/** Pinned walrus release — drives the wrapper image build.
|
|
17
|
+
* Default `'testnet-v1.49.1'`. */
|
|
18
|
+
readonly version?: string;
|
|
19
|
+
/** Sui release whose binary the wrapper image bakes (distilled-
|
|
20
|
+
* doc invariant 24). Default `'devnet-v1.71.0'`. */
|
|
21
|
+
readonly suiVersion?: string;
|
|
22
|
+
/** Port each storage node binds inside the container. Default
|
|
23
|
+
* 9185 (same as the router entrypoint — invariant 9). */
|
|
24
|
+
readonly containerApiPort?: number;
|
|
25
|
+
/** Walrus epoch length passed to `walrus-deploy --epoch-duration`.
|
|
26
|
+
* Default `'24h'`. */
|
|
27
|
+
readonly epochDuration?: string;
|
|
28
|
+
/** Per-node TCP ready-probe timeout (ms). Defaults to
|
|
29
|
+
* `DEFAULT_NODE_READY_TIMEOUT_MS`. */
|
|
30
|
+
readonly readyTimeoutMs?: number;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { WalrusLocalClusterOptions };
|
|
34
|
+
//# sourceMappingURL=local-cluster.d.mts.map
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { contentHash } from "../../../substrate/brand.mjs";
|
|
2
|
+
import { expectPositiveInteger } from "../../../substrate/runtime/config-validation.mjs";
|
|
3
|
+
import { setCurrentPluginPhase } from "../../../substrate/runtime/current-plugin.mjs";
|
|
4
|
+
import { walrusConfigError, walrusPluginError } from "../errors.mjs";
|
|
5
|
+
import { computePublicHostname, startStorageNodes } from "../storage-nodes.mjs";
|
|
6
|
+
import { resolveWalExchange } from "../wal-swap.mjs";
|
|
7
|
+
import { makeWalFaucetStrategy, resolveWalCoinType, walPackageIdFromCoinType } from "../faucet-strategy.mjs";
|
|
8
|
+
import { deployWalrusContracts } from "../deploy.mjs";
|
|
9
|
+
import { resolveCargoImage } from "../bootstrap-assets/cargo-image.mjs";
|
|
10
|
+
import { Effect } from "effect";
|
|
11
|
+
//#region src/plugins/walrus/mode/local-cluster.ts
|
|
12
|
+
/** Synchronous factory-time validation. Mirrors v3's
|
|
13
|
+
* `local-cluster.ts:101-121` guards. Throws (NOT Effect-fail) so
|
|
14
|
+
* misconfiguration trips at the `defineDevstack` call site rather
|
|
15
|
+
* than at deferred Layer.build time. Distilled-doc invariant 11. */
|
|
16
|
+
const resolveLocalClusterOptions = (opts) => {
|
|
17
|
+
const nodeCount = expectPositiveInteger(opts.nodeCount ?? 1, {
|
|
18
|
+
field: "nodeCount",
|
|
19
|
+
mkError: ({ field, message, hint }) => walrusConfigError(field, `walrusLocalCluster: nodeCount must be >= 1 (got ${String(opts.nodeCount ?? 1)})`, hint ?? message),
|
|
20
|
+
hint: "set nodeCount to a positive integer (default 1)"
|
|
21
|
+
});
|
|
22
|
+
const shards = expectPositiveInteger(opts.shards ?? 100, {
|
|
23
|
+
field: "shards",
|
|
24
|
+
mkError: ({ field, message, hint }) => walrusConfigError(field, `walrusLocalCluster: shards must be a positive integer (got ${String(opts.shards ?? 100)})`, hint ?? message),
|
|
25
|
+
hint: "set shards to a positive integer (default 100)"
|
|
26
|
+
});
|
|
27
|
+
if (shards < nodeCount) throw walrusConfigError("shards", `walrusLocalCluster: shards (${shards}) must be >= nodeCount (${nodeCount})`, `set shards >= ${nodeCount} (default 100)`);
|
|
28
|
+
return {
|
|
29
|
+
name: opts.name ?? "walrus",
|
|
30
|
+
nodeCount,
|
|
31
|
+
shards,
|
|
32
|
+
version: opts.version ?? "testnet-v1.49.1",
|
|
33
|
+
suiVersion: opts.suiVersion ?? "devnet-v1.71.0",
|
|
34
|
+
containerApiPort: opts.containerApiPort ?? 9185,
|
|
35
|
+
epochDuration: opts.epochDuration ?? "24h",
|
|
36
|
+
readyTimeoutMs: opts.readyTimeoutMs ?? 6e4
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
/** Boot the local cluster. Returns the resolved value the plugin
|
|
40
|
+
* projects onto its tags.
|
|
41
|
+
*
|
|
42
|
+
* Steps:
|
|
43
|
+
* - Image build — `resolveCargoImage` (bootstrap asset).
|
|
44
|
+
* Honors `WALRUS_CARGO_IMAGE_OVERRIDE` for the pre-baked path.
|
|
45
|
+
* - Docker network ensure — `runtime.ensureNetwork(walrusNet)`.
|
|
46
|
+
* The sui network is owned by the sui plugin; we attach to it
|
|
47
|
+
* as a secondary network on each storage node.
|
|
48
|
+
* - Deploy contracts — `deployWalrusContracts` dispatches through
|
|
49
|
+
* the artifact publisher primitive; the produce body runs the walrus deploy
|
|
50
|
+
* one-shot.
|
|
51
|
+
* - Storage nodes — parallel boot via `startStorageNodes`.
|
|
52
|
+
* - Proxy URL pick — `nodes[0].rpcUrl`.
|
|
53
|
+
* - WAL faucet strategy — constructed if `state.exchangeObject`
|
|
54
|
+
* exists. Surfaced on the boot result; the barrel registers
|
|
55
|
+
* the contributor decl.
|
|
56
|
+
*
|
|
57
|
+
* Per-step failures surface as `WalrusPluginError` with the phase
|
|
58
|
+
* vocabulary from `errors.ts`; artifact publisher failures pass through as
|
|
59
|
+
* `ArtifactPublishError`. The plugin narration vocabulary anchors
|
|
60
|
+
* on these phase tags.
|
|
61
|
+
*/
|
|
62
|
+
const bootLocalCluster = (deps, opts) => Effect.gen(function* () {
|
|
63
|
+
yield* setCurrentPluginPhase(`resolving Walrus image ${opts.version}`);
|
|
64
|
+
const walrusImage = yield* resolveCargoImage(deps.runtime, {
|
|
65
|
+
walrusRef: opts.version,
|
|
66
|
+
suiVersion: opts.suiVersion
|
|
67
|
+
});
|
|
68
|
+
yield* setCurrentPluginPhase(`ensuring Walrus network ${deps.walrusNetworkName}`);
|
|
69
|
+
yield* deps.runtime.ensureNetwork({
|
|
70
|
+
name: deps.walrusNetworkName,
|
|
71
|
+
app: deps.app,
|
|
72
|
+
stack: deps.stack
|
|
73
|
+
}).pipe(Effect.catch((cause) => Effect.fail(walrusPluginError("cluster-network", `walrus: ensureNetwork('${deps.walrusNetworkName}') failed: ${cause.reason}: ${cause.detail}`, { cause }))));
|
|
74
|
+
const publicHosts = Array.from({ length: opts.nodeCount }, (_, i) => computePublicHostname(deps.app, deps.stack, i)).join(",");
|
|
75
|
+
const listeningIps = Array.from({ length: opts.nodeCount }, (_, i) => `${deps.subnetPrefix}.${10 + i}`).join(",");
|
|
76
|
+
yield* setCurrentPluginPhase(`deploying Walrus contracts (${opts.nodeCount} node${opts.nodeCount === 1 ? "" : "s"}, ${opts.shards} shards)`);
|
|
77
|
+
const { state } = yield* deployWalrusContracts(deps.publisher, deps.probe, deps.runtime, {
|
|
78
|
+
walrusName: opts.name,
|
|
79
|
+
chainId: deps.suiChainId,
|
|
80
|
+
contentHash: contentHash(`walrus|${opts.version}|${opts.suiVersion}|${opts.nodeCount}|${opts.shards}|${opts.epochDuration}`),
|
|
81
|
+
outputDirHostPath: deps.deployHostMountPath,
|
|
82
|
+
suiRpcUrlInNetwork: deps.suiRpcUrlInNetwork,
|
|
83
|
+
walrusFaucetUrlInNetwork: deps.walrusFaucetUrlInNetwork,
|
|
84
|
+
waitForFundsReady: deps.waitForFundsReady,
|
|
85
|
+
committeeSize: opts.nodeCount,
|
|
86
|
+
shards: opts.shards,
|
|
87
|
+
epochDuration: opts.epochDuration,
|
|
88
|
+
publicHostsCsv: publicHosts,
|
|
89
|
+
listeningIpsCsv: listeningIps,
|
|
90
|
+
walrusImage,
|
|
91
|
+
suiNetworkName: deps.suiNetworkName
|
|
92
|
+
});
|
|
93
|
+
const deployConfigHash = [
|
|
94
|
+
"walrus-deploy",
|
|
95
|
+
state.walrusPackageId,
|
|
96
|
+
state.systemObject,
|
|
97
|
+
state.stakingObject,
|
|
98
|
+
state.exchangeObject ?? "no-exchange"
|
|
99
|
+
].join("|");
|
|
100
|
+
yield* setCurrentPluginPhase(`starting ${opts.nodeCount} Walrus storage node${opts.nodeCount === 1 ? "" : "s"}`);
|
|
101
|
+
const { nodes } = yield* startStorageNodes(deps.runtime, {
|
|
102
|
+
app: deps.app,
|
|
103
|
+
stack: deps.stack,
|
|
104
|
+
walrusName: opts.name,
|
|
105
|
+
image: walrusImage,
|
|
106
|
+
nodeCount: opts.nodeCount,
|
|
107
|
+
subnetPrefix: deps.subnetPrefix,
|
|
108
|
+
containerApiPort: opts.containerApiPort,
|
|
109
|
+
walrusNetworkName: deps.walrusNetworkName,
|
|
110
|
+
suiNetworkName: deps.suiNetworkName,
|
|
111
|
+
deployHostMountPath: deps.deployHostMountPath,
|
|
112
|
+
deployConfigHash,
|
|
113
|
+
readyTimeoutMs: opts.readyTimeoutMs
|
|
114
|
+
});
|
|
115
|
+
if (nodes.length === 0) return yield* Effect.fail(walrusPluginError("proxy", "walrus: at least one storage node is required"));
|
|
116
|
+
const proxyUrl = nodes[0].rpcUrl;
|
|
117
|
+
yield* setCurrentPluginPhase("resolving WAL exchange");
|
|
118
|
+
const exchange = yield* resolveWalExchange(deps.probe, state.exchangeObject);
|
|
119
|
+
const walFaucetStrategy = exchange ? makeWalFaucetStrategy({
|
|
120
|
+
exchange,
|
|
121
|
+
sdk: deps.suiSdk
|
|
122
|
+
}) : null;
|
|
123
|
+
const resolvedWalCoinType = yield* resolveWalCoinType({
|
|
124
|
+
probe: deps.probe,
|
|
125
|
+
treasuryObjectId: state.treasuryObject,
|
|
126
|
+
deployPackageId: state.walrusPackageId,
|
|
127
|
+
requireTreasuryObject: exchange !== null
|
|
128
|
+
});
|
|
129
|
+
const resolvedWalPackageId = walPackageIdFromCoinType(resolvedWalCoinType);
|
|
130
|
+
return {
|
|
131
|
+
mode: "local",
|
|
132
|
+
deploy: state,
|
|
133
|
+
walrusPackageId: state.walrusPackageId,
|
|
134
|
+
walPackageId: resolvedWalPackageId,
|
|
135
|
+
nodes,
|
|
136
|
+
aggregatorUrl: proxyUrl,
|
|
137
|
+
publisherUrl: proxyUrl,
|
|
138
|
+
proxyUrl,
|
|
139
|
+
exchangeObjectId: state.exchangeObject,
|
|
140
|
+
exchange,
|
|
141
|
+
walFaucetStrategy,
|
|
142
|
+
walCoinType: resolvedWalCoinType
|
|
143
|
+
};
|
|
144
|
+
}).pipe(Effect.withSpan("devstack.plugin.walrus.localCluster.boot", { attributes: {
|
|
145
|
+
"devstack.plugin": "walrus",
|
|
146
|
+
"walrus.name": opts.name,
|
|
147
|
+
"walrus.nodeCount": opts.nodeCount,
|
|
148
|
+
"walrus.shards": opts.shards
|
|
149
|
+
} }));
|
|
150
|
+
//#endregion
|
|
151
|
+
export { bootLocalCluster, resolveLocalClusterOptions };
|
|
152
|
+
|
|
153
|
+
//# sourceMappingURL=local-cluster.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-cluster.mjs","names":["brandContentHash"],"sources":["../../../../src/plugins/walrus/mode/local-cluster.ts"],"sourcesContent":["// Walrus mode — local cluster.\n//\n// Distilled-doc reference (06-walrus.md §\"Lifecycle: Startup —\n// local cluster\"). Eight ordered phases:\n//\n// 0. Yield deps (Sui, Identity, ChainProbe, faucet strategy opt).\n// 1. Image build — upstream cargo image (bootstrap asset) +\n// wrapper image (inline; content-addressed on\n// the upstream tag + suiVersion).\n// 1b. Docker network create — per-stack `/24` via\n// `Docker.networkCreate(networkName, {subnet})`.\n// 2. Deploy contracts — via `ArtifactPublisher`. The\n// publisher folds chainId into the cache\n// key; verify probes BOTH the on-disk\n// `deploy` file AND on-chain object\n// existence; produce runs the deploy\n// one-shot.\n// 3. Register committee — currently a typed no-op (distilled-doc\n// opportunity #3: drop the cargo-culted\n// placeholder). We omit it entirely in\n// v3 rewrite.\n// 4. Storage nodes — parallel boot of N storage-node containers.\n// 5. Exchange resolution — on-chain getObject + parse type.\n// Degrades to undefined on\n// OBJECT_NOT_FOUND.\n// 6. Proxy URL pick — nodes[0].rpcUrl is the representative\n// aggregator/publisher.\n// 7a. WAL faucet strategy register — opt-in when an exchange exists.\n// 8. Registries — package + endpoint + walrus-state.\n//\n// What this file owns: the dispatch shape + the typed options\n// surface + the synchronous factory-time validation.\n//\n// What this file delegates: container/Move heavy paths live in\n// `storage-nodes.ts`, `deploy.ts`, and the `ArtifactPublisher`\n// primitive.\n\nimport { Effect, FileSystem, Path, type Scope } from 'effect';\n\nimport type {\n\tArtifactPublishError,\n\tArtifactPublisher,\n} from '../../../primitives/artifact-publisher.ts';\nimport type { ChainProbe } from '../../../contracts/chain-probe.ts';\nimport type { ContainerRuntime } from '../../../contracts/container-runtime.ts';\nimport type { SuiProbeKey } from '../../sui/chain-probe.ts';\nimport { contentHash as brandContentHash } from '../../../substrate/brand.ts';\nimport type { ChainId } from '../../../substrate/brand.ts';\nimport { expectPositiveInteger } from '../../../substrate/runtime/config-validation.ts';\nimport { setCurrentPluginPhase } from '../../../substrate/runtime/current-plugin.ts';\nimport { walrusConfigError, walrusPluginError, type WalrusError } from '../errors.ts';\nimport type { WalrusStorageNode } from '../storage-nodes.ts';\nimport {\n\tDEFAULT_NODE_READY_TIMEOUT_MS,\n\tDEFAULT_CONTAINER_API_PORT,\n\tWALRUS_NODE_IP_BASE,\n\tcomputePublicHostname,\n\tstartStorageNodes,\n} from '../storage-nodes.ts';\nimport { deployWalrusContracts, type CachedDeployState } from '../deploy.ts';\nimport {\n\tDEFAULT_SUI_VERSION,\n\tDEFAULT_WALRUS_REF,\n\tresolveCargoImage,\n} from '../bootstrap-assets/cargo-image.ts';\nimport {\n\tmakeWalFaucetStrategy,\n\twalPackageIdFromCoinType,\n\tresolveWalCoinType,\n\ttype WalFaucetStrategy,\n} from '../faucet-strategy.ts';\nimport { resolveWalExchange, type WalExchangeHandle, type WalSwapSdk } from '../wal-swap.ts';\n\n/** Options for the local-cluster mode. Mirrors v3\n * `WalrusLocalClusterOptions<Name>` (06-walrus.md §\"Configuration\"). */\nexport interface WalrusLocalClusterOptions {\n\t/** Engine row name + on-disk dir suffix + registry key.\n\t * Default `'walrus'`. */\n\treadonly name?: string;\n\t/** Number of storage-node containers. Must be `>= 1` (synchronous\n\t * factory-time guard). Default `1`. */\n\treadonly nodeCount?: number;\n\t/** Total shards distributed across the committee. Must be\n\t * `>= nodeCount`. Default `100` (distilled-doc default block). */\n\treadonly shards?: number;\n\t/** Pinned walrus release — drives the wrapper image build.\n\t * Default `'testnet-v1.49.1'`. */\n\treadonly version?: string;\n\t/** Sui release whose binary the wrapper image bakes (distilled-\n\t * doc invariant 24). Default `'devnet-v1.71.0'`. */\n\treadonly suiVersion?: string;\n\t/** Port each storage node binds inside the container. Default\n\t * 9185 (same as the router entrypoint — invariant 9). */\n\treadonly containerApiPort?: number;\n\t/** Walrus epoch length passed to `walrus-deploy --epoch-duration`.\n\t * Default `'24h'`. */\n\treadonly epochDuration?: string;\n\t/** Per-node TCP ready-probe timeout (ms). Defaults to\n\t * `DEFAULT_NODE_READY_TIMEOUT_MS`. */\n\treadonly readyTimeoutMs?: number;\n}\n\n/** Resolved local-cluster boot artifacts. */\nexport interface LocalClusterBootResult {\n\treadonly mode: 'local';\n\treadonly deploy: CachedDeployState;\n\treadonly walrusPackageId: string;\n\treadonly walPackageId: string;\n\treadonly nodes: ReadonlyArray<WalrusStorageNode>;\n\treadonly aggregatorUrl: string;\n\treadonly publisherUrl: string;\n\treadonly proxyUrl: string;\n\treadonly exchangeObjectId: string | undefined;\n\treadonly exchange: WalExchangeHandle | null;\n\t/** WAL faucet strategy — present only when the local cluster has a\n\t * non-empty exchange object. The barrel registers this onto the\n\t * `coinType:<fullCoinType>` strategy contributor decl. `null`\n\t * otherwise. */\n\treadonly walFaucetStrategy: WalFaucetStrategy | null;\n\treadonly walCoinType: string;\n}\n\n/** Defaults applied to options. */\nexport interface ResolvedLocalClusterOptions {\n\treadonly name: string;\n\treadonly nodeCount: number;\n\treadonly shards: number;\n\treadonly version: string;\n\treadonly suiVersion: string;\n\treadonly containerApiPort: number;\n\treadonly epochDuration: string;\n\treadonly readyTimeoutMs: number;\n}\n\n/** Synchronous factory-time validation. Mirrors v3's\n * `local-cluster.ts:101-121` guards. Throws (NOT Effect-fail) so\n * misconfiguration trips at the `defineDevstack` call site rather\n * than at deferred Layer.build time. Distilled-doc invariant 11. */\nexport const resolveLocalClusterOptions = (\n\topts: WalrusLocalClusterOptions,\n): ResolvedLocalClusterOptions => {\n\tconst nodeCount = expectPositiveInteger(opts.nodeCount ?? 1, {\n\t\tfield: 'nodeCount',\n\t\tmkError: ({ field, message, hint }) =>\n\t\t\twalrusConfigError(\n\t\t\t\tfield,\n\t\t\t\t`walrusLocalCluster: nodeCount must be >= 1 (got ${String(opts.nodeCount ?? 1)})`,\n\t\t\t\thint ?? message,\n\t\t\t),\n\t\thint: 'set nodeCount to a positive integer (default 1)',\n\t});\n\tconst shards = expectPositiveInteger(opts.shards ?? 100, {\n\t\tfield: 'shards',\n\t\tmkError: ({ field, message, hint }) =>\n\t\t\twalrusConfigError(\n\t\t\t\tfield,\n\t\t\t\t`walrusLocalCluster: shards must be a positive integer (got ${String(opts.shards ?? 100)})`,\n\t\t\t\thint ?? message,\n\t\t\t),\n\t\thint: 'set shards to a positive integer (default 100)',\n\t});\n\tif (shards < nodeCount) {\n\t\tthrow walrusConfigError(\n\t\t\t'shards',\n\t\t\t`walrusLocalCluster: shards (${shards}) must be >= nodeCount (${nodeCount})`,\n\t\t\t`set shards >= ${nodeCount} (default 100)`,\n\t\t);\n\t}\n\treturn {\n\t\tname: opts.name ?? 'walrus',\n\t\tnodeCount,\n\t\tshards,\n\t\tversion: opts.version ?? DEFAULT_WALRUS_REF,\n\t\tsuiVersion: opts.suiVersion ?? DEFAULT_SUI_VERSION,\n\t\tcontainerApiPort: opts.containerApiPort ?? DEFAULT_CONTAINER_API_PORT,\n\t\tepochDuration: opts.epochDuration ?? '24h',\n\t\treadyTimeoutMs: opts.readyTimeoutMs ?? DEFAULT_NODE_READY_TIMEOUT_MS,\n\t};\n};\n\n/** Dependencies the local service consumes at acquire-time. */\nexport interface LocalClusterDeps {\n\treadonly runtime: ContainerRuntime;\n\treadonly publisher: ArtifactPublisher;\n\treadonly probe: ChainProbe<SuiProbeKey>;\n\treadonly suiSdk: WalSwapSdk;\n\treadonly suiChainId: ChainId;\n\treadonly suiRpcUrlInNetwork: string;\n\treadonly walrusFaucetUrlInNetwork: string;\n\treadonly waitForFundsReady: Effect.Effect<void, unknown>;\n\treadonly app: string;\n\treadonly stack: string;\n\t/** Pre-allocated /24 prefix from `subnetForStack`. */\n\treadonly subnetPrefix: string;\n\treadonly walrusNetworkName: string;\n\treadonly suiNetworkName: string;\n\treadonly deployHostMountPath: string;\n}\n\n/** Boot the local cluster. Returns the resolved value the plugin\n * projects onto its tags.\n *\n * Steps:\n * - Image build — `resolveCargoImage` (bootstrap asset).\n * Honors `WALRUS_CARGO_IMAGE_OVERRIDE` for the pre-baked path.\n * - Docker network ensure — `runtime.ensureNetwork(walrusNet)`.\n * The sui network is owned by the sui plugin; we attach to it\n * as a secondary network on each storage node.\n * - Deploy contracts — `deployWalrusContracts` dispatches through\n * the artifact publisher primitive; the produce body runs the walrus deploy\n * one-shot.\n * - Storage nodes — parallel boot via `startStorageNodes`.\n * - Proxy URL pick — `nodes[0].rpcUrl`.\n * - WAL faucet strategy — constructed if `state.exchangeObject`\n * exists. Surfaced on the boot result; the barrel registers\n * the contributor decl.\n *\n * Per-step failures surface as `WalrusPluginError` with the phase\n * vocabulary from `errors.ts`; artifact publisher failures pass through as\n * `ArtifactPublishError`. The plugin narration vocabulary anchors\n * on these phase tags.\n */\nexport const bootLocalCluster = (\n\tdeps: LocalClusterDeps,\n\topts: ResolvedLocalClusterOptions,\n): Effect.Effect<\n\tLocalClusterBootResult,\n\tWalrusError | ArtifactPublishError,\n\tScope.Scope | FileSystem.FileSystem | Path.Path\n> =>\n\tEffect.gen(function* () {\n\t\t// ---- cargo image (bootstrap asset) -----------------------\n\t\t// The cargo image is content-addressed; the resolver owns the\n\t\t// cache check + the registry-tag override fast path.\n\t\tyield* setCurrentPluginPhase(`resolving Walrus image ${opts.version}`);\n\t\tconst walrusImage = yield* resolveCargoImage(deps.runtime, {\n\t\t\twalrusRef: opts.version,\n\t\t\tsuiVersion: opts.suiVersion,\n\t\t});\n\n\t\t// ---- docker network ensure ------------------------------\n\t\tyield* setCurrentPluginPhase(`ensuring Walrus network ${deps.walrusNetworkName}`);\n\t\tyield* deps.runtime\n\t\t\t.ensureNetwork({\n\t\t\t\tname: deps.walrusNetworkName,\n\t\t\t\tapp: deps.app,\n\t\t\t\tstack: deps.stack,\n\t\t\t})\n\t\t\t.pipe(\n\t\t\t\tEffect.catch((cause) =>\n\t\t\t\t\tEffect.fail(\n\t\t\t\t\t\twalrusPluginError(\n\t\t\t\t\t\t\t'cluster-network',\n\t\t\t\t\t\t\t`walrus: ensureNetwork('${deps.walrusNetworkName}') failed: ${cause.reason}: ${cause.detail}`,\n\t\t\t\t\t\t\t{ cause },\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\n\t\t// ---- deploy via ArtifactPublisher ----------------\n\t\t// The deploy one-shot needs the walrus image + sui network so it\n\t\t// can dial the per-stack sui RPC + faucet over docker DNS.\n\t\t//\n\t\t// Per-node IP CSV is derived from the subnet prefix; per-node\n\t\t// hostnames likewise. Both must be in lockstep with the\n\t\t// storage-node boot below — the deploy step writes per-node\n\t\t// committee records on chain using these.\n\t\tconst publicHosts = Array.from({ length: opts.nodeCount }, (_, i) =>\n\t\t\tcomputePublicHostname(deps.app, deps.stack, i),\n\t\t).join(',');\n\t\tconst listeningIps = Array.from(\n\t\t\t{ length: opts.nodeCount },\n\t\t\t(_, i) => `${deps.subnetPrefix}.${WALRUS_NODE_IP_BASE + i}`,\n\t\t).join(',');\n\n\t\tyield* setCurrentPluginPhase(\n\t\t\t`deploying Walrus contracts (${opts.nodeCount} node${opts.nodeCount === 1 ? '' : 's'}, ${opts.shards} shards)`,\n\t\t);\n\t\tconst { state } = yield* deployWalrusContracts(deps.publisher, deps.probe, deps.runtime, {\n\t\t\twalrusName: opts.name,\n\t\t\tchainId: deps.suiChainId,\n\t\t\tcontentHash: brandContentHash(\n\t\t\t\t`walrus|${opts.version}|${opts.suiVersion}|${opts.nodeCount}|${opts.shards}|${opts.epochDuration}`,\n\t\t\t),\n\t\t\toutputDirHostPath: deps.deployHostMountPath,\n\t\t\tsuiRpcUrlInNetwork: deps.suiRpcUrlInNetwork,\n\t\t\twalrusFaucetUrlInNetwork: deps.walrusFaucetUrlInNetwork,\n\t\t\twaitForFundsReady: deps.waitForFundsReady,\n\t\t\tcommitteeSize: opts.nodeCount,\n\t\t\tshards: opts.shards,\n\t\t\tepochDuration: opts.epochDuration,\n\t\t\tpublicHostsCsv: publicHosts,\n\t\t\tlisteningIpsCsv: listeningIps,\n\t\t\twalrusImage,\n\t\t\tsuiNetworkName: deps.suiNetworkName,\n\t\t});\n\t\tconst deployConfigHash = [\n\t\t\t'walrus-deploy',\n\t\t\tstate.walrusPackageId,\n\t\t\tstate.systemObject,\n\t\t\tstate.stakingObject,\n\t\t\tstate.exchangeObject ?? 'no-exchange',\n\t\t].join('|');\n\n\t\t// ---- storage nodes — parallel boot ----------------------\n\t\tyield* setCurrentPluginPhase(\n\t\t\t`starting ${opts.nodeCount} Walrus storage node${opts.nodeCount === 1 ? '' : 's'}`,\n\t\t);\n\t\tconst { nodes } = yield* startStorageNodes(deps.runtime, {\n\t\t\tapp: deps.app,\n\t\t\tstack: deps.stack,\n\t\t\twalrusName: opts.name,\n\t\t\timage: walrusImage,\n\t\t\tnodeCount: opts.nodeCount,\n\t\t\tsubnetPrefix: deps.subnetPrefix,\n\t\t\tcontainerApiPort: opts.containerApiPort,\n\t\t\twalrusNetworkName: deps.walrusNetworkName,\n\t\t\tsuiNetworkName: deps.suiNetworkName,\n\t\t\tdeployHostMountPath: deps.deployHostMountPath,\n\t\t\tdeployConfigHash,\n\t\t\treadyTimeoutMs: opts.readyTimeoutMs,\n\t\t});\n\n\t\t// ---- proxy URL pick — nodes[0].rpcUrl -------------------\n\t\t// `nodeCount >= 1` is enforced synchronously already; this is\n\t\t// defense-in-depth.\n\t\tif (nodes.length === 0) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\twalrusPluginError('proxy', 'walrus: at least one storage node is required'),\n\t\t\t);\n\t\t}\n\t\tconst proxyUrl = nodes[0]!.rpcUrl;\n\n\t\t// ---- exchange resolution + WAL funding strategy ------\n\t\t// Register a `coinType:<fullCoinType>` strategy that swaps the\n\t\t// requesting account's SUI into WAL on demand. Accounts opt in via\n\t\t// their normal `funding` list.\n\t\tyield* setCurrentPluginPhase('resolving WAL exchange');\n\t\tconst exchange = yield* resolveWalExchange(deps.probe, state.exchangeObject);\n\t\tconst walFaucetStrategy: WalFaucetStrategy | null = exchange\n\t\t\t? makeWalFaucetStrategy({\n\t\t\t\t\texchange,\n\t\t\t\t\tsdk: deps.suiSdk,\n\t\t\t\t})\n\t\t\t: null;\n\t\tconst resolvedWalCoinType = yield* resolveWalCoinType({\n\t\t\tprobe: deps.probe,\n\t\t\ttreasuryObjectId: state.treasuryObject,\n\t\t\tdeployPackageId: state.walrusPackageId,\n\t\t\trequireTreasuryObject: exchange !== null,\n\t\t});\n\t\tconst resolvedWalPackageId = walPackageIdFromCoinType(resolvedWalCoinType);\n\n\t\treturn {\n\t\t\tmode: 'local' as const,\n\t\t\tdeploy: state,\n\t\t\twalrusPackageId: state.walrusPackageId,\n\t\t\twalPackageId: resolvedWalPackageId,\n\t\t\tnodes,\n\t\t\taggregatorUrl: proxyUrl,\n\t\t\tpublisherUrl: proxyUrl,\n\t\t\tproxyUrl,\n\t\t\texchangeObjectId: state.exchangeObject,\n\t\t\texchange,\n\t\t\twalFaucetStrategy,\n\t\t\twalCoinType: resolvedWalCoinType,\n\t\t};\n\t}).pipe(\n\t\tEffect.withSpan('devstack.plugin.walrus.localCluster.boot', {\n\t\t\tattributes: {\n\t\t\t\t'devstack.plugin': 'walrus',\n\t\t\t\t'walrus.name': opts.name,\n\t\t\t\t'walrus.nodeCount': opts.nodeCount,\n\t\t\t\t'walrus.shards': opts.shards,\n\t\t\t},\n\t\t}),\n\t);\n"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-key.mjs","names":[],"sources":["../../../src/plugins/walrus/plugin-key.ts"],"sourcesContent":["import { pluginKey, type PluginKey } from '../../substrate/brand.ts';\n\nexport const walrusPluginKey = (name: string): PluginKey => pluginKey(`walrus:${name}`);\n"],"mappings":";;AAEA,MAAa,mBAAmB,SAA4B,UAAU,UAAU,OAAO"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region src/plugins/walrus/registry-publish.d.ts
|
|
2
|
+
/** Local-cluster's state registry entry. The `name` field is the
|
|
3
|
+
* factory's `name` option (default: `'walrus'`); two walrus
|
|
4
|
+
* instances in one stack publish under disjoint names. */
|
|
5
|
+
interface WalrusLocalStateEntry {
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly systemObjectId: string;
|
|
8
|
+
readonly stakingObjectId: string;
|
|
9
|
+
readonly walrusPackageId: string;
|
|
10
|
+
readonly exchangeObjectId?: string;
|
|
11
|
+
}
|
|
12
|
+
/** Known-deployment's state registry entry. The `name` is always
|
|
13
|
+
* `'walrusKnownDeployment'` (distilled-doc invariant: this factory
|
|
14
|
+
* does not vary by user-supplied name). */
|
|
15
|
+
interface WalrusKnownStateEntry {
|
|
16
|
+
readonly name: 'walrusKnownDeployment';
|
|
17
|
+
readonly systemObjectId: string;
|
|
18
|
+
readonly stakingObjectId: string;
|
|
19
|
+
readonly chain: string;
|
|
20
|
+
}
|
|
21
|
+
type WalrusStateEntry = WalrusLocalStateEntry | WalrusKnownStateEntry;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { WalrusKnownStateEntry, WalrusLocalStateEntry, WalrusStateEntry };
|
|
24
|
+
//# sourceMappingURL=registry-publish.d.mts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/plugins/walrus/registry-publish.ts
|
|
2
|
+
/** Capability-key constant for the per-stack Walrus state registry. */
|
|
3
|
+
const WALRUS_STATE_REGISTRY_KEY = "walrus-state-registry";
|
|
4
|
+
//#endregion
|
|
5
|
+
export { WALRUS_STATE_REGISTRY_KEY };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=registry-publish.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry-publish.mjs","names":[],"sources":["../../../src/plugins/walrus/registry-publish.ts"],"sourcesContent":["// Walrus registry publish — mode-based registry contribution shapes.\n//\n// This file is the runtime publishing layer for the downstream registries:\n//\n// - WalrusStateRegistry — `{name, systemObjectId}` entry. Local\n// uses `opts.name`; known uses the fixed\n// `'walrusKnownDeployment'`.\n// - EndpointRegistry — local publishes `walrus-aggregator` +\n// `walrus-publisher` + N × `walrus-node-<i>`.\n// Known publishes nothing (the URLs ride\n// on the WalrusResolved value).\n// - PackageRegistry — local only: `walrus.<name>` entry.\n//\n// Following the package plugin's pattern, contributions land via\n// `StrategyContributor` capability keys; the orchestrator dispatches\n// by key. This file declares the *contribution shapes*; the actual\n// `Register` closures live with the local-cluster acquire path where the resolved\n// values are bound.\n\n/** Capability-key constant for the per-stack Walrus state registry. */\nexport const WALRUS_STATE_REGISTRY_KEY = 'walrus-state-registry' as const;\n\n/** Capability-key constant for the per-stack endpoint registry —\n * shared across plugins (matches faucet/coin/etc.). */\nexport const ENDPOINT_REGISTRY_KEY = 'endpoint-registry' as const;\n\n/** Capability-key constant for the per-stack package registry —\n * mirrors `plugins/package/registry.ts`'s\n * `PACKAGE_REGISTRY_CAPABILITY_KEY` but typed independently here so\n * Walrus doesn't take a direct dep on the package plugin's internals.\n * Same string value — substrate dispatches by string equality. */\nexport const PACKAGE_REGISTRY_KEY = 'package-registry' as const;\n\n/** Local-cluster's state registry entry. The `name` field is the\n * factory's `name` option (default: `'walrus'`); two walrus\n * instances in one stack publish under disjoint names. */\nexport interface WalrusLocalStateEntry {\n\treadonly name: string;\n\treadonly systemObjectId: string;\n\treadonly stakingObjectId: string;\n\treadonly walrusPackageId: string;\n\treadonly exchangeObjectId?: string;\n}\n\n/** Known-deployment's state registry entry. The `name` is always\n * `'walrusKnownDeployment'` (distilled-doc invariant: this factory\n * does not vary by user-supplied name). */\nexport interface WalrusKnownStateEntry {\n\treadonly name: 'walrusKnownDeployment';\n\treadonly systemObjectId: string;\n\treadonly stakingObjectId: string;\n\treadonly chain: string;\n}\n\nexport type WalrusStateEntry = WalrusLocalStateEntry | WalrusKnownStateEntry;\n\n/** Endpoint contribution shape — what the local-cluster publishes\n * to the endpoint registry. Mirrors the v3 surface:\n * `walrus-aggregator` + `walrus-publisher` (1 each) +\n * `walrus-node-<i>` (N). */\nexport interface WalrusEndpointEntry {\n\treadonly name: string;\n\treadonly url: string;\n\treadonly kind: 'http' | 'walrus-node';\n}\n\n/** Package contribution — local-cluster publishes one entry under\n * `walrus.<name>` with `mvrPlaceholder: '@local/walrus'`.\n * (Distilled-doc §\"Registry writes\" + Invariant 6: registers fire\n * on EVERY cycle.) */\nexport interface WalrusPackageEntry {\n\treadonly name: string;\n\treadonly packageId: string;\n\treadonly mvrPlaceholder: string;\n\treadonly captured: Readonly<{\n\t\treadonly systemObject: string;\n\t\treadonly stakingObject: string;\n\t\treadonly exchangeObject?: string;\n\t}>;\n}\n"],"mappings":";;AAoBA,MAAa,4BAA4B"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import "./storage-nodes.mjs";
|
|
2
|
+
//#region src/plugins/walrus/routable.ts
|
|
3
|
+
const WALRUS_ENTRYPOINT_PORT = 9185;
|
|
4
|
+
const WALRUS_NODE_ENDPOINT_PREFIX = "walrus-node-";
|
|
5
|
+
const WALRUS_AGGREGATOR_ENDPOINT_NAME = "walrus-aggregator";
|
|
6
|
+
const WALRUS_PUBLISHER_ENDPOINT_NAME = "walrus-publisher";
|
|
7
|
+
const WALRUS_ENTRYPOINTS = [
|
|
8
|
+
{
|
|
9
|
+
name: "walrus-node-0",
|
|
10
|
+
port: WALRUS_ENTRYPOINT_PORT,
|
|
11
|
+
protocol: "http"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: "walrus-node-1",
|
|
15
|
+
port: WALRUS_ENTRYPOINT_PORT,
|
|
16
|
+
protocol: "http"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "walrus-node-2",
|
|
20
|
+
port: WALRUS_ENTRYPOINT_PORT,
|
|
21
|
+
protocol: "http"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "walrus-node-3",
|
|
25
|
+
port: WALRUS_ENTRYPOINT_PORT,
|
|
26
|
+
protocol: "http"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: WALRUS_AGGREGATOR_ENDPOINT_NAME,
|
|
30
|
+
port: WALRUS_ENTRYPOINT_PORT,
|
|
31
|
+
protocol: "http"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: WALRUS_PUBLISHER_ENDPOINT_NAME,
|
|
35
|
+
port: WALRUS_ENTRYPOINT_PORT,
|
|
36
|
+
protocol: "http"
|
|
37
|
+
}
|
|
38
|
+
];
|
|
39
|
+
/** Build the Routable contributions for the local cluster. `nodeCount`
|
|
40
|
+
* drives the per-node fan-out; the plugin's service key + route role
|
|
41
|
+
* identify the dispatch target. */
|
|
42
|
+
const makeLocalRoutables = (args) => {
|
|
43
|
+
const containerPort = args.containerApiPort ?? 9185;
|
|
44
|
+
const containerNameFor = (i) => `devstack-${args.app}-${args.stack}-walrus-${args.walrusName}-node-${i}`;
|
|
45
|
+
const perNodeRoutes = Array.from({ length: args.nodeCount }, (_, i) => ({
|
|
46
|
+
kind: "routable",
|
|
47
|
+
endpointName: `${WALRUS_NODE_ENDPOINT_PREFIX}${i}`,
|
|
48
|
+
dispatchId: {
|
|
49
|
+
serviceKey: args.serviceKey,
|
|
50
|
+
role: `${WALRUS_NODE_ENDPOINT_PREFIX}${i}`
|
|
51
|
+
},
|
|
52
|
+
upstream: {
|
|
53
|
+
type: "container",
|
|
54
|
+
containerName: containerNameFor(i),
|
|
55
|
+
containerPort
|
|
56
|
+
},
|
|
57
|
+
cors: true,
|
|
58
|
+
wireProtocol: "http"
|
|
59
|
+
}));
|
|
60
|
+
const aggregator = {
|
|
61
|
+
kind: "routable",
|
|
62
|
+
endpointName: WALRUS_AGGREGATOR_ENDPOINT_NAME,
|
|
63
|
+
dispatchId: {
|
|
64
|
+
serviceKey: args.serviceKey,
|
|
65
|
+
role: WALRUS_AGGREGATOR_ENDPOINT_NAME
|
|
66
|
+
},
|
|
67
|
+
upstream: {
|
|
68
|
+
type: "container",
|
|
69
|
+
containerName: containerNameFor(0),
|
|
70
|
+
containerPort
|
|
71
|
+
},
|
|
72
|
+
cors: true,
|
|
73
|
+
wireProtocol: "http"
|
|
74
|
+
};
|
|
75
|
+
const publisher = {
|
|
76
|
+
kind: "routable",
|
|
77
|
+
endpointName: WALRUS_PUBLISHER_ENDPOINT_NAME,
|
|
78
|
+
dispatchId: {
|
|
79
|
+
serviceKey: args.serviceKey,
|
|
80
|
+
role: WALRUS_PUBLISHER_ENDPOINT_NAME
|
|
81
|
+
},
|
|
82
|
+
upstream: {
|
|
83
|
+
type: "container",
|
|
84
|
+
containerName: containerNameFor(0),
|
|
85
|
+
containerPort
|
|
86
|
+
},
|
|
87
|
+
cors: true,
|
|
88
|
+
wireProtocol: "http"
|
|
89
|
+
};
|
|
90
|
+
return [
|
|
91
|
+
...perNodeRoutes,
|
|
92
|
+
aggregator,
|
|
93
|
+
publisher
|
|
94
|
+
];
|
|
95
|
+
};
|
|
96
|
+
//#endregion
|
|
97
|
+
export { WALRUS_ENTRYPOINTS, makeLocalRoutables };
|
|
98
|
+
|
|
99
|
+
//# sourceMappingURL=routable.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routable.mjs","names":[],"sources":["../../../src/plugins/walrus/routable.ts"],"sourcesContent":["// Walrus plugin — Routable contributions.\n//\n// Distilled-doc reference (06-walrus.md §\"Routes registered\"):\n// each storage node carries one Traefik route. The router binds host\n// port 9185 once globally and dispatches by `Host:` header to the\n// per-stack backend — `routerHostname(identity, 'walrus-node-<i>')`.\n//\n// For the local cluster:\n// - N × `walrus-node-<i>` routes — one per storage node, with\n// `cors: true` (walrus storage REST API lacks CORS headers).\n// - 1 × `walrus-aggregator` alias — same backend as `walrus-node-0`,\n// surfaces the conventional alias for SDK consumers.\n// - 1 × `walrus-publisher` alias — collapsed onto the same backend\n// (distilled-doc §\"Endpoints\" — \"collapsed onto a single Traefik\n// vhost\").\n//\n// Known-deployment publishes no routes — the aggregator/publisher\n// URLs land on the codegen-emitted `WalrusBindings.{aggregator,\n// publisher}Url` instead.\n\nimport type { EntrypointDecl, RoutableDecl } from '../../contracts/routable.ts';\nimport { WALRUS_ROUTER_PORT } from './storage-nodes.ts';\n\nexport const WALRUS_ENTRYPOINT_PORT = 9185;\nexport const WALRUS_NODE_ENDPOINT_PREFIX = 'walrus-node-' as const;\nexport const WALRUS_AGGREGATOR_ENDPOINT_NAME = 'walrus-aggregator' as const;\nexport const WALRUS_PUBLISHER_ENDPOINT_NAME = 'walrus-publisher' as const;\n\nexport const WALRUS_ENTRYPOINTS: ReadonlyArray<EntrypointDecl> = [\n\t{ name: 'walrus-node-0', port: WALRUS_ENTRYPOINT_PORT, protocol: 'http' },\n\t{ name: 'walrus-node-1', port: WALRUS_ENTRYPOINT_PORT, protocol: 'http' },\n\t{ name: 'walrus-node-2', port: WALRUS_ENTRYPOINT_PORT, protocol: 'http' },\n\t{ name: 'walrus-node-3', port: WALRUS_ENTRYPOINT_PORT, protocol: 'http' },\n\t{ name: WALRUS_AGGREGATOR_ENDPOINT_NAME, port: WALRUS_ENTRYPOINT_PORT, protocol: 'http' },\n\t{ name: WALRUS_PUBLISHER_ENDPOINT_NAME, port: WALRUS_ENTRYPOINT_PORT, protocol: 'http' },\n];\n\n/** Build the Routable contributions for the local cluster. `nodeCount`\n * drives the per-node fan-out; the plugin's service key + route role\n * identify the dispatch target. */\nexport const makeLocalRoutables = (args: {\n\treadonly app: string;\n\treadonly stack: string;\n\treadonly walrusName: string;\n\treadonly serviceKey: string;\n\treadonly nodeCount: number;\n\treadonly containerApiPort?: number;\n}): ReadonlyArray<RoutableDecl> => {\n\tconst containerPort = args.containerApiPort ?? WALRUS_ROUTER_PORT;\n\tconst containerNameFor = (i: number): string =>\n\t\t`devstack-${args.app}-${args.stack}-walrus-${args.walrusName}-node-${i}`;\n\tconst perNodeRoutes: ReadonlyArray<RoutableDecl> = Array.from(\n\t\t{ length: args.nodeCount },\n\t\t(_, i): RoutableDecl => ({\n\t\t\tkind: 'routable',\n\t\t\tendpointName: `${WALRUS_NODE_ENDPOINT_PREFIX}${i}`,\n\t\t\tdispatchId: {\n\t\t\t\tserviceKey: args.serviceKey,\n\t\t\t\trole: `${WALRUS_NODE_ENDPOINT_PREFIX}${i}`,\n\t\t\t},\n\t\t\tupstream: {\n\t\t\t\ttype: 'container',\n\t\t\t\tcontainerName: containerNameFor(i),\n\t\t\t\tcontainerPort,\n\t\t\t},\n\t\t\t// Distilled-doc §\"Routes registered\": cors: true (walrus\n\t\t\t// storage REST API lacks CORS headers).\n\t\t\tcors: true,\n\t\t\twireProtocol: 'http',\n\t\t}),\n\t);\n\n\t// Aggregator + publisher aliases — collapsed onto node-0 per the\n\t// distilled doc. The aggregator and publisher are conventional\n\t// endpoint names that downstream HTTP consumers look up via the\n\t// substrate's endpoint registry.\n\tconst aggregator: RoutableDecl = {\n\t\tkind: 'routable',\n\t\tendpointName: WALRUS_AGGREGATOR_ENDPOINT_NAME,\n\t\tdispatchId: {\n\t\t\tserviceKey: args.serviceKey,\n\t\t\trole: WALRUS_AGGREGATOR_ENDPOINT_NAME,\n\t\t},\n\t\tupstream: { type: 'container', containerName: containerNameFor(0), containerPort },\n\t\tcors: true,\n\t\twireProtocol: 'http',\n\t};\n\tconst publisher: RoutableDecl = {\n\t\tkind: 'routable',\n\t\tendpointName: WALRUS_PUBLISHER_ENDPOINT_NAME,\n\t\tdispatchId: {\n\t\t\tserviceKey: args.serviceKey,\n\t\t\trole: WALRUS_PUBLISHER_ENDPOINT_NAME,\n\t\t},\n\t\tupstream: { type: 'container', containerName: containerNameFor(0), containerPort },\n\t\tcors: true,\n\t\twireProtocol: 'http',\n\t};\n\n\treturn [...perNodeRoutes, aggregator, publisher];\n};\n"],"mappings":";;AAuBA,MAAa,yBAAyB;AACtC,MAAa,8BAA8B;AAC3C,MAAa,kCAAkC;AAC/C,MAAa,iCAAiC;AAE9C,MAAa,qBAAoD;CAChE;EAAE,MAAM;EAAiB,MAAM;EAAwB,UAAU;EAAQ;CACzE;EAAE,MAAM;EAAiB,MAAM;EAAwB,UAAU;EAAQ;CACzE;EAAE,MAAM;EAAiB,MAAM;EAAwB,UAAU;EAAQ;CACzE;EAAE,MAAM;EAAiB,MAAM;EAAwB,UAAU;EAAQ;CACzE;EAAE,MAAM;EAAiC,MAAM;EAAwB,UAAU;EAAQ;CACzF;EAAE,MAAM;EAAgC,MAAM;EAAwB,UAAU;EAAQ;CACxF;;;;AAKD,MAAa,sBAAsB,SAOA;CAClC,MAAM,gBAAgB,KAAK,oBAAA;CAC3B,MAAM,oBAAoB,MACzB,YAAY,KAAK,IAAI,GAAG,KAAK,MAAM,UAAU,KAAK,WAAW,QAAQ;CACtE,MAAM,gBAA6C,MAAM,KACxD,EAAE,QAAQ,KAAK,WAAW,GACzB,GAAG,OAAqB;EACxB,MAAM;EACN,cAAc,GAAG,8BAA8B;EAC/C,YAAY;GACX,YAAY,KAAK;GACjB,MAAM,GAAG,8BAA8B;GACvC;EACD,UAAU;GACT,MAAM;GACN,eAAe,iBAAiB,EAAE;GAClC;GACA;EAGD,MAAM;EACN,cAAc;EACd,EACD;CAMD,MAAM,aAA2B;EAChC,MAAM;EACN,cAAc;EACd,YAAY;GACX,YAAY,KAAK;GACjB,MAAM;GACN;EACD,UAAU;GAAE,MAAM;GAAa,eAAe,iBAAiB,EAAE;GAAE;GAAe;EAClF,MAAM;EACN,cAAc;EACd;CACD,MAAM,YAA0B;EAC/B,MAAM;EACN,cAAc;EACd,YAAY;GACX,YAAY,KAAK;GACjB,MAAM;GACN;EACD,UAAU;GAAE,MAAM;GAAa,eAAe,iBAAiB,EAAE;GAAE;GAAe;EAClF,MAAM;EACN,cAAc;EACd;AAED,QAAO;EAAC,GAAG;EAAe;EAAY;EAAU"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { bootKnownDeployment } from "./mode/known-deploy.mjs";
|
|
2
|
+
import { bootLocalCluster } from "./mode/local-cluster.mjs";
|
|
3
|
+
import "effect";
|
|
4
|
+
//#region src/plugins/walrus/service.ts
|
|
5
|
+
/** Dispatch on the mode and return the boot artifacts.
|
|
6
|
+
*
|
|
7
|
+
* `deps` is the local-cluster's full dependency bundle. The known
|
|
8
|
+
* branch ignores all of it (no I/O at acquire time — purely
|
|
9
|
+
* synchronous projection from options); the type lets the barrel
|
|
10
|
+
* pass one record for both paths. */
|
|
11
|
+
const bootWalrusService = (deps, mode) => {
|
|
12
|
+
switch (mode.mode) {
|
|
13
|
+
case "local": return bootLocalCluster(deps, mode.opts);
|
|
14
|
+
case "known": return bootKnownDeployment(mode.opts);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { bootWalrusService };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=service.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.mjs","names":[],"sources":["../../../src/plugins/walrus/service.ts"],"sourcesContent":["// Walrus plugin — main acquire body. Mode dispatch.\n//\n// Distilled-doc reference (06-walrus.md §\"Modes & variants\" — four\n// distinct operating modes):\n//\n// - local — `walrusLocalCluster(...)`\n// - live (testnet/mainnet) — `walrusKnownDeployment(...)`\n// - fork-known (`*-fork`) — known-deployment wrapper for the\n// wrapped upstream\n// - fork-localcluster-refused — synchronous refusal at factory\n// time\n//\n// Architecture: Walrus is ONE plugin with internal mode dispatch.\n// The factory at the barrel (`index.ts`) constructs the discriminator\n// from typed options; this file dispatches on the discriminator and\n// assembles mode-appropriate\n// subsystems.\n//\n// What this file does:\n//\n// 1. Receive a resolved mode discriminator.\n// 2. Dispatch to the right `boot*` builder.\n// 3. Return the mode's boot artifacts (the barrel projects them\n// onto the plugin's resolved value).\n//\n// What it does NOT do:\n//\n// - Provision the container runtime — that arrives via the\n// `BuildContext` passed by the barrel.\n// - Resolve bootstrap assets — local-cluster mode owns those\n// resolvers; this file just dispatches.\n\nimport { Effect, FileSystem, Path, type Scope } from 'effect';\n\nimport type { ArtifactPublishError } from '../../primitives/artifact-publisher.ts';\nimport type { WalrusError } from './errors.ts';\nimport {\n\tbootKnownDeployment,\n\ttype KnownDeploymentBootResult,\n\ttype WalrusKnownDeploymentOptions,\n} from './mode/known-deploy.ts';\nimport {\n\tbootLocalCluster,\n\ttype LocalClusterBootResult,\n\ttype LocalClusterDeps,\n\ttype ResolvedLocalClusterOptions,\n} from './mode/local-cluster.ts';\nimport { refuseLocalClusterOnFork } from './mode/fork-refusal.ts';\n\n/** Mode discriminator. Internal — the barrel constructs ONE of these\n * per composed walrus instance and dispatches here. */\nexport type WalrusMode =\n\t| { readonly mode: 'local'; readonly opts: ResolvedLocalClusterOptions }\n\t| { readonly mode: 'known'; readonly opts: WalrusKnownDeploymentOptions };\n\n/** Result of one acquire — discriminated by mode so the barrel can\n * project mode-asymmetrically onto the tag set. */\nexport type WalrusBootResult = LocalClusterBootResult | KnownDeploymentBootResult;\n\n/** Dispatch on the mode and return the boot artifacts.\n *\n * `deps` is the local-cluster's full dependency bundle. The known\n * branch ignores all of it (no I/O at acquire time — purely\n * synchronous projection from options); the type lets the barrel\n * pass one record for both paths. */\nexport const bootWalrusService = (\n\tdeps: LocalClusterDeps,\n\tmode: WalrusMode,\n): Effect.Effect<\n\tWalrusBootResult,\n\tWalrusError | ArtifactPublishError,\n\tScope.Scope | FileSystem.FileSystem | Path.Path\n> => {\n\tswitch (mode.mode) {\n\t\tcase 'local':\n\t\t\treturn bootLocalCluster(deps, mode.opts);\n\t\tcase 'known':\n\t\t\treturn bootKnownDeployment(mode.opts);\n\t}\n};\n\n// Re-export so callers (the barrel's `walrus()` factory's fork\n// branch) can invoke the refusal directly without an extra import.\nexport { refuseLocalClusterOnFork };\n"],"mappings":";;;;;;;;;;AAiEA,MAAa,qBACZ,MACA,SAKI;AACJ,SAAQ,KAAK,MAAb;EACC,KAAK,QACJ,QAAO,iBAAiB,MAAM,KAAK,KAAK;EACzC,KAAK,QACJ,QAAO,oBAAoB,KAAK,KAAK"}
|