1
votes

I'm trying to migrate my new truffle configs to test a smartcontract in a private network. But when I try to migrate it, I get stuck here: 1_initial_migration.js gets hanging on "Replacing Migrations" forever

Can somebody please help me solving it?

1

1 Answers

0
votes

I think I've had this problem. I suspect Ganache is in a bad state. And I swear truffle doesn't incrementally build correctly sometimes. So when in doubt, fully restart Ganache, rebuild with --all and redeploy with --reset .

That is:

  1. Exit Ganche

  2. Check Task Manager, ps, or equivalent and terminate all rogue instances of Ganache that might still be running. Ganache tends to start several child processes. So make sure they aren't lingering around before you restart it.

  3. Restart Ganache with a new workspace.

  4. Recompile with this: truffle compile --all

  5. Redeploy with: truffle deploy --reset

Weird bugs tend to go away when I completely do a full reset as described by these steps. In on case, I just rebooted because port 7575 was locked by something.