Skip to content

Migrate funnAI from dfx to icp-cli - #172

Open
icppWorld wants to merge 29 commits into
masterfrom
migrate-dfx-to-icp-cli
Open

Migrate funnAI from dfx to icp-cli#172
icppWorld wants to merge 29 commits into
masterfrom
migrate-dfx-to-icp-cli

Conversation

@icppWorld

Copy link
Copy Markdown
Collaborator

dfx is deprecated; icp-cli is its successor. This migrates the frontend, the ops scripts and the runbooks, and adds a full local end-to-end environment.

120 files, +7053 / −2561, 27 commits. Companion to onicai/PoAIW#158 — merge that one first: the e2e harness shells into PoAIW and needs its build artifacts.

What changed

area before after
project config dfx.json, canister_ids.json 3 × icp.yaml (root, src/funnai_backend, e2e), gateway.port: 0
canister ids canister_ids.json .icp/data/mappings/<env>.ids.json (committed)
ops scripts dfx hardcoded in ~40 Python files one shared helper, scripts/lib/icp_helpers.py
shell scripts 11 files calling dfx icp-cli
runbooks 392 dfx commands 0
local testing none scripts/e2e/harness.py — the whole app on one local network

scripts/lib/icp_helpers.py

The single biggest structural win: ~40 files that each shelled out to dfx directly now go through one module. It also carries a mainnet write guard — writes to prd/testing/development/demo/backup/ic raise unless ICP_ALLOW_MAINNET_WRITES=1, with tests in scripts/test/test_icp_helpers_guard.py.

Two behaviour differences it absorbs: icp-cli has no --output json (decoding is now client-side via icp-py-core), and it does not inherit dfx's active identity.

Local end-to-end

scripts/e2e/harness.py stands up every canister on one icp-cli network and buys a ShareAgent the way a real player does — pay ICP to GameState, GameState asks mAInerCreator to create the canister through the CMC. The CMC and ICP ledger run at their mainnet canister ids on the local replica, so the code paths are the production ones; the ICP and cycles are local test funds on a throwaway network. Driven by make e2e-start-clean / e2e-install / e2e-test.

One deliberate dfx dependency

scripts/upgrade_llms.py:190 still calls dfx sns prepare-canisters. icp-cli has no sns subcommand at all. Documented in the migration guide.

Docs

New: README-icp-cli.md (primer on projects/environments/networks — funnAI is 16 projects), README-developer-migration-guide-from-dfx-to-icp-cli.md (setup, identity migration, command translation, troubleshooting), README-operations.md. README-setup.md rewritten.

README-prd-upgrade-commands.md (321 references), README-prd-settings.md and the active notes are converted. The two dated deployment records under notes/ are deliberately not rewritten — they are logs of what was actually run at the time, so they get a "historical record — dfx era" banner instead.

Verification

  • PoAIW#158: 9/9 builds green, 9/9 smoke tests green (645 tests).
  • Mainnet untouched — the write guard is on and nothing here deploys.

Not in this PR

Redeploying mainnet onto icp-built wasms (see PoAIW/WASM-HASHES.md); a local FUNNAI token ledger in the e2e (ICP and cycles are covered, FUNNAI is not); moving the cycles wallet balance to the cycles ledger.

icppWorld added 29 commits July 31, 2026 15:31
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.

1 participant