关于使用web3.js接口报错问题

1、web3.php Error: The method personal_newAccount does not exist/is not available

只需要在geth启动时的rpc参数中设置rpcapi时包括 “personal” 即可。

geth --rpc --rpcaddr 0.0.0.0 --rpcport 8545 --rpcapi eth,web3,admin,personal,net

2、web3.eth.sendTransaction调用报错“Error: authentication needed: password or unlock”

只需要将from账户解锁即可:web3.personal.unlockAccount(web3.eth.accounts[0],"你的密码");

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容