松露迁移未部署到 ganache

问题描述

我正在尝试将我的合约部署到 ganache 以测试我的合约,但出现错误

当我跑步时

松露迁移 --network development --reset

我收到

正在编译您的合同...

一切都是最新的,没有什么可以编译的。

但是当我查看 Ganache 时,它​​说没有合同

当我运行松露测试时,我得到

错误:SimpleStorage 尚未部署到检测到的网络 (网络/工件不匹配)

我的 truffle-config.js

const path = require("path");

module.exports = {
  // See <http://truffleframework.com/docs/advanced/configuration>
  // to customize your Truffle configuration!
  contracts_build_directory: path.join(__dirname,"client/src/contracts"),networks: {
    development: {
      host: '127.0.0.1',port: 7545,network_id: "5337"
    },}
};

和我的迁移文件

var Migrations = artifacts.require("Migrations");
var SimpleStorage = artifacts.require("SimpleStorage");

module.exports = function(deployer) {
  deployer.deploy(Migrations)
  deployer.link(Migrations,SimpleStorage)
  deployer.deploy(SimpleStorage)
} as Truffle.Migration;

export {};

老实说,我只是想写一些测试,但不知道我做错了什么

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)