Skip to content

[WIP} proposed plan for cross-environment publish and data consolidation - #56

Draft
fc-tezza wants to merge 2 commits into
mainfrom
refactor/world-data-and-publish-consolidation
Draft

[WIP} proposed plan for cross-environment publish and data consolidation#56
fc-tezza wants to merge 2 commits into
mainfrom
refactor/world-data-and-publish-consolidation

Conversation

@fc-tezza

Copy link
Copy Markdown

Summary

This PR consolidates how deployed object IDs are tracked and populated across
all environments (localnet, testnet tenants - future devnet and mainnet tenants) in the builder scaffold.

Full implementation plan: data_consolidation_plan.md

Key changes

  • Rename deployments/localnet/extracted-object-ids.json
    deployment-ids.json — a more accurate name now that it holds both world
    and extension IDs
  • General publish scriptpnpm publish-extension --extension <name> --env <env>. It runs
    sui client publish, captures all relevant object IDs from the transaction
    output (driven by a per-extension publish.config.json), and writes them to
    deployment-ids.json in one atomic step. Any native sui client publish
    flags (e.g. --gas-budget) can be passed through.
  • populate-world-ids scriptpnpm populate-world-ids --env <env>
    becomes the single consistent mechanism for populating the world section of
    deployment-ids.json across all environments. It reads the world packageId
    from Pub.localnet.toml (localnet) or hardcoded constants from
    world-contracts Published.toml (testnet tenants), then queries the Sui
    GraphQL endpoint to discover the world shared objects. Replaces ad-hoc
    world ID extraction in the Docker / host setup flows.
  • DeploymentIds type — open index signature replaces the stale builder?
    key, allowing any extension to write its IDs under its own namespace key.
  • extension-ids.ts — reads IDs from deployment-ids.json first,
    falling back to BUILDER_PACKAGE_ID / EXTENSION_CONFIG_ID env vars for
    backward compatibility.

New developer workflow

# After world is deployed (Docker or host or by CCP on testnet):
pnpm populate-world-ids --env localnet

# Publish an extension and capture its IDs:
pnpm publish-extension --extension smart_gate_extension --env localnet

# Same commands work for testnet:
pnpm populate-world-ids --env testnet_stillness
pnpm publish-extension --extension smart_gate_extension --env testnet_utopia

@0xxlegolas

Copy link
Copy Markdown
Collaborator

This looks very clean.

just one suggestion, we can move publish.config.json per extension to a new folder instead of move-contracts if thats okay


- Thread `network: Network` parameter through `requireBuilderPackageId`, `resolveSmartGateExtensionIdsFromEnv`, `resolveSmartGateExtensionIds`
- Read `packageId` from `loadDeploymentIds(network)?.smart_gate_extension?.packageId`, fall back to `BUILDER_PACKAGE_ID` env var
- Read `extensionConfigId` from `loadDeploymentIds(network)?.smart_gate_extension?.extensionConfigId`, fall back to `EXTENSION_CONFIG_ID` env var

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we do the other way around to give env the first preference? check env first and fall back to the deployments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants