调用函数验证部署

现在你已经在本地网络部署了三个canister并且可以通过dfx canister call命令分别测试‌

测试步骤‌

  1. 使用dfx canister call命令调用assistant canister,使用addTodo函数并传递要添加的任务

    dfx canister call assistant addTodo '("Schedule monthly demos")'
  2. 使用showTodos函数验证命令返回的to-do list

    dfx canister call assistant showTodos

    命令输出

    ("___TO-DOs___(1) Schedule monthly demos")
  3. 使用dfx canister call命令调用rock_paper_scissors canister,使用contest函数

    dfx canister call rock_paper_scissors contest

    命令输出

    ("Bob won")
  4. 使用dfx canister call命令调用daemon canister,使用launch函数

    dfx canister call daemon launch
  5. 验证launch模拟函数返回“The daemon process is running”信息

    (""The daemon process is running"")

Last updated

Was this helpful?