Welcome to your new rgbonic project and to the internet computer development community. By default, creating a new project adds this README and some template files to your project directory. You can edit these template files to customize your project and to include your own code to speed up the development cycle.
To get started, you might want to explore the project directory structure and the default configuration file. Working with this project in your development environment will not affect any production deployment or identity tokens.
To learn more before you start working with rgbonic, see the following documentation available online:
- Quick Start
- SDK Developer Tools
- Rust Canister Development Guide
- ic-cdk
- ic-cdk-macros
- Candid Introduction
If you want to start working on your project right away, you might want to try the following commands:
cd rgbonic/
dfx help
dfx canister --help
If you want to test your project locally, you can use the following commands:
# Clone the `wasm-forge/wasi2ic` project:
git clone https://github.com/wasm-forge/wasi2ic
## Enter the wasi2ic directory and install it
cd wasi2ic
cargo install --path .
# Starts the replica, running in the background
dfx start --background
# Compile the project with `wasm-wasi` inside the project folder
cargo build --release --target wasm32-wasi
# or
just build_wallet
# Translate `wasm32-wasi` target to wasm32-unknown-unknown` under the project directory
wasi2ic ./target/wasm32-wasi/release/wallet.wasm wallet.wasm
# or
just translate_wasm
# Create canister for `wallet` if first time
dfx canister create wallet
# Install the new wasm file to IC canister with `regtest` or `testnet` or `mainnet`
dfx canister install --mode reinstall --wasm wallet.wasm wallet --argument '("regtest")'
# or
just install wallet
# Call the canister to verify
dfx canister call wallet greet "人生只有一件事:修"
Once the job completes, your application will be available at http://localhost:4943?canisterId={asset_canister_id}
.
If you are hosting frontend code somewhere without using DFX, you may need to make one of the following adjustments to ensure your project does not fetch the root key in production:
- set
DFX_NETWORK
toic
if you are using Webpack - use your own preferred method to replace
process.env.DFX_NETWORK
in the autogenerated declarations- Setting
canisters -> {asset_canister_id} -> declarations -> env_override to a string
indfx.json
will replaceprocess.env.DFX_NETWORK
with the string in the autogenerated declarations
- Setting
- Write your own
createActor
constructor