I started develop in Motoko Programming Language. I try call function from my terminal but when I enter: dfx canister call dbankk_backend topUp
import Debug "mo:base/Debug";
actor Dbank {
var currentValue = 300;
currentValue := 100;
//like const variable
// let id = 534543546543;
//Debug.print(debug_show(currentValue));
public func topUp() {
currentValue += 2;
Debug.print(debug_show(currentValue));
};
// top();
}
But it says:
Error: Failed update call.
Caused by: Failed update call.
The Replica returned an error: code 3, message: "Canister ryjl3-tyaaa-aaaaa-aaaba-cai has no update method 'topUp'"
I expect to see in terminal that CurrentValue growing up in 2.
Try running
dfx deployand running the command again. The Canister was probably updated in the code but has not been deployed to make the changes, so the functiontopUphas not been compiled.