0

So I'd like to use the commandline debugger in truffle.

To test I simply run truffle test

I have an empty truffle.js file.

I can get my transaction ID in the javascript tests. When I run:

 truffle debug 0xce1bc402758bd7b6995d82430214c283967371ade97b01bd46e1fe074ea0a4c2

I get:

Error: No network specified. Cannot determine current network.

I'm guessing this is because after the test ran truffle shut down the test network?

I know I could use testrpc, but it causes a lot of problems for me.

Is there a way to use truffle debug with their new built in test framework?

Thanks

edit When attempting to use testrpc I get this error message after every test case : Error: VM Exception while processing transaction: revert

this is my truffle.js

module.exports = {
  networks: {
    development: {
      host: "localhost",
      port: 8545,
      network_id: "*", // Match any network id
      gas: 6712388
    }

  }
};

but when I comment out the development network, then truffle defaults to the "test" network and everything works fine.

edit2 I should note that my tests take a lot of gas. So im guessing that the reverts are caused because an object that is expected to be there is not because I didn't have enough gas to deploy it. I tried increasing the gas limit in truffle.js but that fails with some other error...

2 Answers 2

0

There is a file called "truffle.js". In this file, you must specify the network you want to use.

Moreover, when running a command, you can specify the network to use:

More information here

2
  • my truffle.js is empty and truffle seems to default to using the network "test." If i try to specify my own address I get an error saying that it cant run due to gas fees... Jan 26, 2018 at 0:56
  • Can you paste in your original post the exact error you get? Jan 26, 2018 at 0:58
0
  1. Use ganache-cli, the successor of testrpc (see here for more details)

  2. Run ganache-cli as follows:

    ganache-cli --port=8545 --gasLimit=0xfffffffffff --account=0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef,1000000000000000000000000000000000000000

    If you need more than one account in your tests, then just add as many --account=... as you need (separated by space), and use a different key for each one of them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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