Can't reach Algorand Docker container from another container

Hi,

I have a couple of docker containers running of which one is a server- and one an Algorand container. From the server container I can ping the Algorand container. However, when trying to list wallets via the api I get the error returned:

dial tcp 192.xxx.xxx.x:7833: connect: connection refused

	// create KMD client
  kmdClient, err := kmd.MakeClient(KMDADDRESS, KMDTOKEN)
	
	// Create an algod client
	algodClient, err := algod.MakeClient(ALGODADDRESS, ALGODTOKEN)

	// Get the list of wallets
	listResponse, err := kmdClient.ListWallets()
	if err != nil {
		return "", err
	}

Both kmdClient and algodClient are created.

Furthermore, all containers are connected to the dev_projects_default network. When running

$ docker network inspect dev_projects_default

yields the ip addresses of all the containers.

Complete error:

Get "http://192.xxx.xxx.x:7833/v1/wallets": dial tcp 192.xxx.xxx.x:7833: connect: connection refused
         
listResponse is:  {{{} false } []}

Any help appreciated

1 Like

Have you changed $ALGORAND_DATA/config.json (for algod) and $ALGORAND_DATA/kmd/kmd-v0.5/kmd_config.json (for kmd) to allow connections from any IP? By default, it only allows connections from localhost.

Concretely, have you set EndpointAddress to 0.0.0.0:8080 for algod and address to 0.0.0.0:7833 for kmd?

See:

1 Like

SOLVED

Hi Fabrice, that was it. Thanks a million man!