Skip to content

chore: add ic env + build-image.sh to motoko/basic_bitcoin#1429

Merged
raymondk merged 3 commits into
masterfrom
chore/update-motoko-basic-bitcoin-ic-env
Jul 9, 2026
Merged

chore: add ic env + build-image.sh to motoko/basic_bitcoin#1429
raymondk merged 3 commits into
masterfrom
chore/update-motoko-basic-bitcoin-ic-env

Conversation

@marc0olo

@marc0olo marc0olo commented Jul 8, 2026

Copy link
Copy Markdown
Member

Summary

Migrates motoko/basic_bitcoin from dfx environments (staging/production) to a single ic environment, and replaces the Makefile with dedicated shell scripts.

Environment consolidation

  • Replaces staging + production environments in icp.yaml with a single ic environment using Bitcoin testnet4 and test_key_1 — the standard default for IC network deployments
  • app.mo updated to reference ic env instead of staging/production
  • README updated to reflect the new environment and document how to switch to mainnet (key_1) for production deployments

Why a single ic environment

icp.ninja (and other tools) expect an environment named ic when deploying to the IC network. Using test_key_1 + testnet4 as the default is the safe choice — developers can optionally switch to mainnet by changing the init_args in icp.yaml, at which point the canister automatically selects key_1.

Tooling

  • Replaces the Makefile with build-image.sh (Docker image build) and test.sh (end-to-end tests)
  • CI updated to call bash test.sh directly

Test plan

  • ./build-image.sh builds the Docker image successfully
  • icp network start -d && icp deploy --cycles 30t && bash test.sh passes locally
  • icp deploy -e ic --cycles 30t deploys to IC against Bitcoin testnet4

🤖 Generated with Claude Code

- Replace staging/production environments with a single `ic` environment
  (Bitcoin testnet4, test_key_1) — the default for IC network deployments
- Add build-image.sh as a standalone alternative to `make build-image`
- Update README to reflect new environment structure and document how to
  switch to Bitcoin mainnet + key_1 for production deployments
- Update app.mo comments to reference `ic` env instead of `staging`/`production`

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@marc0olo marc0olo requested a review from a team as a code owner July 8, 2026 10:01
build-image is now covered by build-image.sh; the topup command is
documented inline in the README. Makefile is kept only for make test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@mbjorkqvist mbjorkqvist left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @marc0olo! Just a couple of nits.

Comment thread motoko/basic_bitcoin/Makefile
Comment thread motoko/basic_bitcoin/build-image.sh
The Makefile was the last remnant of the dfx-era tooling. Replace it
with a self-contained test.sh that matches the pattern used in
rust/basic_bitcoin:

- Polls get_utxos (not get_balance) for IC sync detection so that
  stale balance data from previous runs cannot produce a false positive
- Uses ^\([1-9] to match only non-zero Candid values (avoids matching
  digits in the 'nat64' type annotation)
- Replaces tip_height = 101 with a regex to work on repeated runs
- Adds || { sleep; continue; } to survive transient bitcoin canister
  rejections ("Canister state is not fully synced") without set -e
  killing the script

Update CI to call bash test.sh instead of make test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@marc0olo marc0olo requested a review from a team as a code owner July 9, 2026 08:25
@raymondk raymondk merged commit 9b1bbe2 into master Jul 9, 2026
6 checks passed
@raymondk raymondk deleted the chore/update-motoko-basic-bitcoin-ic-env branch July 9, 2026 13:35
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.

3 participants