Ninjastic
Home
Search
Users
Boards
Addresses
Ctrl + K
Toggle theme
Open menu
Post
Edited versions
Quotes to this post
Post
61119069
Topic
5417077
Board
Development & Technical Discussion
Re: How to connect docker container to bitcoin node?
by
vv181
on
14/10/2022, 12:41:08 UTC
Quote from: Exchangman on
Today
at 11:33:21 AM
Quote from: vv181 on
Today
at 11:21:58 AM
You should use the internal IP on the Python container, not localhost.
Code:
connection_url="http://%s:%s@host.docker.internal:8332/wallet/testwallet"
credentials=('testuser','testpassword')
rpc_connection = AuthServiceProxy(connection_url % credentials)
rpc_connection.getnewaddress()
If it still not works, try refer to
https://www.howtogeek.com/devops/how-to-connect-to-localhost-within-a-docker-container/
internal ip like 127.0.01? but that will connect to docker localhost network not the server localhost?
I meant the internal IP of Docker.
Since you already set
host.docker.internal:host-gateway
, you can try to use
host.docker.internal
as the IP, to access the IP outside Docker container.
Try to use the modified code as I quoted above.