Skip to content

Commit dc02375

Browse files
authored
fix(rust/receiving-icp): rename staging→ic, drop production environment (#1425)
Aligns with the icp-cli convention used in basic_ethereum: - staging → ic (standard environment name for ICP mainnet deployments) - production removed; a comment in icp.yaml explains how to adapt ICP_LEDGER_CANISTER_ID for the real ICP ledger README updated: table now shows ic instead of staging/production, deploy command is icp deploy -e ic, production guidance points to icp.yaml comment.
1 parent 8f077c8 commit dc02375

2 files changed

Lines changed: 17 additions & 21 deletions

File tree

‎rust/receiving-icp/README.md‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ The ICP ledger canister ID is configured via `icp.yaml` and read at runtime as a
1111
| Environment | Ledger | Canister ID |
1212
|---|---|---|
1313
| `local` | ICP ledger (pre-deployed by icp-cli) | `ryjl3-tyaaa-aaaaa-aaaba-cai` |
14-
| `staging` | TESTICP ledger | `xafvr-biaaa-aaaai-aql5q-cai` |
15-
| `production` | ICP ledger (mainnet) | `ryjl3-tyaaa-aaaaa-aaaba-cai` |
14+
| `ic` | TESTICP ledger | `xafvr-biaaa-aaaai-aql5q-cai` |
1615

17-
The local environment uses the same principal as production because icp-cli's local network pre-deploys the ICP ledger at that well-known address. Staging uses the TESTICP ledger so you can test token flows without spending real ICP.
16+
The local environment uses the same canister ID as the mainnet ICP ledger because icp-cli's local network pre-deploys it at that well-known address. The `ic` environment uses the TESTICP ledger so you can test token flows on ICP mainnet without spending real ICP.
17+
18+
For a production deployment using the real ICP ledger, update `ICP_LEDGER_CANISTER_ID` in `icp.yaml` to `ryjl3-tyaaa-aaaaa-aaaba-cai` — see the comment in `icp.yaml` for the exact change.
1819

1920
## Build and deploy from the command line
2021

@@ -41,16 +42,14 @@ icp network stop
4142

4243
`bash test.sh` runs 7 tests: account identifier format, subaccount uniqueness, funding the main account and a specific subaccount via account ID hex, balance queries, and subaccount independence. Tests are delta-based and idempotent across re-runs.
4344

44-
### Deploy to staging or production
45+
### Deploy to ICP mainnet
4546

4647
```bash
47-
# Staging — targets the TESTICP ledger
48-
icp deploy --environment staging
49-
50-
# Production — targets the mainnet ICP ledger
51-
icp deploy --environment production
48+
icp deploy -e ic
5249
```
5350

51+
This targets the TESTICP ledger by default. To use the real ICP ledger, update `ICP_LEDGER_CANISTER_ID` in `icp.yaml` first.
52+
5453
## Security considerations and best practices
5554

5655
Refer to the [security best practices](https://docs.internetcomputer.org/guides/security/overview) for information on security and best practices for your ICP app.

‎rust/receiving-icp/icp.yaml‎

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,25 @@ canisters:
33
recipe:
44
type: "@dfinity/rust@v3.3.0"
55

6-
# ICP_LEDGER_CANISTER_ID is injected at deploy time by the recipe and baked
7-
# into the WASM. Deploy with `--environment staging` to target the TESTICP
8-
# ledger, or omit the flag to use the production ICP ledger (default for
9-
# both local and production).
6+
# ICP_LEDGER_CANISTER_ID is injected at deploy time and read at runtime via
7+
# ic_cdk::api::env_var_value("ICP_LEDGER_CANISTER_ID").
108
environments:
9+
# Local: icp-cli pre-deploys the ICP ledger at the well-known mainnet address.
1110
- name: local
1211
network: local
1312
settings:
1413
backend:
1514
environment_variables:
1615
ICP_LEDGER_CANISTER_ID: "ryjl3-tyaaa-aaaaa-aaaba-cai"
1716

18-
- name: staging
17+
# IC mainnet: uses the TESTICP ledger by default so you can test token flows
18+
# without spending real ICP.
19+
#
20+
# For a production deployment using the real ICP ledger, change
21+
# ICP_LEDGER_CANISTER_ID to "ryjl3-tyaaa-aaaaa-aaaba-cai".
22+
- name: ic
1923
network: ic
2024
settings:
2125
backend:
2226
environment_variables:
2327
ICP_LEDGER_CANISTER_ID: "xafvr-biaaa-aaaai-aql5q-cai"
24-
25-
- name: production
26-
network: ic
27-
settings:
28-
backend:
29-
environment_variables:
30-
ICP_LEDGER_CANISTER_ID: "ryjl3-tyaaa-aaaaa-aaaba-cai"

0 commit comments

Comments
 (0)