My truffle tests use several accounts and send tokens between them, so how would I run such a truffle test on testnet, e.g. Rinkeby?

  • Are account address hardwired or are you using in your tests the accounts array provided by truffle? – ivicaa Apr 4 '18 at 5:58
  • @ivicaa The accounts array – Ian Macalinao Apr 4 '18 at 6:17

The procedure is the same like testing locally with a dev node or ganache/testrpc.

Basically, you will have to setup a local node synced with Rinkeby. Moreover, you'll have to create as many account as you need for your tests and load them with some ether, if they're going to create transactions.

In truffle.js you can also specify different networks. Using the --network <NETWORKNAME> parameter, you can switch between them. E.g. truffle test --network rinkeby.

| improve this answer | |
  • How do I create accounts? Where do I specify them? – Ian Macalinao Apr 4 '18 at 6:24
  • If you're using geth you can call geth account new or via web3 console: personal.newAccount() – ivicaa Apr 4 '18 at 6:29

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.