首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >尝试通过near-cli从近距离网络获取密钥时出现错误

尝试通过near-cli从近距离网络获取密钥时出现错误
EN

Stack Overflow用户
提问于 2020-09-24 06:28:04
回答 1查看 44关注 0票数 0

当运行命令:near keys XXXXXXX.near时,我得到了下面的错误,我期望近cli默认使用主网网络,但似乎有一个问题,因为它说没有帐户,但帐户显然存在。

代码语言:javascript
复制
An error occured
TypedError: [-32000] Server error: account XXXXXX.near does not exist while viewing
    at JsonRpcProvider.sendJsonRpc (/usr/local/lib/node_modules/near-cli/node_modules/near-api-js/lib/providers/json-rpc-provider.js:158:27)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async JsonRpcProvider.query (/usr/local/lib/node_modules/near-cli/node_modules/near-api-js/lib/providers/json-rpc-provider.js:66:24)
    at async Account.fetchState (/usr/local/lib/node_modules/near-cli/node_modules/near-api-js/lib/account.js:47:23)
    at async Account.state (/usr/local/lib/node_modules/near-cli/node_modules/near-api-js/lib/account.js:54:9)
    at async Near.account (/usr/local/lib/node_modules/near-cli/node_modules/near-api-js/lib/near.js:41:9)
    at async exports.keys (/usr/local/lib/node_modules/near-cli/index.js:195:19)
    at async Object.handler (/usr/local/lib/node_modules/near-cli/utils/exit-on-error.js:39:9) {
  [stack]: 'Error: [-32000] Server error: account XXXXX.near does not exist while viewing\n' +
    '    at JsonRpcProvider.sendJsonRpc (/usr/local/lib/node_modules/near-cli/node_modules/near-api-js/lib/providers/json-rpc-provider.js:158:27)\n' +
    '    at processTicksAndRejections (internal/process/task_queues.js:97:5)\n' +
    '    at async JsonRpcProvider.query (/usr/local/lib/node_modules/near-cli/node_modules/near-api-js/lib/providers/json-rpc-provider.js:66:24)\n' +
    '    at async Account.fetchState (/usr/local/lib/node_modules/near-cli/node_modules/near-api-js/lib/account.js:47:23)\n' +
    '    at async Account.state (/usr/local/lib/node_modules/near-cli/node_modules/near-api-js/lib/account.js:54:9)\n' +
    '    at async Near.account (/usr/local/lib/node_modules/near-cli/node_modules/near-api-js/lib/near.js:41:9)\n' +
    '    at async exports.keys (/usr/local/lib/node_modules/near-cli/index.js:195:19)\n' +
    '    at async Object.handler (/usr/local/lib/node_modules/near-cli/utils/exit-on-error.js:39:9)',
  [message]: '[-32000] Server error: account XXXXXXX.near does not exist while viewing',
  type: 'UntypedError',
  context: undefined
}
EN

回答 1

Stack Overflow用户

发布于 2020-09-24 06:32:54

您必须将NODE_ENV=mainnet变量与近cli一起传递,以指定要连接到哪个networkId。这对我很有效,NODE_ENV=mainnet near keys account.near

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64037130

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档