blockchain - Truffle 迁移未部署到 Ganache
问题描述
我尝试了命令 truffle migrate --reset,但它无法连接到 Ganche,这是错误:
这是 truufle-config.js 文件中的代码:
这些是 RPC 服务器的详细信息:
解决方案
您的truffle-config.js
:post
而不是port
.
试试这个:
networks: {
development: {
host: "127.0.0.1",
port: 9545,
network_id: "*"
}
},
然后:
- 仔细检查 Ganache 上的设置与上的设置是否匹配
truffle-config.js
- 检查 Ganache 是否正在运行。
最后打开一个新终端并在托管文件的同一文件夹中truffle-config.js
运行以下 2 个命令:
truffle console ––network development
migrate ––reset
推荐阅读
- java - ARCore – WorldScale 和 LocalScale 有什么区别?
- azure - Azure 机器学习 - 正确的输入数据集但是由于“[Errno 2] 没有这样的文件或目录”而无法打开所需的文件
- r - R中的软件
- javascript - 如何在回调函数 node.js 中传递参数?
- angular - 有没有办法清除 ngx-treeview 组件的过滤器?
- java - 如何在列表中找到最小值
? - r - 当我知道某些模拟失败时,从 runjags 获取 coda 文件
- karate - 如何成功上传 .xlsx 文件
- go - 如何使用gorm获取双嵌套数据?
- r - rlang 包的 dll 文件在哪里?