【问题标题】:Getting an error when trying to fetch keys from NEAR network via near-cli尝试通过 near-cli 从 NEAR 网络获取密钥时出错
【发布时间】:2021-01-10 04:42:51
【问题描述】:

运行命令时:near keys XXXXXXX.near 我收到以下错误,我预计near-cli 默认使用主网网络,但似乎有问题,因为它说没有帐户,但该帐户显然存在。

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
}

【问题讨论】:

标签: nearprotocol


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-06-17
    • 2020-03-01
    • 2022-10-17
    • 2021-02-10
    • 2013-07-01
    • 2021-12-03
    • 2021-12-19
    • 1970-01-01
    相关资源
    最近更新 更多