一步步实现逻辑并在主网部署你的 demo.
dfx new demo_mo
- delete asset & motify config
dfx.json
- add code and explain logic and related libraries
- new a canister in IC, add config
canister_ids.json
- deploy on IC
- get result in explore, https://fesla-yiaaa-aaaah-aa4na-cai.raw.ic0.app/, dfx query
dfx canister --network ic --no-wallet call demo_mo allBalances --query dfx identity use alice dfx identity get-principal ktfx3-4dj7o-f4lqf-gab56-fgkuw-aagt6-jzpkd-o7xzp-f6a3p-nm6wl-wae dfx identity use bob dfx identity get-principal yd5hv-nayum-igkpt-jtrhr-aqfqq-pfkxn-fyxvh-yryn3-rez4o-p6vks-hqe dfx identity use icp dfx identity get-principal yhy6j-huy54-mkzda-m26hc-yklb3-dzz4l-i2ykq-kr7tx-dhxyf-v2c2g-tae
- dfx call (userA -> alice 100, alice -> bob 50, bob -> userA 200 (failed))
dfx canister --network ic --no-wallet call demo_mo transfer '(principal "ktfx3-4dj7o-f4lqf-gab56-fgkuw-aagt6-jzpkd-o7xzp-f6a3p-nm6wl-wae", 100)' dfx canister --network ic --no-wallet call demo_mo transfer '(principal "yd5hv-nayum-igkpt-jtrhr-aqfqq-pfkxn-fyxvh-yryn3-rez4o-p6vks-hqe", 50)' dfx canister --network ic --no-wallet call demo_mo transfer '(principal "yhy6j-huy54-mkzda-m26hc-yklb3-dzz4l-i2ykq-kr7tx-dhxyf-v2c2g-tae", 200)
- get result in explore, dfx query
dfx canister --network ic --no-wallet call demo_mo allBalances --query
- delete allBalance, upgrade, get result in explore, https://b4e6x-kaaaa-aaaah-aa4uq-cai.raw.ic0.app/
sudo dfx build --network ic
sudo dfx canister --no-wallet --network ic install demo_mo -m=upgrade
cargo new demo_rs
- add config
dfx.json
- add code and explain logic and related libraries
- new a canister in IC, add config
canister_ids.json
- deploy on IC
dfx canister --no-wallet --network ic install demo_rs
- get result in explore, dfx query
dfx canister --network ic --no-wallet call demo_rs transfer '(principal "ktfx3-4dj7o-f4lqf-gab56-fgkuw-aagt6-jzpkd-o7xzp-f6a3p-nm6wl-wae", 100)'