1

Does anyone have any experience connecting an instance of HdWalletProvider to a dockerized Ganache-Cli? Having trouble connecting with http://0.0.0.0:8545, or ganache-cli:8545, or anything other form of host I can think of. I'm new to Docker as well (snippet attached)

var provider = new HDWalletProvider({mnemonic: teamsMnemonic, providerOrUrl: "http://0.0.0.0:8545", addressIndex: 0, numberOfAddresses:10, shareNone:false});
version: "3"
services:
mongo:
image: mongo
ports:
 - 27017:27017

executor:
build:
context: https://github.com/zach-is-my-name/Aion.git#docker
depends\_on:

  - mongo
  - ganache-cli
labels: 
  purpose: "run the Aion system executor"
  platform: "node.js"

truffle-test-suite:
build: .
depends\_on:

  - ganache-cli
labels: 
  purpose: "run the GoalZapp test suite"
  platform: "node.js"
  framework: "truffle"

ganache-cli:
image: trufflesuite/ganache-cli:latest
command: bash "ganache-cli -h http://0.0.0.0:8545 -f https://sandbox.truffleteams.com/de77b065-c9a7-4c8b-9fe9-0e507a623f9a"
ports:
- 8545:8545
labels: 
  purpose: "run the virtual ethereum network for testing, hosting Aion contract"
  platform: "node.js"

Update Gist with formatted docker-compose.yml

  • Your current docker-compose.yml is invalid. Please fix that first so we can try to reproduce it. – Morten Sep 23 at 16:28
  • It’s just bad formatting from the copy/paste, no? – Zach_is_my_name Sep 23 at 16:28
  • Sure, but it would be helpful if you provided a valid (properly formatted) config. – Morten Sep 23 at 16:29
  • @Morten see update with gist link – Zach_is_my_name Sep 23 at 20:19
1

Thank you for referring the ganache comment, It seems to work fine for you now with adding the port with the container's name ganache:8545 to further refer this URL. As per forwarding rules defined here https://docs.docker.com/compose/networking/

I am just a new user and already learning a lot from stackexchange, thank you for being with me and helping me solve your issue.


old...

Please take a look at this line bash...

"ganache-cli -h http://0.0.0.0:8545 -f https://sandbox.truffleteams.com/de77b065-c9a7-4c8b-9fe9-0e507a623f9a"

The host value does not look correct. enter image description here

As per docs, it doesn't seem to have a protocol or port defined with it. Try to just use 0.0.0.0

| improve this answer | |
  • Comments are not for extended discussion; this conversation has been moved to chat. – eth Sep 30 at 4:17

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.