web3.js解锁账户时,一直提示 cannot find key with given address
web3.js解锁账户的代码
web3.eth.personal.unlockAccount(account.address,account.privateKey,6000,(error,res) => {
console.log(error)
console.log(res)
})
第一个参数是账号地址,
第二个参数是私钥,
第三个参数是账户解锁有效时间。
运行结果提示:
Error: Returned error: cannot find key with given address 0x776Bd8F12D6C761f2bA147B4c5d0f217078DD4DE
at Object.ErrorResponse (E:\web\okchain\node_modules\web3-core-helpers\lib\errors.js:28:19)
at E:\web\okchain\node_modules\web3-core-requestmanager\lib\index.js:302:36
at XMLHttpRequest.request.onreadystatechange (E:\web\okchain\node_modules\web3-providers-http\lib\index.js:98:13)
at XMLHttpRequestEventTarget.dispatchEvent (E:\web\okchain\node_modules\xhr2-cookies\dist\xml-http-request-event-target.js:34:22)
at XMLHttpRequest._setReadyState (E:\web\okchain\node_modules\xhr2-cookies\dist\xml-http-request.js:208:14)
at XMLHttpRequest._onHttpResponseEnd (E:\web\okchain\node_modules\xhr2-cookies\dist\xml-http-request.js:318:14)
at IncomingMessage.<anonymous> (E:\web\okchain\node_modules\xhr2-cookies\dist\xml-http-request.js:289:61)
at IncomingMessage.emit (events.js:327:22)
at endReadableNT (_stream_readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
data: null
}
账号是对的 ,私钥也是对的,但提示错误是找不到对应的私钥
求大佬解答呀
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论