近协议函数调用错误(MethodResolveError(MethodNotFound))

Near Protocol FunctionCallError(MethodResolveError(MethodNotFound))

我是区块链、智能合约和准协议方面的新手。我正在尝试向 https://near.academy/ 学习。 testnet 上有一个示例合约:museum.testnet.

我正在使用 windows 并且我安装了 wsl2。

我可以登录 near login 命令。但在那之后,当我调用 near view museum.testnet getmemecount 命令时,它在下面给我错误。谁能帮我解决这个问题?

View call: museum.testnet.getmemecount()
An error occured
Error: Querying [object Object] failed: wasm execution failed with error: FunctionCallError(MethodResolveError(MethodNotFound)).
{
  "block_hash": "SZv8UsCeNXLkhjPa9KeZY6xJXmKNb6MLyKXqHVddiT5",
  "block_height": 65109663,
  "error": "wasm execution failed with error: FunctionCallError(MethodResolveError(MethodNotFound))",
  "logs": []
}

    at JsonRpcProvider.query (/home/cinar/.nvm/versions/node/v14.18.0/lib/node_modules/near-cli/node_modules/near-api-js/lib/providers/json-rpc-provider.js:116:19)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Account.viewFunction (/home/cinar/.nvm/versions/node/v14.18.0/lib/node_modules/near-cli/node_modules/near-api-js/lib/account.js:351:24)
    at async exports.callViewFunction (/home/cinar/.nvm/versions/node/v14.18.0/lib/node_modules/near-cli/index.js:75:48)
    at async Object.handler (/home/cinar/.nvm/versions/node/v14.18.0/lib/node_modules/near-cli/utils/exit-on-error.js:52:9)
TypedError: Querying [object Object] failed: wasm execution failed with error: FunctionCallError(MethodResolveError(MethodNotFound)).
{
  "block_hash": "SZv8UsCeNXLkhjPa9KeZY6xJXmKNb6MLyKXqHVddiT5",
  "block_height": 65109663,
  "error": "wasm execution failed with error: FunctionCallError(MethodResolveError(MethodNotFound))",
  "logs": []
}
    at JsonRpcProvider.query (/home/cinar/.nvm/versions/node/v14.18.0/lib/node_modules/near-cli/node_modules/near-api-js/lib/providers/json-rpc-provider.js:116:19)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Account.viewFunction (/home/cinar/.nvm/versions/node/v14.18.0/lib/node_modules/near-cli/node_modules/near-api-js/lib/account.js:351:24)
    at async exports.callViewFunction (/home/cinar/.nvm/versions/node/v14.18.0/lib/node_modules/near-cli/index.js:75:48)
    at async Object.handler (/home/cinar/.nvm/versions/node/v14.18.0/lib/node_modules/near-cli/utils/exit-on-error.js:52:9) {
  type: 'UntypedError',
  context: undefined
}

方法名称是get_meme_count,不是getmemecount。看博物馆源码here.

$ near view museum.testnet get_meme_count
View call: museum.testnet.get_meme_count()
67

near academy 有没有提到getmemecount