trufflesuite / ganache-ui

Personal blockchain for Ethereum development
https://www.trufflesuite.com/ganache
MIT License
4.66k stars 802 forks source link

Ganache stuck at adding Truffle project #1266

Open JFGHT opened 5 years ago

JFGHT commented 5 years ago

I just came back to Ethereum development. Upgraded my Ganache and found out theres a new feature to add Truffle projects to the Workspace.

Decided to use it. I add the project which truffle.js and truffle-config.js are the same:

module.exports = {
  // See <http://truffleframework.com/docs/advanced/configuration>
  // to customize your Truffle configuration!
  networks: { 
    development: { 
      host: "127.0.0.1", 
      port: 7545, 
      network_id: "*" // Match any network id 
    } 
  } 
};

Then, I save&restart... gets stuck at action SETTINGS/SET_SETTINGS.

Expected Behavior

Normal loading of Ganache.

Current Behavior

Stuck at loading after restart.

Context

This DOES NOT happen in Ubuntu.

davidmurdoch commented 5 years ago

Thanks for opening the issue, @JFGHT! What version of node do you have installed (on your PATH)?

JFGHT commented 5 years ago

No problem. v10.7.0.

robertmagier commented 5 years ago

I can add workspace and configure project, but then Ganache will freeze when I start running test or execute truffle migrate --reset.

Let me know in case I should open separate issue for this problem. Windows: 10 Node: 10.15.3 Ganache: 2.0.1

guylando commented 5 years ago

+1 same #1289 seems windows ganache gui is broken

guylando commented 5 years ago

@davidmurdoch the bug is related to the code https://github.com/trufflesuite/ganache/blob/develop/src/common/services/TruffleIntegrationService.js called on OPEN_WORKSPACE event. What is the fastest way for me to get ganache with source maps for the js so that I can debug this? Because the ganache I installed does not have source maps

pedroduartecosta commented 5 years ago

For anyone who may run into this in the future. My problem was that I was loading a truffle.js config file and it was getting stuck on the loading screen.

Running npm install inside my project folder, where the truffle.js file is, fixed the problem.

erdirowlands commented 5 years ago

Thanks for opening the issue, @JFGHT! What version of node do you have installed (on your PATH)?

In my case, I had temporarily switched to 6.0.0 and experienced this bug. I switched back to 10.16.0 due to this comment and everything is working normally.

FabioBonfiglio commented 4 years ago

I'm currently facing exactly the same problem with Ganache 2.4.0. My truffle-config.js file contains the following:

module.exports = {
    networks: {
        development: {
            host: "127.0.0.1",
            port: 8545,
            network_id: 1337,
            websockets: true
        }
    },

    plugins: ["solidity-coverage"],

    mocha: {
        slow: 28000,
        timeout: 56000
    },

    compilers: {
        solc: {
            version: "^0.6.3",
            settings: {
                optimizer: {
                    enabled: true,
                    runs: 400
                },
                evmVersion: "istanbul"
            }
        }
    }
};

My builds are in the default folders in build/contracts relatively to the project's root.

If I launch ganache without the truffle project, everything is working fine. Then if I add the project (adding truffle-config.js in the workspace settings tab), and restart, Ganache is stuck on the launching spinner. Launching the app with the command line, all I see is this :

$ ./ganache-2.4.0-linux-x86_64.AppImage 
15:57:50.146 › Checking for update
15:57:51.929 › Update for version 2.4.0 is not available (latest version: 2.4.0, downgrade is disallowed).
listen to truffle

OS : Ubuntu 16.04 LTS Node : 12.18.2 Ganache GUI: 2.4.0 Truffle: 5.1.32

The workspace settings:

{"server":{"gasLimit":6721975,"gasPrice":20000000000,"hardfork":"muirGlacier","hostname":"127.0.0.1","port":8545,"network_id":1337,"default_balance_ether":10,"total_accounts":10,"unlocked_accounts":[],"locked":false,"vmErrorsOnRPCResponse":false,"verbose":false,"db_path":"/home/user/.config/Ganache/workspaces/test-workspace01/chaindata","mnemonic":"boat mango chase robot deny tongue oblige victory south update okay hen"},"name":"test-workspace01","isDefault":false,"verboseLogging":false,"randomizeMnemonicOnStart":false,"projects":["/path/to/project/truffle-config.js"],"flavor":"ethereum","uuid":"54278a6d-5cf6-4242-9845-5deadbeef442"}

Things I've already checked / tried :

Should I open a new issue ?

davidmurdoch commented 4 years ago

@FabioBonfiglio how many contracts do you have?

Have you run npm install in the truffle project?

FabioBonfiglio commented 4 years ago

@FabioBonfiglio how many contracts do you have?

One main contract inheriting an interface, and 6 dependencies. Here is the exact structure of my ./contracts folder:

.
+-- contracts
    +-- lib
    |   +-- Owned.sol
    |   +-- Data.sol
    |   +-- Roles.sol
    |   +-- Upgradeable.sol
    |   +-- FeatureA.sol
    |   +-- FeatureB.sol
    +-- Migrations.sol
    +-- InterfaceContract.sol
    +-- MainContract.sol

Have you run npm install in the truffle project?

Yes. Unfortunately without any improvement.
Also tried npm rebuild