@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,293 @@
|
|
|
1
|
+
import { renderUrl, routerHostname } from "../../../orchestrators/router/hostname.mjs";
|
|
2
|
+
import { suiPluginError } from "../errors.mjs";
|
|
3
|
+
import { waitForHttpEndpoint } from "../../../substrate/runtime/http-probe.mjs";
|
|
4
|
+
import { toDockerHostGatewayUrl } from "./shared.mjs";
|
|
5
|
+
import { assembleSuiClient, buildWaitForTransactionsReady, fetchChainId, makeResolvedNetwork } from "./shared-boot.mjs";
|
|
6
|
+
import { ensureManagedContainer } from "../../../substrate/runtime/managed-container.mjs";
|
|
7
|
+
import { noopClockAdvancer } from "../auto-tick.mjs";
|
|
8
|
+
import { SUI_FAUCET_ENDPOINT_NAME, SUI_FAUCET_ENTRYPOINT_PORT, SUI_GRAPHQL_ENDPOINT_NAME, SUI_GRAPHQL_ENTRYPOINT_PORT, SUI_RPC_ENTRYPOINT_PORT } from "../routable.mjs";
|
|
9
|
+
import { DEFAULT_SUI_CLI_VERSION, suiCliImageBuildContext } from "../../../substrate/runtime/sui-move-build/index.mjs";
|
|
10
|
+
import { setCurrentPluginPhase } from "../../../substrate/runtime/current-plugin.mjs";
|
|
11
|
+
import { Duration, Effect } from "effect";
|
|
12
|
+
import { SuiGrpcClient } from "@mysten/sui/grpc";
|
|
13
|
+
//#region src/plugins/sui/mode/local.ts
|
|
14
|
+
/** Default ready-probe timeout for localnet. The validator's cold
|
|
15
|
+
* start runs genesis + faucet bootstrap; 60 s is the documented
|
|
16
|
+
* ceiling. */
|
|
17
|
+
const DEFAULT_LOCAL_READY_TIMEOUT = Duration.seconds(60);
|
|
18
|
+
/** Default sui validator binary version pinned by the vendored
|
|
19
|
+
* `images/sui/` Dockerfile. The build arg `SUI_VERSION` is threaded
|
|
20
|
+
* through to the release-tarball URL. Bump in lockstep with matching
|
|
21
|
+
* Walrus / Seal versions (else the Move package ABIs drift). */
|
|
22
|
+
const DEFAULT_SUI_VERSION = DEFAULT_SUI_CLI_VERSION;
|
|
23
|
+
const CONTAINER_RPC_PORT = SUI_RPC_ENTRYPOINT_PORT;
|
|
24
|
+
const CONTAINER_FAUCET_PORT = SUI_FAUCET_ENTRYPOINT_PORT;
|
|
25
|
+
const CONTAINER_GRAPHQL_PORT = SUI_GRAPHQL_ENTRYPOINT_PORT;
|
|
26
|
+
const DEFAULT_HOST_RPC_PORT = 51e3;
|
|
27
|
+
const DEFAULT_HOST_FAUCET_PORT = 5e4;
|
|
28
|
+
const DEFAULT_HOST_GRAPHQL_PORT = 51001;
|
|
29
|
+
const DOCKER_PUBLISH_HOST = "0.0.0.0";
|
|
30
|
+
/** Per-fetch deadline for the ready-probe HTTP calls. Without it a
|
|
31
|
+
* hung fetch would block the outer ready deadline with no signal
|
|
32
|
+
* about which probe wedged. */
|
|
33
|
+
const PROBE_FETCH_TIMEOUT_MS = 3e3;
|
|
34
|
+
/**
|
|
35
|
+
* Build the local-mode boot Effect.
|
|
36
|
+
*
|
|
37
|
+
* `identity` is threaded in by the caller (the plugin barrel's acquire
|
|
38
|
+
* body, which has access to the substrate's `IdentityContext` via the
|
|
39
|
+
* outer composition layer); the body uses it to stamp the canonical
|
|
40
|
+
* container label tuple so sweep / inventory are name-blind.
|
|
41
|
+
*
|
|
42
|
+
* `{pull}`, `{build}`, and vendored-build image branches are wired.
|
|
43
|
+
*/
|
|
44
|
+
const bootLocalMode = (runtime, identity, portBroker, opts) => Effect.gen(function* () {
|
|
45
|
+
yield* setCurrentPluginPhase("resolving Sui local image");
|
|
46
|
+
const image = yield* resolveImage(runtime, opts);
|
|
47
|
+
yield* setCurrentPluginPhase("creating Sui validator container");
|
|
48
|
+
const { handle, ports } = yield* ensureLocalValidatorContainer(runtime, portBroker, image, {
|
|
49
|
+
app: identity.app,
|
|
50
|
+
stack: identity.stack,
|
|
51
|
+
plugin: "sui",
|
|
52
|
+
role: "validator"
|
|
53
|
+
}, `devstack-${identity.app}-${identity.stack}-sui-validator`, opts);
|
|
54
|
+
const publishedPorts = resolvePublishedPortMapping(ports, handle.ports);
|
|
55
|
+
const directRpcUrl = `http://127.0.0.1:${publishedPorts[0].hostPort}`;
|
|
56
|
+
const directFaucetUrl = `http://127.0.0.1:${publishedPorts[1].hostPort}`;
|
|
57
|
+
const directGraphqlUrl = `http://127.0.0.1:${publishedPorts[2].hostPort}`;
|
|
58
|
+
const rpcUrl = yield* routedSuiUrl(identity, "rpc", SUI_RPC_ENTRYPOINT_PORT);
|
|
59
|
+
const faucetUrl = yield* routedSuiUrl(identity, SUI_FAUCET_ENDPOINT_NAME, SUI_FAUCET_ENTRYPOINT_PORT);
|
|
60
|
+
const graphqlUrl = yield* routedSuiUrl(identity, SUI_GRAPHQL_ENDPOINT_NAME, SUI_GRAPHQL_ENTRYPOINT_PORT);
|
|
61
|
+
const readyTimeout = opts.readyTimeout ?? DEFAULT_LOCAL_READY_TIMEOUT;
|
|
62
|
+
yield* setCurrentPluginPhase("waiting for Sui RPC, faucet, and GraphQL");
|
|
63
|
+
yield* waitForReady(directRpcUrl, directFaucetUrl, directGraphqlUrl, readyTimeout).pipe(Effect.annotateLogs({ "sui.container": handle.name }));
|
|
64
|
+
const sdkClient = new SuiGrpcClient({
|
|
65
|
+
baseUrl: directRpcUrl,
|
|
66
|
+
network: "localnet"
|
|
67
|
+
});
|
|
68
|
+
yield* setCurrentPluginPhase("fetching Sui chain id");
|
|
69
|
+
const chain = yield* fetchChainId(sdkClient, { span: "devstack.plugin.sui.local.fetchChainId" });
|
|
70
|
+
yield* setCurrentPluginPhase("preparing Sui funds-ready gate");
|
|
71
|
+
const { client } = assembleSuiClient({
|
|
72
|
+
sdkClient,
|
|
73
|
+
chain,
|
|
74
|
+
rpcUrl,
|
|
75
|
+
sdkRpcUrl: directRpcUrl,
|
|
76
|
+
faucetUrl,
|
|
77
|
+
fundingFaucetUrl: directFaucetUrl,
|
|
78
|
+
graphqlUrl,
|
|
79
|
+
waitForTransactionsReady: yield* buildWaitForTransactionsReady(directFaucetUrl),
|
|
80
|
+
buildImage: image,
|
|
81
|
+
hostGateway: {
|
|
82
|
+
rpcUrl: toDockerHostGatewayUrl(directRpcUrl),
|
|
83
|
+
faucetUrl: toDockerHostGatewayUrl(directFaucetUrl),
|
|
84
|
+
graphqlUrl: toDockerHostGatewayUrl(directGraphqlUrl)
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
return {
|
|
88
|
+
resolved: makeResolvedNetwork({
|
|
89
|
+
mode: "local",
|
|
90
|
+
chain,
|
|
91
|
+
rpc: rpcUrl,
|
|
92
|
+
faucet: faucetUrl,
|
|
93
|
+
graphql: graphqlUrl,
|
|
94
|
+
source: "default"
|
|
95
|
+
}),
|
|
96
|
+
client,
|
|
97
|
+
clockAdvancer: noopClockAdvancer
|
|
98
|
+
};
|
|
99
|
+
}).pipe(Effect.withSpan("devstack.plugin.sui.local.boot", { attributes: { "devstack.plugin": "sui" } }));
|
|
100
|
+
const resolveImage = (runtime, opts) => Effect.gen(function* () {
|
|
101
|
+
if (opts.image && "pull" in opts.image) {
|
|
102
|
+
const pullRef = opts.image.pull;
|
|
103
|
+
if (runtime.pullImage === void 0) return yield* Effect.fail(suiPluginError("image-build", `sui local mode cannot pull image '${pullRef}' because the configured container runtime does not expose image pulls.`));
|
|
104
|
+
return yield* runtime.pullImage(pullRef).pipe(Effect.mapError((cause) => suiPluginError("image-build", `sui local mode failed to pull image '${pullRef}': ${cause.reason}: ${cause.detail}`, cause)));
|
|
105
|
+
}
|
|
106
|
+
const version = opts.version ?? DEFAULT_SUI_VERSION;
|
|
107
|
+
const buildCtx = opts.image && "build" in opts.image ? {
|
|
108
|
+
contextPath: opts.image.build.context,
|
|
109
|
+
dockerfile: opts.image.build.dockerfile ?? "Dockerfile",
|
|
110
|
+
buildArgs: { SUI_VERSION: version }
|
|
111
|
+
} : suiCliImageBuildContext(version);
|
|
112
|
+
return yield* runtime.ensureImage(buildCtx).pipe(Effect.mapError((cause) => suiPluginError("image-build", `sui image build failed: ${cause.reason}: ${cause.detail}`, cause)));
|
|
113
|
+
}).pipe(Effect.withSpan("devstack.plugin.sui.local.resolveImage"));
|
|
114
|
+
const ensureLocalValidatorContainer = (runtime, portBroker, image, labels, containerName, opts) => Effect.gen(function* () {
|
|
115
|
+
const reusablePorts = opts.ports === void 0 ? yield* findReusablePortMapping(runtime, labels, containerName) : void 0;
|
|
116
|
+
if (reusablePorts !== void 0) return yield* ensureLocalValidatorContainerAttempt({
|
|
117
|
+
runtime,
|
|
118
|
+
portBroker,
|
|
119
|
+
image,
|
|
120
|
+
labels,
|
|
121
|
+
containerName,
|
|
122
|
+
opts,
|
|
123
|
+
ports: reusablePorts,
|
|
124
|
+
attempt: 0,
|
|
125
|
+
reconciliation: "adopt-existing"
|
|
126
|
+
});
|
|
127
|
+
return yield* ensureLocalValidatorContainerWithFreshPorts({
|
|
128
|
+
runtime,
|
|
129
|
+
portBroker,
|
|
130
|
+
image,
|
|
131
|
+
labels,
|
|
132
|
+
containerName,
|
|
133
|
+
opts,
|
|
134
|
+
attempt: 0,
|
|
135
|
+
reconciliation: opts.ports ? "exact" : "adopt-existing"
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
const ensureLocalValidatorContainerWithFreshPorts = (params) => Effect.gen(function* () {
|
|
139
|
+
const mapping = yield* resolvePortMappingWithRelease(params.portBroker, params.opts.ports);
|
|
140
|
+
return yield* ensureLocalValidatorContainerAttempt({
|
|
141
|
+
...params,
|
|
142
|
+
ports: mapping.ports,
|
|
143
|
+
releasePorts: mapping.release
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
const ensureLocalValidatorContainerAttempt = (params) => ensureManagedContainer({
|
|
147
|
+
runtime: params.runtime,
|
|
148
|
+
labels: params.labels,
|
|
149
|
+
spec: {
|
|
150
|
+
name: params.containerName,
|
|
151
|
+
image: params.image,
|
|
152
|
+
recreate: "on-failure",
|
|
153
|
+
stopGraceSeconds: 30,
|
|
154
|
+
ports: params.ports,
|
|
155
|
+
portBindingReconciliation: params.reconciliation
|
|
156
|
+
},
|
|
157
|
+
mapError: (cause) => cause
|
|
158
|
+
}).pipe(Effect.map((handle) => ({
|
|
159
|
+
handle,
|
|
160
|
+
ports: params.ports
|
|
161
|
+
})), Effect.catch((cause) => {
|
|
162
|
+
if (params.opts.ports === void 0 && cause.reason === "publish-port-conflict" && params.attempt < 3) return (params.releasePorts ?? Effect.void).pipe(Effect.andThen(ensureLocalValidatorContainerWithFreshPorts({
|
|
163
|
+
...params,
|
|
164
|
+
attempt: params.attempt + 1,
|
|
165
|
+
reconciliation: "exact"
|
|
166
|
+
})));
|
|
167
|
+
return Effect.fail(suiPluginError("container-start", `sui-validator container failed: ${cause.reason}: ${cause.detail}`, cause));
|
|
168
|
+
}));
|
|
169
|
+
const resolvePortMappingWithRelease = (portBroker, override) => {
|
|
170
|
+
const pick = (containerPort, fallback) => {
|
|
171
|
+
if (!override) return fallback;
|
|
172
|
+
const hit = override[containerPort];
|
|
173
|
+
return typeof hit === "number" ? hit : fallback;
|
|
174
|
+
};
|
|
175
|
+
if (override) return Effect.succeed({
|
|
176
|
+
ports: [
|
|
177
|
+
portPublish(CONTAINER_RPC_PORT, pick(CONTAINER_RPC_PORT, DEFAULT_HOST_RPC_PORT)),
|
|
178
|
+
portPublish(CONTAINER_FAUCET_PORT, pick(CONTAINER_FAUCET_PORT, DEFAULT_HOST_FAUCET_PORT)),
|
|
179
|
+
portPublish(CONTAINER_GRAPHQL_PORT, pick(CONTAINER_GRAPHQL_PORT, DEFAULT_HOST_GRAPHQL_PORT))
|
|
180
|
+
],
|
|
181
|
+
release: Effect.void
|
|
182
|
+
});
|
|
183
|
+
return Effect.gen(function* () {
|
|
184
|
+
const rpc = yield* allocatePort(portBroker, "rpc", DEFAULT_HOST_RPC_PORT, "rpc");
|
|
185
|
+
const faucet = yield* allocatePort(portBroker, "http", DEFAULT_HOST_FAUCET_PORT, "faucet");
|
|
186
|
+
const graphql = yield* allocatePort(portBroker, "rpc", DEFAULT_HOST_GRAPHQL_PORT, "graphql");
|
|
187
|
+
return {
|
|
188
|
+
ports: [
|
|
189
|
+
portPublish(CONTAINER_RPC_PORT, rpc.port),
|
|
190
|
+
portPublish(CONTAINER_FAUCET_PORT, faucet.port),
|
|
191
|
+
portPublish(CONTAINER_GRAPHQL_PORT, graphql.port)
|
|
192
|
+
],
|
|
193
|
+
release: Effect.all([
|
|
194
|
+
rpc.release,
|
|
195
|
+
faucet.release,
|
|
196
|
+
graphql.release
|
|
197
|
+
], { discard: true })
|
|
198
|
+
};
|
|
199
|
+
});
|
|
200
|
+
};
|
|
201
|
+
const resolvePublishedPortMapping = (requested, actual) => [
|
|
202
|
+
pickPublishedPort(requested, actual, CONTAINER_RPC_PORT, DEFAULT_HOST_RPC_PORT),
|
|
203
|
+
pickPublishedPort(requested, actual, CONTAINER_FAUCET_PORT, DEFAULT_HOST_FAUCET_PORT),
|
|
204
|
+
pickPublishedPort(requested, actual, CONTAINER_GRAPHQL_PORT, DEFAULT_HOST_GRAPHQL_PORT)
|
|
205
|
+
];
|
|
206
|
+
const pickPublishedPort = (requested, actual, containerPort, fallbackHostPort) => actual?.find((port) => port.containerPort === containerPort) ?? requested.find((port) => port.containerPort === containerPort) ?? portPublish(containerPort, fallbackHostPort);
|
|
207
|
+
const selectReusablePortMapping = (handles, containerName) => {
|
|
208
|
+
const ports = handles.find((handle) => handle.name === containerName)?.ports;
|
|
209
|
+
if (!hasSuiPortMapping(ports)) return void 0;
|
|
210
|
+
return resolvePublishedPortMapping([], ports);
|
|
211
|
+
};
|
|
212
|
+
const findReusablePortMapping = (runtime, labels, containerName) => runtime.inspectByLabels(labels).pipe(Effect.map((handles) => selectReusablePortMapping(handles, containerName)), Effect.mapError((cause) => suiPluginError("container-start", `sui local mode: failed to inspect existing validator container: ${cause.reason}: ${cause.detail}`, cause)));
|
|
213
|
+
const hasSuiPortMapping = (ports) => ports !== void 0 && ports.some((port) => port.containerPort === CONTAINER_RPC_PORT) && ports.some((port) => port.containerPort === CONTAINER_FAUCET_PORT) && ports.some((port) => port.containerPort === CONTAINER_GRAPHQL_PORT);
|
|
214
|
+
const portPublish = (containerPort, hostPort) => ({
|
|
215
|
+
containerPort,
|
|
216
|
+
hostPort,
|
|
217
|
+
hostIp: DOCKER_PUBLISH_HOST
|
|
218
|
+
});
|
|
219
|
+
const allocatePort = (portBroker, kind, preferredPort, label) => {
|
|
220
|
+
const allocate = (hint) => portBroker.allocate({
|
|
221
|
+
kind,
|
|
222
|
+
...hint === void 0 ? {} : { preferredPort: hint },
|
|
223
|
+
probeHost: DOCKER_PUBLISH_HOST
|
|
224
|
+
}).pipe(Effect.catchTag("PortBrokerError", (cause) => hint !== void 0 && cause.reason === "preferred-busy" ? portBroker.allocate({
|
|
225
|
+
kind,
|
|
226
|
+
probeHost: DOCKER_PUBLISH_HOST
|
|
227
|
+
}) : Effect.fail(cause)), Effect.mapError((cause) => suiPluginError("port-allocate", `sui local mode: failed to allocate ${label} host port (preferred ${hint ?? "auto"}): ${cause.detail}`, cause)));
|
|
228
|
+
return allocate(preferredPort);
|
|
229
|
+
};
|
|
230
|
+
/** Coordinated readiness gate. Both RPC + faucet must respond within
|
|
231
|
+
* the outer deadline; each probe has its own per-fetch deadline so a
|
|
232
|
+
* wedged endpoint surfaces by name. */
|
|
233
|
+
const waitForReady = (rpcUrl, faucetUrl, graphqlUrl, readyTimeout) => Effect.gen(function* () {
|
|
234
|
+
const readyTimeoutMs = Duration.toMillis(readyTimeout);
|
|
235
|
+
const rpcProbe = waitForHttpEndpoint({
|
|
236
|
+
endpoint: rpcUrl,
|
|
237
|
+
timeoutMs: readyTimeoutMs,
|
|
238
|
+
intervalMs: 1e3,
|
|
239
|
+
requestTimeoutMs: PROBE_FETCH_TIMEOUT_MS,
|
|
240
|
+
requestInit: {
|
|
241
|
+
method: "POST",
|
|
242
|
+
headers: { "content-type": "application/json" },
|
|
243
|
+
body: JSON.stringify({
|
|
244
|
+
jsonrpc: "2.0",
|
|
245
|
+
id: 1,
|
|
246
|
+
method: "sui_getLatestCheckpointSequenceNumber",
|
|
247
|
+
params: []
|
|
248
|
+
})
|
|
249
|
+
},
|
|
250
|
+
validate: async (response) => {
|
|
251
|
+
if (!response.ok) return false;
|
|
252
|
+
const body = await response.json();
|
|
253
|
+
return typeof body.result === "string" || typeof body.result === "number";
|
|
254
|
+
}
|
|
255
|
+
}).pipe(Effect.mapError((cause) => suiPluginError("rpc-probe", `sui local mode: RPC endpoint ${rpcUrl} did not become ready within ${readyTimeoutMs}ms: ${stringifyCause(cause)}`, cause)), Effect.withSpan("devstack.plugin.sui.local.probe.rpc"));
|
|
256
|
+
const faucetProbe = waitForHttpEndpoint({
|
|
257
|
+
endpoint: faucetUrl,
|
|
258
|
+
timeoutMs: readyTimeoutMs,
|
|
259
|
+
intervalMs: 1e3,
|
|
260
|
+
requestTimeoutMs: PROBE_FETCH_TIMEOUT_MS,
|
|
261
|
+
validate: (response) => response.status < 500
|
|
262
|
+
}).pipe(Effect.mapError((cause) => suiPluginError("faucet-probe", `sui local mode: faucet endpoint ${faucetUrl} did not become ready within ${readyTimeoutMs}ms: ${stringifyCause(cause)}`, cause)), Effect.withSpan("devstack.plugin.sui.local.probe.faucet"));
|
|
263
|
+
const graphqlProbe = waitForHttpEndpoint({
|
|
264
|
+
endpoint: graphqlUrl,
|
|
265
|
+
timeoutMs: readyTimeoutMs,
|
|
266
|
+
intervalMs: 1e3,
|
|
267
|
+
requestTimeoutMs: PROBE_FETCH_TIMEOUT_MS,
|
|
268
|
+
validate: (response) => response.status < 500
|
|
269
|
+
}).pipe(Effect.mapError((cause) => suiPluginError("graphql-probe", `sui local mode: GraphQL endpoint ${graphqlUrl} did not become ready within ${readyTimeoutMs}ms: ${stringifyCause(cause)}`, cause)), Effect.withSpan("devstack.plugin.sui.local.probe.graphql"));
|
|
270
|
+
yield* Effect.all([
|
|
271
|
+
rpcProbe,
|
|
272
|
+
faucetProbe,
|
|
273
|
+
graphqlProbe
|
|
274
|
+
], { concurrency: "unbounded" }).pipe(Effect.asVoid);
|
|
275
|
+
}).pipe(Effect.withSpan("devstack.plugin.sui.local.waitForReady"));
|
|
276
|
+
const routedSuiUrl = (identity, endpointName, port) => routerHostname(identity, endpointName).pipe(Effect.map((hostname) => renderUrl({
|
|
277
|
+
protocol: "http",
|
|
278
|
+
hostname,
|
|
279
|
+
port
|
|
280
|
+
})), Effect.mapError((cause) => suiPluginError("container-start", `sui local mode: failed to construct router URL for ${endpointName}: ${cause.detail}`, cause)));
|
|
281
|
+
const stringifyCause = (cause) => {
|
|
282
|
+
if (cause instanceof Error) return cause.message;
|
|
283
|
+
if (typeof cause === "string") return cause;
|
|
284
|
+
try {
|
|
285
|
+
return JSON.stringify(cause);
|
|
286
|
+
} catch {
|
|
287
|
+
return String(cause);
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
//#endregion
|
|
291
|
+
export { bootLocalMode };
|
|
292
|
+
|
|
293
|
+
//# sourceMappingURL=local.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local.mjs","names":["sharedFetchChainId"],"sources":["../../../../src/plugins/sui/mode/local.ts"],"sourcesContent":["// Sui plugin — local-container mode.\n//\n// In-stack Sui validator + faucet, running in the supervised docker\n// stack. Used during normal dev loops when the developer wants fresh,\n// fast, throwaway chain state with a working faucet.\n//\n// Boot sequence (load-bearing order):\n//\n// 1. Resolve image — vendored Dockerfile build via the\n// ContainerRuntime contract (caller `image` override honoured for\n// `{build}`; `{pull}` is deferred — see stub list in the README).\n// 2. Allocate + ensure container — `sui start --with-faucet=0.0.0.0:9123\n// --with-graphql=0.0.0.0:9125` with direct host port-publishing\n// for internal boot probes. User-facing URLs are router-fronted\n// named hosts; the direct host ports intentionally live in the\n// high private windows so they do not collide with router\n// entrypoints.\n// RecreatePolicy is `on-failure` so the writable layer (chain\n// state at `/root/.sui`) survives clean stop/start cycles, but an\n// unclean SIGKILL/137 exit recreates instead of resuming a suspect\n// RocksDB/checkpoint state. The image's entrypoint forwards SIGINT\n// to a non-PID-1 sui child so clean shutdown (RocksDB checkpoint\n// drain → exit 0/130) is the normal case.\n// 3. Ready probe — RPC `getChainIdentifier`, faucet `GET /`, and\n// GraphQL HTTP liveness. Per-fetch deadline + outer deadline.\n// 4. Fetch chain id from the now-responsive client (bounded timeout).\n// 5. Build `waitForTransactionsReady` — `Effect.cached` against a\n// real faucet funding tx; first failure caches for the scope.\n// Manual `invalidate` clears the memo.\n// 6. Return resolved `SuiClient`. Auto-tick is the no-op advancer\n// (localnet drives its own consensus).\n//\n// Faucet socket-level readiness does NOT imply funds-transferability.\n// The first `waitForTransactionsReady.wait` POSTs a real funding tx,\n// retrying on body-level `{Failure}` responses during the post-RPC /\n// pre-fund window.\n//\n// What this body deliberately defers:\n// - Postgres indexer sidecar — GraphQL is enabled by `sui start` and\n// routed as a first-class endpoint, but no separate postgres\n// lifecycle is supervised here.\n// - Snapshot capture — the framework exists in the plugin's\n// snapshot.ts; this body produces the running container that the\n// orchestrator captures.\n\nimport { Duration, Effect, type Scope } from 'effect';\n\nimport { SuiGrpcClient } from '@mysten/sui/grpc';\n\nimport type {\n\tContainerHandle,\n\tContainerRuntime,\n\tContainerRuntimeError,\n\tImageRef,\n\tContainerPortPublish,\n\tPortBindingReconciliation,\n} from '../../../contracts/container-runtime.ts';\nimport type { ContainerLabelTuple } from '../../../contracts/snapshotable.ts';\nimport type { Identity } from '../../../substrate/identity.ts';\nimport type {\n\tAllocatedPort,\n\tPortBroker,\n\tPortKind,\n} from '../../../substrate/runtime/port-broker/index.ts';\nimport { waitForHttpEndpoint } from '../../../substrate/runtime/http-probe.ts';\nimport { setCurrentPluginPhase } from '../../../substrate/runtime/current-plugin.ts';\nimport { ensureManagedContainer } from '../../../substrate/runtime/managed-container.ts';\nimport { renderUrl, routerHostname } from '../../../orchestrators/router/hostname.ts';\nimport {\n\tDEFAULT_SUI_CLI_VERSION,\n\tsuiCliImageBuildContext,\n} from '../../../substrate/runtime/sui-move-build/index.ts';\nimport { noopClockAdvancer } from '../auto-tick.ts';\nimport { suiPluginError, type SuiPluginError } from '../errors.ts';\nimport type { ResolvedSuiNetwork } from '../network-resolver.ts';\nimport {\n\tSUI_FAUCET_ENTRYPOINT_PORT,\n\tSUI_FAUCET_ENDPOINT_NAME,\n\tSUI_GRAPHQL_ENDPOINT_NAME,\n\tSUI_GRAPHQL_ENTRYPOINT_PORT,\n\tSUI_RPC_ENDPOINT_NAME,\n\tSUI_RPC_ENTRYPOINT_PORT,\n} from '../routable.ts';\nimport type { SuiClient } from './shared.ts';\nimport { toDockerHostGatewayUrl } from './shared.ts';\nimport {\n\tassembleSuiClient,\n\tbuildWaitForTransactionsReady,\n\tfetchChainId as sharedFetchChainId,\n\tmakeResolvedNetwork,\n} from './shared-boot.ts';\nimport type { SuiLocalOptions } from './spec.ts';\n\n/** Default ready-probe timeout for localnet. The validator's cold\n * start runs genesis + faucet bootstrap; 60 s is the documented\n * ceiling. */\nexport const DEFAULT_LOCAL_READY_TIMEOUT = Duration.seconds(60);\n\n/** Default sui validator binary version pinned by the vendored\n * `images/sui/` Dockerfile. The build arg `SUI_VERSION` is threaded\n * through to the release-tarball URL. Bump in lockstep with matching\n * Walrus / Seal versions (else the Move package ABIs drift). */\nexport const DEFAULT_SUI_VERSION = DEFAULT_SUI_CLI_VERSION;\n\n// In-container ports the sui binary binds on. These match the router\n// entrypoint ports; direct host publishes below use different high\n// ports so Traefik owns the public listener ports.\nconst CONTAINER_RPC_PORT = SUI_RPC_ENTRYPOINT_PORT;\nconst CONTAINER_FAUCET_PORT = SUI_FAUCET_ENTRYPOINT_PORT;\nconst CONTAINER_GRAPHQL_PORT = SUI_GRAPHQL_ENTRYPOINT_PORT;\n\n// Default host ports. Without `opts.ports`, these are preferences\n// brokered against the kernel before Docker publishes them.\nexport const DEFAULT_HOST_RPC_PORT = 51000;\nexport const DEFAULT_HOST_FAUCET_PORT = 50000;\nexport const DEFAULT_HOST_GRAPHQL_PORT = 51001;\nconst DOCKER_PUBLISH_HOST = '0.0.0.0' as const;\nexport const MAX_DOCKER_PUBLISH_PORT_RETRIES = 3;\nexport const LOCAL_VALIDATOR_STOP_GRACE_SECONDS = 30;\n\n/** Per-fetch deadline for the ready-probe HTTP calls. Without it a\n * hung fetch would block the outer ready deadline with no signal\n * about which probe wedged. */\nconst PROBE_FETCH_TIMEOUT_MS = 3000;\n\n/** Resolved local-mode boot artifacts. */\nexport interface LocalModeBootResult {\n\treadonly resolved: ResolvedSuiNetwork;\n\treadonly client: SuiClient;\n\treadonly clockAdvancer: typeof noopClockAdvancer;\n}\n\n/**\n * Build the local-mode boot Effect.\n *\n * `identity` is threaded in by the caller (the plugin barrel's acquire\n * body, which has access to the substrate's `IdentityContext` via the\n * outer composition layer); the body uses it to stamp the canonical\n * container label tuple so sweep / inventory are name-blind.\n *\n * `{pull}`, `{build}`, and vendored-build image branches are wired.\n */\nexport const bootLocalMode = (\n\truntime: ContainerRuntime,\n\tidentity: Identity,\n\tportBroker: PortBroker,\n\topts: SuiLocalOptions,\n): Effect.Effect<LocalModeBootResult, SuiPluginError, Scope.Scope> =>\n\tEffect.gen(function* () {\n\t\t// ----- 1. Resolve image ---------------------------------------------\n\t\tyield* setCurrentPluginPhase('resolving Sui local image');\n\t\tconst image = yield* resolveImage(runtime, opts);\n\n\t\t// ----- 2. Allocate ports + ensure container --------------------------\n\t\tyield* setCurrentPluginPhase('creating Sui validator container');\n\t\tconst labels: ContainerLabelTuple = {\n\t\t\tapp: identity.app,\n\t\t\tstack: identity.stack,\n\t\t\tplugin: 'sui',\n\t\t\trole: 'validator',\n\t\t};\n\t\tconst containerName = `devstack-${identity.app}-${identity.stack}-sui-validator`;\n\t\tconst { handle, ports } = yield* ensureLocalValidatorContainer(\n\t\t\truntime,\n\t\t\tportBroker,\n\t\t\timage,\n\t\t\tlabels,\n\t\t\tcontainerName,\n\t\t\topts,\n\t\t);\n\n\t\t// ----- 3. Ready probes ----------------------------------------------\n\t\tconst publishedPorts = resolvePublishedPortMapping(ports, handle.ports);\n\t\tconst directRpcUrl = `http://127.0.0.1:${publishedPorts[0]!.hostPort}`;\n\t\tconst directFaucetUrl = `http://127.0.0.1:${publishedPorts[1]!.hostPort}`;\n\t\tconst directGraphqlUrl = `http://127.0.0.1:${publishedPorts[2]!.hostPort}`;\n\t\tconst rpcUrl = yield* routedSuiUrl(identity, SUI_RPC_ENDPOINT_NAME, SUI_RPC_ENTRYPOINT_PORT);\n\t\tconst faucetUrl = yield* routedSuiUrl(\n\t\t\tidentity,\n\t\t\tSUI_FAUCET_ENDPOINT_NAME,\n\t\t\tSUI_FAUCET_ENTRYPOINT_PORT,\n\t\t);\n\t\tconst graphqlUrl = yield* routedSuiUrl(\n\t\t\tidentity,\n\t\t\tSUI_GRAPHQL_ENDPOINT_NAME,\n\t\t\tSUI_GRAPHQL_ENTRYPOINT_PORT,\n\t\t);\n\t\tconst readyTimeout = opts.readyTimeout ?? DEFAULT_LOCAL_READY_TIMEOUT;\n\n\t\tyield* setCurrentPluginPhase('waiting for Sui RPC, faucet, and GraphQL');\n\t\tyield* waitForReady(directRpcUrl, directFaucetUrl, directGraphqlUrl, readyTimeout).pipe(\n\t\t\tEffect.annotateLogs({ 'sui.container': handle.name }),\n\t\t);\n\n\t\tconst sdkClient = new SuiGrpcClient({ baseUrl: directRpcUrl, network: 'localnet' });\n\n\t\t// ----- 4. Resolve chain id ------------------------------------------\n\t\tyield* setCurrentPluginPhase('fetching Sui chain id');\n\t\tconst chain = yield* sharedFetchChainId(sdkClient, {\n\t\t\tspan: 'devstack.plugin.sui.local.fetchChainId',\n\t\t});\n\n\t\t// ----- 5. waitForTransactionsReady (memoised) -----------------------\n\t\tyield* setCurrentPluginPhase('preparing Sui funds-ready gate');\n\t\tconst waitForTransactionsReady = yield* buildWaitForTransactionsReady(directFaucetUrl);\n\n\t\t// ----- 6. Assemble resolved SuiClient -------------------------------\n\t\t// Surface `buildImage` so package's path-(b) `docker run --rm`\n\t\t// build path can spawn a one-shot sui-cli container using the\n\t\t// SAME image we built/resolved here. Without this the package\n\t\t// plugin would have to re-resolve the image, doubling the\n\t\t// build-context hash work and risking digest drift.\n\t\tconst { client } = assembleSuiClient({\n\t\t\tsdkClient,\n\t\t\tchain,\n\t\t\trpcUrl,\n\t\t\tsdkRpcUrl: directRpcUrl,\n\t\t\tfaucetUrl,\n\t\t\tfundingFaucetUrl: directFaucetUrl,\n\t\t\tgraphqlUrl,\n\t\t\twaitForTransactionsReady,\n\t\t\tbuildImage: image,\n\t\t\thostGateway: {\n\t\t\t\trpcUrl: toDockerHostGatewayUrl(directRpcUrl),\n\t\t\t\tfaucetUrl: toDockerHostGatewayUrl(directFaucetUrl),\n\t\t\t\tgraphqlUrl: toDockerHostGatewayUrl(directGraphqlUrl),\n\t\t\t},\n\t\t});\n\t\tconst resolved = makeResolvedNetwork({\n\t\t\tmode: 'local',\n\t\t\tchain,\n\t\t\trpc: rpcUrl,\n\t\t\tfaucet: faucetUrl,\n\t\t\tgraphql: graphqlUrl,\n\t\t\tsource: 'default',\n\t\t});\n\t\treturn {\n\t\t\tresolved,\n\t\t\tclient,\n\t\t\tclockAdvancer: noopClockAdvancer,\n\t\t};\n\t}).pipe(\n\t\tEffect.withSpan('devstack.plugin.sui.local.boot', { attributes: { 'devstack.plugin': 'sui' } }),\n\t);\n\n// ---------------------------------------------------------------------------\n// Image resolution — vendored Dockerfile build via `ContainerRuntime`\n// ---------------------------------------------------------------------------\n\nexport const resolveImage = (\n\truntime: ContainerRuntime,\n\topts: SuiLocalOptions,\n): Effect.Effect<ImageRef, SuiPluginError> =>\n\tEffect.gen(function* () {\n\t\tif (opts.image && 'pull' in opts.image) {\n\t\t\tconst pullRef = opts.image.pull;\n\t\t\tif (runtime.pullImage === undefined) {\n\t\t\t\treturn yield* Effect.fail(\n\t\t\t\t\tsuiPluginError(\n\t\t\t\t\t\t'image-build',\n\t\t\t\t\t\t`sui local mode cannot pull image '${pullRef}' because the configured container runtime does not expose image pulls.`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn yield* runtime\n\t\t\t\t.pullImage(pullRef)\n\t\t\t\t.pipe(\n\t\t\t\t\tEffect.mapError((cause) =>\n\t\t\t\t\t\tsuiPluginError(\n\t\t\t\t\t\t\t'image-build',\n\t\t\t\t\t\t\t`sui local mode failed to pull image '${pullRef}': ${cause.reason}: ${cause.detail}`,\n\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t}\n\t\tconst version = opts.version ?? DEFAULT_SUI_VERSION;\n\t\tconst buildCtx =\n\t\t\topts.image && 'build' in opts.image\n\t\t\t\t? {\n\t\t\t\t\t\tcontextPath: opts.image.build.context,\n\t\t\t\t\t\tdockerfile: opts.image.build.dockerfile ?? 'Dockerfile',\n\t\t\t\t\t\tbuildArgs: { SUI_VERSION: version },\n\t\t\t\t\t}\n\t\t\t\t: suiCliImageBuildContext(version);\n\t\treturn yield* runtime\n\t\t\t.ensureImage(buildCtx)\n\t\t\t.pipe(\n\t\t\t\tEffect.mapError((cause) =>\n\t\t\t\t\tsuiPluginError(\n\t\t\t\t\t\t'image-build',\n\t\t\t\t\t\t`sui image build failed: ${cause.reason}: ${cause.detail}`,\n\t\t\t\t\t\tcause,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\t}).pipe(Effect.withSpan('devstack.plugin.sui.local.resolveImage'));\n\ninterface LocalValidatorContainerResult {\n\treadonly handle: ContainerHandle;\n\treadonly ports: ReadonlyArray<ContainerPortPublish>;\n}\n\ninterface ResolvedPortMapping {\n\treadonly ports: ReadonlyArray<ContainerPortPublish>;\n\treadonly release: Effect.Effect<void>;\n}\n\nexport const ensureLocalValidatorContainer = (\n\truntime: ContainerRuntime,\n\tportBroker: PortBroker,\n\timage: ImageRef,\n\tlabels: ContainerLabelTuple,\n\tcontainerName: string,\n\topts: SuiLocalOptions,\n): Effect.Effect<LocalValidatorContainerResult, SuiPluginError, Scope.Scope> =>\n\tEffect.gen(function* () {\n\t\tconst reusablePorts =\n\t\t\topts.ports === undefined\n\t\t\t\t? yield* findReusablePortMapping(runtime, labels, containerName)\n\t\t\t\t: undefined;\n\t\tif (reusablePorts !== undefined) {\n\t\t\treturn yield* ensureLocalValidatorContainerAttempt({\n\t\t\t\truntime,\n\t\t\t\tportBroker,\n\t\t\t\timage,\n\t\t\t\tlabels,\n\t\t\t\tcontainerName,\n\t\t\t\topts,\n\t\t\t\tports: reusablePorts,\n\t\t\t\tattempt: 0,\n\t\t\t\treconciliation: 'adopt-existing',\n\t\t\t});\n\t\t}\n\t\treturn yield* ensureLocalValidatorContainerWithFreshPorts({\n\t\t\truntime,\n\t\t\tportBroker,\n\t\t\timage,\n\t\t\tlabels,\n\t\t\tcontainerName,\n\t\t\topts,\n\t\t\tattempt: 0,\n\t\t\treconciliation: opts.ports ? 'exact' : 'adopt-existing',\n\t\t});\n\t});\n\ninterface EnsureLocalValidatorContainerBase {\n\treadonly runtime: ContainerRuntime;\n\treadonly portBroker: PortBroker;\n\treadonly image: ImageRef;\n\treadonly labels: ContainerLabelTuple;\n\treadonly containerName: string;\n\treadonly opts: SuiLocalOptions;\n}\n\nconst ensureLocalValidatorContainerWithFreshPorts = (\n\tparams: EnsureLocalValidatorContainerBase & {\n\t\treadonly attempt: number;\n\t\treadonly reconciliation: PortBindingReconciliation;\n\t},\n): Effect.Effect<LocalValidatorContainerResult, SuiPluginError, Scope.Scope> =>\n\tEffect.gen(function* () {\n\t\tconst mapping = yield* resolvePortMappingWithRelease(params.portBroker, params.opts.ports);\n\t\treturn yield* ensureLocalValidatorContainerAttempt({\n\t\t\t...params,\n\t\t\tports: mapping.ports,\n\t\t\treleasePorts: mapping.release,\n\t\t});\n\t});\n\nconst ensureLocalValidatorContainerAttempt = (\n\tparams: EnsureLocalValidatorContainerBase & {\n\t\treadonly ports: ReadonlyArray<ContainerPortPublish>;\n\t\treadonly releasePorts?: Effect.Effect<void>;\n\t\treadonly attempt: number;\n\t\treadonly reconciliation: PortBindingReconciliation;\n\t},\n): Effect.Effect<LocalValidatorContainerResult, SuiPluginError, Scope.Scope> =>\n\tensureManagedContainer({\n\t\truntime: params.runtime,\n\t\tlabels: params.labels,\n\t\tspec: {\n\t\t\tname: params.containerName,\n\t\t\timage: params.image,\n\t\t\t// Keep the writable layer only after clean exits. If Docker\n\t\t\t// escalates a previous stop to SIGKILL (137), resume can hang\n\t\t\t// in RocksDB/checkpoint recovery with no RPC/faucet probes.\n\t\t\t// `on-failure` routes that stale layer to recreate while still\n\t\t\t// warm-resuming normal exit 0 / 130 stops. The longer grace\n\t\t\t// gives the entrypoint's SIGINT forwarding time to drain.\n\t\t\trecreate: 'on-failure',\n\t\t\tstopGraceSeconds: LOCAL_VALIDATOR_STOP_GRACE_SECONDS,\n\t\t\tports: params.ports,\n\t\t\tportBindingReconciliation: params.reconciliation,\n\t\t},\n\t\tmapError: (cause) => cause,\n\t}).pipe(\n\t\tEffect.map((handle) => ({ handle, ports: params.ports })),\n\t\tEffect.catch((cause: ContainerRuntimeError) => {\n\t\t\tif (\n\t\t\t\tparams.opts.ports === undefined &&\n\t\t\t\tcause.reason === 'publish-port-conflict' &&\n\t\t\t\tparams.attempt < MAX_DOCKER_PUBLISH_PORT_RETRIES\n\t\t\t) {\n\t\t\t\treturn (params.releasePorts ?? Effect.void).pipe(\n\t\t\t\t\tEffect.andThen(\n\t\t\t\t\t\tensureLocalValidatorContainerWithFreshPorts({\n\t\t\t\t\t\t\t...params,\n\t\t\t\t\t\t\tattempt: params.attempt + 1,\n\t\t\t\t\t\t\treconciliation: 'exact',\n\t\t\t\t\t\t}),\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn Effect.fail(\n\t\t\t\tsuiPluginError(\n\t\t\t\t\t'container-start',\n\t\t\t\t\t`sui-validator container failed: ${cause.reason}: ${cause.detail}`,\n\t\t\t\t\tcause,\n\t\t\t\t),\n\t\t\t);\n\t\t}),\n\t);\n\n// ---------------------------------------------------------------------------\n// Port mapping — host:container pairs\n// ---------------------------------------------------------------------------\n\nexport const resolvePortMapping = (\n\tportBroker: PortBroker,\n\toverride: Readonly<Record<number, number>> | undefined,\n): Effect.Effect<ReadonlyArray<ContainerPortPublish>, SuiPluginError, Scope.Scope> =>\n\tresolvePortMappingWithRelease(portBroker, override).pipe(Effect.map((mapping) => mapping.ports));\n\nconst resolvePortMappingWithRelease = (\n\tportBroker: PortBroker,\n\toverride: Readonly<Record<number, number>> | undefined,\n): Effect.Effect<ResolvedPortMapping, SuiPluginError, Scope.Scope> => {\n\tconst pick = (containerPort: number, fallback: number): number => {\n\t\tif (!override) return fallback;\n\t\tconst hit = override[containerPort];\n\t\treturn typeof hit === 'number' ? hit : fallback;\n\t};\n\tif (override) {\n\t\treturn Effect.succeed({\n\t\t\tports: [\n\t\t\t\tportPublish(CONTAINER_RPC_PORT, pick(CONTAINER_RPC_PORT, DEFAULT_HOST_RPC_PORT)),\n\t\t\t\tportPublish(CONTAINER_FAUCET_PORT, pick(CONTAINER_FAUCET_PORT, DEFAULT_HOST_FAUCET_PORT)),\n\t\t\t\tportPublish(\n\t\t\t\t\tCONTAINER_GRAPHQL_PORT,\n\t\t\t\t\tpick(CONTAINER_GRAPHQL_PORT, DEFAULT_HOST_GRAPHQL_PORT),\n\t\t\t\t),\n\t\t\t],\n\t\t\trelease: Effect.void,\n\t\t});\n\t}\n\treturn Effect.gen(function* () {\n\t\tconst rpc = yield* allocatePort(portBroker, 'rpc', DEFAULT_HOST_RPC_PORT, 'rpc');\n\t\tconst faucet = yield* allocatePort(portBroker, 'http', DEFAULT_HOST_FAUCET_PORT, 'faucet');\n\t\tconst graphql = yield* allocatePort(portBroker, 'rpc', DEFAULT_HOST_GRAPHQL_PORT, 'graphql');\n\t\treturn {\n\t\t\tports: [\n\t\t\t\tportPublish(CONTAINER_RPC_PORT, rpc.port),\n\t\t\t\tportPublish(CONTAINER_FAUCET_PORT, faucet.port),\n\t\t\t\tportPublish(CONTAINER_GRAPHQL_PORT, graphql.port),\n\t\t\t],\n\t\t\trelease: Effect.all([rpc.release, faucet.release, graphql.release], { discard: true }),\n\t\t};\n\t});\n};\n\nexport const resolvePublishedPortMapping = (\n\trequested: ReadonlyArray<ContainerPortPublish>,\n\tactual: ReadonlyArray<ContainerPortPublish> | undefined,\n): ReadonlyArray<ContainerPortPublish> => [\n\tpickPublishedPort(requested, actual, CONTAINER_RPC_PORT, DEFAULT_HOST_RPC_PORT),\n\tpickPublishedPort(requested, actual, CONTAINER_FAUCET_PORT, DEFAULT_HOST_FAUCET_PORT),\n\tpickPublishedPort(requested, actual, CONTAINER_GRAPHQL_PORT, DEFAULT_HOST_GRAPHQL_PORT),\n];\n\nconst pickPublishedPort = (\n\trequested: ReadonlyArray<ContainerPortPublish>,\n\tactual: ReadonlyArray<ContainerPortPublish> | undefined,\n\tcontainerPort: number,\n\tfallbackHostPort: number,\n): ContainerPortPublish =>\n\tactual?.find((port) => port.containerPort === containerPort) ??\n\trequested.find((port) => port.containerPort === containerPort) ??\n\tportPublish(containerPort, fallbackHostPort);\n\nexport const selectReusablePortMapping = (\n\thandles: ReadonlyArray<ContainerHandle>,\n\tcontainerName: string,\n): ReadonlyArray<ContainerPortPublish> | undefined => {\n\tconst ports = handles.find((handle) => handle.name === containerName)?.ports;\n\tif (!hasSuiPortMapping(ports)) return undefined;\n\treturn resolvePublishedPortMapping([], ports);\n};\n\nconst findReusablePortMapping = (\n\truntime: ContainerRuntime,\n\tlabels: ContainerLabelTuple,\n\tcontainerName: string,\n): Effect.Effect<ReadonlyArray<ContainerPortPublish> | undefined, SuiPluginError> =>\n\truntime.inspectByLabels(labels).pipe(\n\t\tEffect.map((handles) => selectReusablePortMapping(handles, containerName)),\n\t\tEffect.mapError((cause) =>\n\t\t\tsuiPluginError(\n\t\t\t\t'container-start',\n\t\t\t\t`sui local mode: failed to inspect existing validator container: ${cause.reason}: ${cause.detail}`,\n\t\t\t\tcause,\n\t\t\t),\n\t\t),\n\t);\n\nconst hasSuiPortMapping = (\n\tports: ReadonlyArray<ContainerPortPublish> | undefined,\n): ports is ReadonlyArray<ContainerPortPublish> =>\n\tports !== undefined &&\n\tports.some((port) => port.containerPort === CONTAINER_RPC_PORT) &&\n\tports.some((port) => port.containerPort === CONTAINER_FAUCET_PORT) &&\n\tports.some((port) => port.containerPort === CONTAINER_GRAPHQL_PORT);\n\nconst portPublish = (containerPort: number, hostPort: number): ContainerPortPublish => ({\n\tcontainerPort,\n\thostPort,\n\thostIp: DOCKER_PUBLISH_HOST,\n});\n\nconst allocatePort = (\n\tportBroker: PortBroker,\n\tkind: PortKind,\n\tpreferredPort: number | undefined,\n\tlabel: 'rpc' | 'faucet' | 'graphql',\n): Effect.Effect<AllocatedPort, SuiPluginError, Scope.Scope> => {\n\tconst allocate = (\n\t\thint: number | undefined,\n\t): Effect.Effect<AllocatedPort, SuiPluginError, Scope.Scope> =>\n\t\tportBroker\n\t\t\t.allocate({\n\t\t\t\tkind,\n\t\t\t\t...(hint === undefined ? {} : { preferredPort: hint }),\n\t\t\t\tprobeHost: DOCKER_PUBLISH_HOST,\n\t\t\t})\n\t\t\t.pipe(\n\t\t\t\tEffect.catchTag('PortBrokerError', (cause) =>\n\t\t\t\t\thint !== undefined && cause.reason === 'preferred-busy'\n\t\t\t\t\t\t? portBroker.allocate({ kind, probeHost: DOCKER_PUBLISH_HOST })\n\t\t\t\t\t\t: Effect.fail(cause),\n\t\t\t\t),\n\t\t\t\tEffect.mapError((cause) =>\n\t\t\t\t\tsuiPluginError(\n\t\t\t\t\t\t'port-allocate',\n\t\t\t\t\t\t`sui local mode: failed to allocate ${label} host port ` +\n\t\t\t\t\t\t\t`(preferred ${hint ?? 'auto'}): ${cause.detail}`,\n\t\t\t\t\t\tcause,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\treturn allocate(preferredPort);\n};\n\n// ---------------------------------------------------------------------------\n// Ready-probe coordination\n// ---------------------------------------------------------------------------\n\n/** Coordinated readiness gate. Both RPC + faucet must respond within\n * the outer deadline; each probe has its own per-fetch deadline so a\n * wedged endpoint surfaces by name. */\nconst waitForReady = (\n\trpcUrl: string,\n\tfaucetUrl: string,\n\tgraphqlUrl: string,\n\treadyTimeout: Duration.Duration,\n): Effect.Effect<void, SuiPluginError> =>\n\tEffect.gen(function* () {\n\t\tconst readyTimeoutMs = Duration.toMillis(readyTimeout);\n\t\tconst rpcProbe: Effect.Effect<void, SuiPluginError> = waitForHttpEndpoint({\n\t\t\tendpoint: rpcUrl,\n\t\t\ttimeoutMs: readyTimeoutMs,\n\t\t\tintervalMs: 1_000,\n\t\t\trequestTimeoutMs: PROBE_FETCH_TIMEOUT_MS,\n\t\t\trequestInit: {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: { 'content-type': 'application/json' },\n\t\t\t\tbody: JSON.stringify({\n\t\t\t\t\tjsonrpc: '2.0',\n\t\t\t\t\tid: 1,\n\t\t\t\t\tmethod: 'sui_getLatestCheckpointSequenceNumber',\n\t\t\t\t\tparams: [],\n\t\t\t\t}),\n\t\t\t},\n\t\t\tvalidate: async (response) => {\n\t\t\t\tif (!response.ok) return false;\n\t\t\t\tconst body = (await response.json()) as { readonly result?: unknown };\n\t\t\t\treturn typeof body.result === 'string' || typeof body.result === 'number';\n\t\t\t},\n\t\t}).pipe(\n\t\t\tEffect.mapError(\n\t\t\t\t(cause): SuiPluginError =>\n\t\t\t\t\tsuiPluginError(\n\t\t\t\t\t\t'rpc-probe',\n\t\t\t\t\t\t`sui local mode: RPC endpoint ${rpcUrl} did not become ready within ` +\n\t\t\t\t\t\t\t`${readyTimeoutMs}ms: ${stringifyCause(cause)}`,\n\t\t\t\t\t\tcause,\n\t\t\t\t\t),\n\t\t\t),\n\t\t\tEffect.withSpan('devstack.plugin.sui.local.probe.rpc'),\n\t\t);\n\n\t\t// Faucet socket-level liveness — `GET /` returns \"OK\" as soon as\n\t\t// the HTTP server is bound. We do NOT POST `/v2/gas` here; that's\n\t\t// the funds-ready probe, which is paid for lazily on first call.\n\t\tconst faucetProbe: Effect.Effect<void, SuiPluginError> = waitForHttpEndpoint({\n\t\t\tendpoint: faucetUrl,\n\t\t\ttimeoutMs: readyTimeoutMs,\n\t\t\tintervalMs: 1_000,\n\t\t\trequestTimeoutMs: PROBE_FETCH_TIMEOUT_MS,\n\t\t\tvalidate: (response) => response.status < 500,\n\t\t}).pipe(\n\t\t\tEffect.mapError(\n\t\t\t\t(cause): SuiPluginError =>\n\t\t\t\t\tsuiPluginError(\n\t\t\t\t\t\t'faucet-probe',\n\t\t\t\t\t\t`sui local mode: faucet endpoint ${faucetUrl} did not become ready within ` +\n\t\t\t\t\t\t\t`${readyTimeoutMs}ms: ${stringifyCause(cause)}`,\n\t\t\t\t\t\tcause,\n\t\t\t\t\t),\n\t\t\t),\n\t\t\tEffect.withSpan('devstack.plugin.sui.local.probe.faucet'),\n\t\t);\n\n\t\tconst graphqlProbe: Effect.Effect<void, SuiPluginError> = waitForHttpEndpoint({\n\t\t\tendpoint: graphqlUrl,\n\t\t\ttimeoutMs: readyTimeoutMs,\n\t\t\tintervalMs: 1_000,\n\t\t\trequestTimeoutMs: PROBE_FETCH_TIMEOUT_MS,\n\t\t\tvalidate: (response) => response.status < 500,\n\t\t}).pipe(\n\t\t\tEffect.mapError(\n\t\t\t\t(cause): SuiPluginError =>\n\t\t\t\t\tsuiPluginError(\n\t\t\t\t\t\t'graphql-probe',\n\t\t\t\t\t\t`sui local mode: GraphQL endpoint ${graphqlUrl} did not become ready within ` +\n\t\t\t\t\t\t\t`${readyTimeoutMs}ms: ${stringifyCause(cause)}`,\n\t\t\t\t\t\tcause,\n\t\t\t\t\t),\n\t\t\t),\n\t\t\tEffect.withSpan('devstack.plugin.sui.local.probe.graphql'),\n\t\t);\n\n\t\tyield* Effect.all([rpcProbe, faucetProbe, graphqlProbe], { concurrency: 'unbounded' }).pipe(\n\t\t\tEffect.asVoid,\n\t\t);\n\t}).pipe(Effect.withSpan('devstack.plugin.sui.local.waitForReady'));\n\n// Chain-id fetch + waitForTransactionsReady builders live in\n// `shared-boot.ts` — see imports at the top of this file.\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nconst routedSuiUrl = (\n\tidentity: Identity,\n\tendpointName: string,\n\tport: number,\n): Effect.Effect<string, SuiPluginError> =>\n\trouterHostname(identity, endpointName).pipe(\n\t\tEffect.map((hostname) => renderUrl({ protocol: 'http', hostname, port })),\n\t\tEffect.mapError((cause) =>\n\t\t\tsuiPluginError(\n\t\t\t\t'container-start',\n\t\t\t\t`sui local mode: failed to construct router URL for ${endpointName}: ${cause.detail}`,\n\t\t\t\tcause,\n\t\t\t),\n\t\t),\n\t);\n\nconst stringifyCause = (cause: unknown): string => {\n\tif (cause instanceof Error) return cause.message;\n\tif (typeof cause === 'string') return cause;\n\ttry {\n\t\treturn JSON.stringify(cause);\n\t} catch {\n\t\treturn String(cause);\n\t}\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAgGA,MAAa,8BAA8B,SAAS,QAAQ,GAAG;;;;;AAM/D,MAAa,sBAAsB;AAKnC,MAAM,qBAAqB;AAC3B,MAAM,wBAAwB;AAC9B,MAAM,yB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SACrB;AACP,SAAO,OAAO,MAAM"}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { chainId } from "../../../substrate/brand.mjs";
|
|
2
|
+
import { suiPluginError } from "../errors.mjs";
|
|
3
|
+
import { waitForHttpEndpoint } from "../../../substrate/runtime/http-probe.mjs";
|
|
4
|
+
import { makeSuiChainProbe } from "../chain-probe.mjs";
|
|
5
|
+
import { toDockerHostGatewayUrl } from "./shared.mjs";
|
|
6
|
+
import { Duration, Effect, Ref } from "effect";
|
|
7
|
+
//#region src/plugins/sui/mode/shared-boot.ts
|
|
8
|
+
/** Default chain-id fetch timeout. The wire latency is the dominant
|
|
9
|
+
* cost on real RPCs; 30 s is the documented ceiling. */
|
|
10
|
+
const DEFAULT_CHAIN_ID_TIMEOUT = Duration.seconds(30);
|
|
11
|
+
/** Fetch the chain identifier off a constructed grpc client. The
|
|
12
|
+
* result is the bare string that downstream cache layers fold into
|
|
13
|
+
* their state-store keys. */
|
|
14
|
+
const fetchChainId = (sdkClient, opts) => {
|
|
15
|
+
const timeout = opts?.timeout ?? DEFAULT_CHAIN_ID_TIMEOUT;
|
|
16
|
+
const timeoutMs = Duration.toMillis(timeout);
|
|
17
|
+
return Effect.tryPromise({
|
|
18
|
+
try: (signal) => sdkClient.ledgerService.getServiceInfo({}, {
|
|
19
|
+
abort: signal,
|
|
20
|
+
timeout: timeoutMs
|
|
21
|
+
}).response.then((response) => {
|
|
22
|
+
if (!response.chainId) throw new Error("Chain identifier not found in service info");
|
|
23
|
+
return response.chainId;
|
|
24
|
+
}),
|
|
25
|
+
catch: (cause) => suiPluginError("chain-id-fetch", `sui chain-id fetch failed: ${stringifyCause(cause)}`, cause)
|
|
26
|
+
}).pipe(Effect.timeoutOrElse({
|
|
27
|
+
duration: timeout,
|
|
28
|
+
orElse: () => Effect.fail(suiPluginError("chain-id-fetch", `sui chain-id fetch did not respond within ${timeoutMs}ms`))
|
|
29
|
+
}), Effect.tap((id) => Effect.annotateCurrentSpan({ "sui.chain": id })), Effect.withSpan(opts?.span ?? "devstack.plugin.sui.fetchChainId"));
|
|
30
|
+
};
|
|
31
|
+
/** Per-attempt and total budget for the `waitForTransactionsReady`
|
|
32
|
+
* retry loop. The 2 s spacing matches the upstream sui-faucet's
|
|
33
|
+
* internal cadence; the 90 s ceiling matches the v3 service's
|
|
34
|
+
* documented wall-clock. */
|
|
35
|
+
const FUNDS_READY_RETRY_SPACING = Duration.seconds(2);
|
|
36
|
+
const FUNDS_READY_TIMEOUT = Duration.seconds(90);
|
|
37
|
+
/** Per-fetch deadline for the faucet probe POST. Bounded short so
|
|
38
|
+
* the outer retry loop hammers quickly. */
|
|
39
|
+
const PROBE_FETCH_TIMEOUT_MS = 3e3;
|
|
40
|
+
/** Probe recipient for the faucet funds-ready check. A literal
|
|
41
|
+
* zero-balance address so the real call doesn't pollute caller wallets;
|
|
42
|
+
* any well-formed address works. */
|
|
43
|
+
const FAUCET_PROBE_RECIPIENT = "0x0000000000000000000000000000000000000000000000000000000000000001";
|
|
44
|
+
/**
|
|
45
|
+
* Build the funds-transferable gate against a real HTTP faucet.
|
|
46
|
+
* Memoised — first successful resolution sticks for the scope; the
|
|
47
|
+
* manual `invalidate` surface clears the memo so long-running
|
|
48
|
+
* supervisors can re-probe without a full restart.
|
|
49
|
+
*/
|
|
50
|
+
const buildWaitForTransactionsReady = (faucetUrl, opts) => Effect.gen(function* () {
|
|
51
|
+
const retrySpacing = opts?.retrySpacing ?? FUNDS_READY_RETRY_SPACING;
|
|
52
|
+
const timeout = opts?.timeout ?? FUNDS_READY_TIMEOUT;
|
|
53
|
+
const ref = yield* Ref.make(null);
|
|
54
|
+
const makeProbe = () => waitForHttpEndpoint({
|
|
55
|
+
endpoint: `${faucetUrl}/v2/gas`,
|
|
56
|
+
timeoutMs: Duration.toMillis(timeout),
|
|
57
|
+
intervalMs: Duration.toMillis(retrySpacing),
|
|
58
|
+
requestTimeoutMs: PROBE_FETCH_TIMEOUT_MS,
|
|
59
|
+
requestInit: {
|
|
60
|
+
method: "POST",
|
|
61
|
+
headers: { "content-type": "application/json" },
|
|
62
|
+
body: JSON.stringify({ FixedAmountRequest: { recipient: FAUCET_PROBE_RECIPIENT } })
|
|
63
|
+
},
|
|
64
|
+
validate: async (response) => {
|
|
65
|
+
if (!response.ok) throw new Error(`faucet HTTP ${response.status}`);
|
|
66
|
+
const status = (await response.json()).status;
|
|
67
|
+
if (typeof status === "object" && status !== null && "Failure" in status) {
|
|
68
|
+
const failure = status.Failure;
|
|
69
|
+
throw new Error(`faucet body: Failure ${JSON.stringify(failure)}`);
|
|
70
|
+
}
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
}).pipe(Effect.mapError((cause) => suiPluginError("wait-funds-ready", `sui faucet at ${faucetUrl} did not become funds-transferable within ${Duration.toMillis(timeout)}ms (still returning body-level Failure or 5xx): ` + stringifyCause(cause), cause)));
|
|
74
|
+
return {
|
|
75
|
+
wait: Effect.gen(function* () {
|
|
76
|
+
const existing = yield* Ref.get(ref);
|
|
77
|
+
if (existing !== null) return existing;
|
|
78
|
+
const cached = yield* Effect.cached(makeProbe());
|
|
79
|
+
yield* Ref.set(ref, cached);
|
|
80
|
+
return cached;
|
|
81
|
+
}).pipe(Effect.flatMap((eff) => eff)),
|
|
82
|
+
invalidate: Ref.set(ref, null)
|
|
83
|
+
};
|
|
84
|
+
});
|
|
85
|
+
/** Trivially-succeeding gate. Used by faucet-less networks (live
|
|
86
|
+
* mainnet, fork — fork funds via impersonation, not HTTP). */
|
|
87
|
+
const noopWaitForTransactionsReady = {
|
|
88
|
+
wait: Effect.void,
|
|
89
|
+
invalidate: Effect.void
|
|
90
|
+
};
|
|
91
|
+
const SUI_RPC_READ_TIMEOUT_MS = 1e4;
|
|
92
|
+
const postJsonRpc = async (rpcUrl, method, params) => {
|
|
93
|
+
const controller = new AbortController();
|
|
94
|
+
const timeout = setTimeout(() => controller.abort(), SUI_RPC_READ_TIMEOUT_MS);
|
|
95
|
+
timeout.unref?.();
|
|
96
|
+
try {
|
|
97
|
+
const response = await fetch(rpcUrl, {
|
|
98
|
+
method: "POST",
|
|
99
|
+
headers: { "content-type": "application/json" },
|
|
100
|
+
body: JSON.stringify({
|
|
101
|
+
jsonrpc: "2.0",
|
|
102
|
+
id: 1,
|
|
103
|
+
method,
|
|
104
|
+
params
|
|
105
|
+
}),
|
|
106
|
+
signal: controller.signal
|
|
107
|
+
});
|
|
108
|
+
if (!response.ok) throw new Error(`Sui RPC HTTP ${response.status}`);
|
|
109
|
+
const payload = await response.json();
|
|
110
|
+
if (payload.error !== void 0) throw new Error(payload.error.message ?? JSON.stringify(payload.error));
|
|
111
|
+
if (payload.result === void 0) throw new Error(`Sui RPC ${method} returned no result`);
|
|
112
|
+
return payload.result;
|
|
113
|
+
} finally {
|
|
114
|
+
clearTimeout(timeout);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
const normalizeJsonOwner = (owner) => {
|
|
118
|
+
if (owner === "Immutable") return {
|
|
119
|
+
$kind: "Immutable",
|
|
120
|
+
Immutable: true
|
|
121
|
+
};
|
|
122
|
+
if (typeof owner !== "object" || owner === null) return {
|
|
123
|
+
$kind: "Unknown",
|
|
124
|
+
Unknown: owner
|
|
125
|
+
};
|
|
126
|
+
const record = owner;
|
|
127
|
+
if (typeof record.AddressOwner === "string") return {
|
|
128
|
+
$kind: "AddressOwner",
|
|
129
|
+
AddressOwner: record.AddressOwner
|
|
130
|
+
};
|
|
131
|
+
if (record.ObjectOwner !== void 0) return {
|
|
132
|
+
$kind: "Parent",
|
|
133
|
+
Parent: record.ObjectOwner
|
|
134
|
+
};
|
|
135
|
+
if (record.Shared !== void 0) {
|
|
136
|
+
const initialSharedVersion = record.Shared.initialSharedVersion ?? record.Shared.initial_shared_version;
|
|
137
|
+
return {
|
|
138
|
+
$kind: "Shared",
|
|
139
|
+
Shared: { initialSharedVersion: String(initialSharedVersion) }
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
if (record.ConsensusAddressOwner !== void 0) return {
|
|
143
|
+
$kind: "ConsensusAddressOwner",
|
|
144
|
+
ConsensusAddressOwner: record.ConsensusAddressOwner
|
|
145
|
+
};
|
|
146
|
+
return {
|
|
147
|
+
$kind: "Unknown",
|
|
148
|
+
Unknown: owner
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
const getObjectViaJsonRpc = async (rpcUrl, args) => {
|
|
152
|
+
const showContent = args.include?.content === true || args.include?.json === true;
|
|
153
|
+
const data = (await postJsonRpc("" + rpcUrl, "sui_getObject", [args.objectId, {
|
|
154
|
+
showType: true,
|
|
155
|
+
showOwner: true,
|
|
156
|
+
showContent
|
|
157
|
+
}])).data;
|
|
158
|
+
if (data?.objectId === void 0) throw new Error(`object ${args.objectId} not found`);
|
|
159
|
+
const object = {
|
|
160
|
+
objectId: data.objectId,
|
|
161
|
+
version: String(data.version ?? ""),
|
|
162
|
+
type: data.type ?? "unknown",
|
|
163
|
+
owner: normalizeJsonOwner(data.owner),
|
|
164
|
+
...args.include?.json === true ? { json: data.content?.fields } : {},
|
|
165
|
+
...args.include?.content === true ? { content: data.content } : {}
|
|
166
|
+
};
|
|
167
|
+
return {
|
|
168
|
+
...object,
|
|
169
|
+
object
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
/** Build the `SuiSdkShim` over a constructed grpc client.
|
|
173
|
+
* Account/Coin/Wallet read through this seam, so we expose
|
|
174
|
+
* `executeTransaction` + `waitForTransaction` in addition to the
|
|
175
|
+
* read methods needed by the chain probe. */
|
|
176
|
+
const makeSdkShim = (sdkClient, rpcUrl) => ({
|
|
177
|
+
core: {
|
|
178
|
+
getObject: (args) => getObjectViaJsonRpc(rpcUrl, args),
|
|
179
|
+
getTransaction: (args) => sdkClient.core.getTransaction(args),
|
|
180
|
+
getBalance: (args) => sdkClient.core.getBalance(args),
|
|
181
|
+
listCoins: (args) => sdkClient.core.listCoins(args),
|
|
182
|
+
executeTransaction: (args) => sdkClient.executeTransaction({
|
|
183
|
+
transaction: args.transaction,
|
|
184
|
+
signatures: [...args.signatures],
|
|
185
|
+
...args.include !== void 0 ? { include: args.include } : {}
|
|
186
|
+
}),
|
|
187
|
+
waitForTransaction: (args) => sdkClient.waitForTransaction({
|
|
188
|
+
digest: args.digest,
|
|
189
|
+
...args.timeout !== void 0 ? { timeout: args.timeout } : {}
|
|
190
|
+
})
|
|
191
|
+
},
|
|
192
|
+
client: sdkClient
|
|
193
|
+
});
|
|
194
|
+
/** Assemble a `SuiClient` from the per-mode building blocks. The
|
|
195
|
+
* `fork: null` discriminator is invariant for non-fork modes; the
|
|
196
|
+
* fork builder constructs its own client with the admin surface.
|
|
197
|
+
*
|
|
198
|
+
* `chain` is accepted as a bare string and branded to `ChainId` at
|
|
199
|
+
* this single boundary — every consumer downstream reads the
|
|
200
|
+
* branded shape so capability-key constructors (`chainProbe…`,
|
|
201
|
+
* `faucet…`) accept it without a cast. */
|
|
202
|
+
const assembleSuiClient = (parts) => {
|
|
203
|
+
const sdkShim = makeSdkShim(parts.sdkClient, parts.sdkRpcUrl ?? parts.rpcUrl);
|
|
204
|
+
const chainProbe = makeSuiChainProbe(sdkShim, parts.chain);
|
|
205
|
+
return {
|
|
206
|
+
client: {
|
|
207
|
+
sdk: sdkShim,
|
|
208
|
+
rpcUrl: parts.rpcUrl,
|
|
209
|
+
faucetUrl: parts.faucetUrl ?? null,
|
|
210
|
+
fundingFaucetUrl: parts.fundingFaucetUrl ?? parts.faucetUrl ?? null,
|
|
211
|
+
graphqlUrl: parts.graphqlUrl ?? null,
|
|
212
|
+
hostGateway: parts.hostGateway ?? {
|
|
213
|
+
rpcUrl: toDockerHostGatewayUrl(parts.rpcUrl),
|
|
214
|
+
faucetUrl: parts.faucetUrl === void 0 ? null : toDockerHostGatewayUrl(parts.faucetUrl),
|
|
215
|
+
graphqlUrl: parts.graphqlUrl === void 0 ? null : toDockerHostGatewayUrl(parts.graphqlUrl)
|
|
216
|
+
},
|
|
217
|
+
chain: chainId(parts.chain),
|
|
218
|
+
waitForTransactionsReady: parts.waitForTransactionsReady,
|
|
219
|
+
chainProbe,
|
|
220
|
+
fork: null,
|
|
221
|
+
buildImage: parts.buildImage ?? null
|
|
222
|
+
},
|
|
223
|
+
sdkShim,
|
|
224
|
+
chainProbe
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
/** Shape the resolved network record the boot builders all hand
|
|
228
|
+
* back. The substrate-network mapping is uniform per mode. Brands
|
|
229
|
+
* the raw chain string at this boundary so consumers downstream
|
|
230
|
+
* (codegen, capabilities, walrus/seal deps) read a `ChainId` and
|
|
231
|
+
* don't re-wrap. */
|
|
232
|
+
const makeResolvedNetwork = (parts) => ({
|
|
233
|
+
mode: parts.mode,
|
|
234
|
+
chain: chainId(parts.chain),
|
|
235
|
+
rpc: parts.rpc,
|
|
236
|
+
source: parts.source,
|
|
237
|
+
...parts.faucet !== void 0 ? { faucet: parts.faucet } : {},
|
|
238
|
+
...parts.graphql !== void 0 ? { graphql: parts.graphql } : {},
|
|
239
|
+
...parts.checkpoint !== void 0 ? { checkpoint: parts.checkpoint } : {},
|
|
240
|
+
...parts.forkUpstream !== void 0 ? { forkUpstream: parts.forkUpstream } : {}
|
|
241
|
+
});
|
|
242
|
+
const stringifyCause = (cause) => {
|
|
243
|
+
if (cause instanceof Error) return cause.message;
|
|
244
|
+
if (typeof cause === "string") return cause;
|
|
245
|
+
try {
|
|
246
|
+
return JSON.stringify(cause);
|
|
247
|
+
} catch {
|
|
248
|
+
return String(cause);
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
//#endregion
|
|
252
|
+
export { assembleSuiClient, buildWaitForTransactionsReady, fetchChainId, makeResolvedNetwork, noopWaitForTransactionsReady };
|
|
253
|
+
|
|
254
|
+
//# sourceMappingURL=shared-boot.mjs.map
|