Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Near Protocol FunctionCallError(MethodResolveError(MethodNotFound))

I'm new in blockchain, smart contract and near protocol. I'm trying to learn from https://near.academy/ . There's a sample contract on testnet : museum.testnet.

I'm using windows and i installed wsl2.

I can login with near login command. But after that, when i called near view museum.testnet getmemecount command its giving me error below. Can anyone help me on this?

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
}
like image 484
Hüseyin Çınar Avatar asked Sep 28 '21 20:09

Hüseyin Çınar


Video Answer


1 Answers

The method name is get_meme_count, not getmemecount. See the source code of the museum here.

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

Does some part of near academy mention it as getmemecount?

like image 84
Ishamael Avatar answered Oct 19 '22 20:10

Ishamael