chore: add ic env + build-image.sh to motoko/basic_bitcoin#1429
Merged
Conversation
- 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>
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
approved these changes
Jul 8, 2026
mbjorkqvist
left a comment
Contributor
There was a problem hiding this comment.
Thanks @marc0olo! Just a couple of nits.
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>
raymondk
approved these changes
Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates
motoko/basic_bitcoinfrom dfx environments (staging/production) to a singleicenvironment, and replaces theMakefilewith dedicated shell scripts.Environment consolidation
staging+productionenvironments inicp.yamlwith a singleicenvironment using Bitcoin testnet4 andtest_key_1— the standard default for IC network deploymentsapp.moupdated to referenceicenv instead ofstaging/productionkey_1) for production deploymentsWhy a single
icenvironmenticp.ninja (and other tools) expect an environment named
icwhen deploying to the IC network. Usingtest_key_1+ testnet4 as the default is the safe choice — developers can optionally switch to mainnet by changing theinit_argsinicp.yaml, at which point the canister automatically selectskey_1.Tooling
Makefilewithbuild-image.sh(Docker image build) andtest.sh(end-to-end tests)bash test.shdirectlyTest plan
./build-image.shbuilds the Docker image successfullyicp network start -d && icp deploy --cycles 30t && bash test.shpasses locallyicp deploy -e ic --cycles 30tdeploys to IC against Bitcoin testnet4🤖 Generated with Claude Code