ETH开发
文章平均质量分 66
详细记录一款DAPP开发中遇到的问题
1n2y
这个作者很懒,什么都没留下…
展开
-
使用ganache实现Web3js和区块链交互的步骤 及问题解决:Command ‘express’ not found等
成功后使用 express -e MyDapp;npm install下载默认。启动成功后连接到127.0.0.1:3000;观察到获取了账户和余额,成功实现交互。修改完毕后可以尝试启动(要在ganache启动的情况下实现交互)npm start。而后 npm start;浏览器中输入127.0.0.1:3000,出现。2.本地安装web3 sudo npm install web3 -save。出现问题:Command ‘express’ not found,1.express安装。原创 2024-04-30 18:22:35 · 1245 阅读 · 3 评论 -
Ganache 解决 Could not install from as it does not contain a package.json file Web3 is not constructor
询问gpt得知,报错的原因是因为在Linux环境中Node.js默认不支持ES6中的可选链操作符(?.),这导致无法正确解析这段代码。使用上述代码后仍然报错,但此时问题并非ES语法问题,经查阅后发现而是web3版本不同所致。但在这一步的操作中,本人的ganache被重新安装,成功打开ganache-cli。问题:Web3 is not a constructor。console.log(“账户列表地址:”);修改: 测试能否成功打印所有账户。显示:ganache@1.0.0。我们先查找安装路径 输入。原创 2024-04-29 20:31:44 · 906 阅读 · 0 评论 -
Geth 命令miner.start()报错 (待更新)
此时报错:Error: etherbase missing: etherbase must be explicitly specified at web3.js:6367:9(39) at send (web3.js:5101:62(29)) at <eval>:1:12(2)1.运行miner.start() 显示null ,并且竟然自动退出控制台,且不能输入字符;此时运行miner.start() 显示null ,并且竟然自动退出控制台,4)而后执行挖矿启动命令 miner.start()原创 2024-04-28 20:27:47 · 329 阅读 · 2 评论 -
eth开发之geth篇:解决 flag provided but not defined: -rpc、personal is not defined、geth/LOCK 等诸多问题!
解决使用geth时出现的诸多问题原创 2024-04-22 21:48:23 · 688 阅读 · 2 评论 -
解决geth配置时遇到问题 Fatal: Failed to read genesis file: open genesis.json: permission denied
Fatal: failed to write genesis block: genesis has no chain configuration :这个错误信息,就是说,你的json文件中,缺少config部分。Fatal: invalid genesis file: hex string has odd length: 从v1.6开始,设置的十六进制数值,不能是奇数位, 比如不能是0x0,而应该是0x00。这个问题应为,所查看的教程中并没有前置的客户端节点配置命令。猜测是geth版本问题,尝试更新。原创 2024-04-16 21:45:00 · 586 阅读 · 3 评论