1

I have added truffle workspace to Ganache as usual. But now when I do a simple truffle develop followed by migrate inside the truffle shell, Ganache picks up that the contracts are deployed, but it doesn't pickup changes to the wallet balances.

My truffle-config.js files has only one change:

  compilers: {
    solc: {
      version: "native", 
    },
  },

I am running truffle inside WSL2, whereas ganache gui is installed natively in windows.

Below is the balance reported by Truffle shell:

truffle(develop)> web3.eth.getBalance(accounts[0])
'99934183260000000000' # updated balance after migrate

truffle(develop)> accounts[0]
'0x6b318B9350E42bEB94f9Ae5e8b9DA854a6137628'

Where that same account 0x6b318B9350E42bEB94f9Ae5e8b9DA854a6137628 in Ganache shows balance full 100 Eth: image

0

I had a similar issue that seem to be fixed by making sure I had ganache-cli running before trying to connect to it in the GUI. I also had to choose the host type of "0.0.0.0"

0

Ganache UI under Windows is not the same as Ganache-cli under WSL

The Ganache UI on Windows is listening to Windows Port.

The WSL2 instance have it's own set of ports.

So Even if they are set to the same port they are not

What you should do is use Ganache-cli in WSL2. This will fix your issue. Since they will both be on the same system.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.