Unable to access web3.eth.accounts in config/contracts.js
See original GitHub issueWhat I’m trying to do:
I originally wrote all my tests in the Truffle testing environment. However, after finding Ganache and Truffle were often crashing, I have turned to trying to write tests in Embark.
In order to deploy one of my contracts, I have to send two addresses into the constructor. I have started a local testrpc using embark simulator
, which started ganache-cli
with a mnemonic and 10 test accounts. I want to send the first and third argument into the constructor similar to the below:
initializeContract(web3.eth.accounts[0], web3.eth.accounts[2]);
What is actually happening:
Embark doesn’t seem to recognize web3
. The error code is:
Error: Attempted to deploy contract without specifying parameters
I tried to check the status of the web3 instantiation after starting embark run
, and it seems uninitialized? Should accounts
and addresses
be initialized?
Is there something I’m doing wrong to use and/or initialize web3?
Issue Analytics
- State:
- Created 5 years ago
- Comments:26
Top GitHub Comments
Contract names might not be exactly the same. Just change them in the config and in the require.
Yes, it works!! Thank you so much @jrainville @iurimatias for your help to get this working! (edited: oops)