Timeline for How do I determine the network within a truffle exec script?
Current License: CC BY-SA 4.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 14, 2019 at 17:45 | vote | accept | lsankar4033 | ||
May 14, 2019 at 17:45 | comment | added | lsankar4033 | Not the cleanest, but this works! Thanks for the suggestion. | |
May 14, 2019 at 7:11 | comment | added | goodvibration |
Actually, now that you've mentioned it... It kinda makes me think that perhaps truffle test can somehow be configured with a specific network. I guess it'll require looking into their source code...
|
|
May 14, 2019 at 7:05 | comment | added | Richard Horrocks |
Ah, good point - which must be why it's outputting the line Using network 'development' , i.e. "I don't know which network to use, so using the first one in the config file."
|
|
May 14, 2019 at 6:56 | comment | added | goodvibration |
In which case, the --network argument is redundant. Unlike truffle migrate and truffle deploy (which are identical btw), truffle exec and truffle test do not receive the network as an argument, so one has to pass it explicitly and then access it via process.argv .
|
|
May 13, 2019 at 21:35 | history | answered | Richard Horrocks | CC BY-SA 4.0 |