kangarang / tcr-ui

A client-side shell to interact with token-curated registries
MIT License
68 stars 28 forks source link

Naive Ganache Deployment: sender doesn't have enough funds to send tx #98

Closed fredfortier closed 6 years ago

fredfortier commented 6 years ago

Followed the steps in the README file exactly.

$ truffle --version
Truffle v4.1.6 - a development framework for Ethereum
ganache-cli
Ganache CLI v6.1.0 (ganache-core: 2.1.0)

The error occurs here:

npm run deploy-ganache

> sol-tcr@0.0.1 deploy-ganache /Users/fredfortier/Code/sandbox/tcr/tcr
> truffle migrate --network ganache

Using network 'ganache'.

Running migration: 1_initial_migration.js
  Deploying Migrations...
Error encountered, bailing. Network state unknown. Review successful transactions manually.
sender doesn't have enough funds to send tx. The upfront cost is: 112500000000000000 and the sender's account only has: 0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sol-tcr@0.0.1 deploy-ganache: `truffle migrate --network ganache`
npm ERR! Exit status 1

I following the steps naively and did not spend time troubleshooting. Looking for anything obvious which I might be missing.

kangarang commented 6 years ago

when you initiate the ganache-cli rpc server, you can specify a mnemonic with the flag --mnemonic, which funds those accounts with 100 ETH each (docs).

while migrating the tcr contracts, whether you're using a secrets.json file or an environment variable, use that same mnemonic in truffle.js.

hopefully that fixes your issue. thanks for bringing this up -- i'll clarify this the next time i update the docs.

fredfortier commented 6 years ago

Yes, this works. I apologize for the rudimentary issue.

Next issue, this line in the migration files sets ${process.argv[5]} to undefined:

config = JSON.parse(fs.readFileSync(`./conf/${process.argv[5]}.json`));

Any idea of what might be causing this?

fredfortier commented 6 years ago

I worked around this but it seems like like the application wants some environment variables and arguments which are not obvious just by reading the README file.

kangarang commented 6 years ago

hi @fredfortier , glad you found a workaround.

seems like like the application wants some environment variables and arguments which are not obvious just by reading the README file

thanks for mentioning -- just updated the docs