pub struct Profile {
pub url: Url,
pub pid: PrincipalId,
pub aid: AccountId,
pub nickname: Nickname,
pub desc: Description,
pub level: Level,
pub state: State,
}
update method in candid type, just input your nickname(string) then you can see it in main page.
dfx canister call ic_portal_canisters register '("Jack")'
update method in candid type, the user need to input image url.
dfx canister call ic_portal_canisters set_url '("www.ipfs.com")'
update method in candid type, the user need to input nickname(string) and description(string) to update the old one.
dfx canister call ic_portal_canisters update '("Bod", "Bod is marching on the road")'
update method in candid type, to set you profile description
dfx canister call ic_portal_canisters set_description '("Jack is coming")'
query method in candid type, to obtain the url
dfx canister call ic_portal_canisters get_url
query method in candid type, to obtain your profile description
dfx canister call ic_portal_canisters get_description
query method in candid type, to obtain your profile info about url, pid, aid, nickname, description, level, and state.
dfx canister call ic_portal_canisters get_profile
query method in candid type, to obtain your nickname when register.
dfx canister call ic_portal_canisters get_nickname
query method in candid type, to obtain your nickname, it will be initialized to null string.
dfx canister call ic_portal_canisters get_level
query method in candid type, to obtain your current state, it will be initialized to "online"
dfx canister call ic_portal_canisters get_state
update method in candid type, to add a friend information with principal id in profile contract
dfx canister call ic_portal_canisters add '("principal of friend")'
update method in candid type, to delete a friend information with principal of friend
dfx canister call ic_portal_canisters delete '("principal of friend")'
query method in candid type, to display all friend list of current user
dfx canister call ic_portal_canisters display
update method in candid type, to clear friend list of current user
dfx canister call ic_portal_canisters clear
If you want to start working on your project right away, you might want to try the following commands:
cd ic_portal_canisters/
dfx help
dfx config --help
If you want test your project upgradable, please ensure that wasam has been change
dfx build ic_portal_canisters
dfx canister install ic_portal_canisters --mode=upgrade
If you want to test your project locally, you can use the following commands:
# Starts the replica, running in the background
dfx start --background
# Deploys your canisters to the replica and generates your candid interface
dfx deploy
dev asjdw-4qaaa-aaaah-abboq-cai test ygrqs-jyaaa-aaaah-abihq-cai product zdldy-bqaaa-aaaah-abdqq-cai
when you have installed rust, if you test in local environment, first run 'dfx start --background', before run 'dfx deploy', remember to run 'rustup target add wasm32-unknown-unknown' when you done this, everythig is going to be ok.