Search content
Sort by

Showing 5 of 5 results by Exchangman
Post
Topic
Board Development & Technical Discussion
Re: How to connect docker container to bitcoin node?
by
Exchangman
on 14/10/2022, 11:41:58 UTC
when I make call to this script I get this error in return [Errno 111] Connection refused

Ps: when I run the same script outside of docker container it works fine Any solutions??

I only use docker to run certain application, but AFAIK you got this error because you didn't perform port forwarding. On terminal, i'd use parameter -p HOST_PORT:CONTAINER_PORT (should be -p 8332:8332 in your case) to perform port forwarding. But i don't know the equivalent for Dockerfile.

++ is it safe to run the node and connect to it using a script like this? locally?

Since you're the one who create the script, it should be safe. But if you have very serious security concern or writing script for business/enterprise usage, i'd recommend you to check whether library you use is malicious or not.

So running on local and connecting to rpc on local is safe, just i have to check the python library that's all?
How do i know that this library "https://github.com/jgarzik/python-bitcoinrpc" is safe?
Post
Topic
Board Development & Technical Discussion
Re: How to connect docker container to bitcoin node?
by
Exchangman
on 14/10/2022, 11:33:21 UTC
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?
Post
Topic
Board Development & Technical Discussion
Topic OP
How to connect docker container to bitcoin node?
by
Exchangman
on 14/10/2022, 08:43:23 UTC
I have a python script inside docker container and a bitcoin node outside of docker in my local machine , this is my bitcoin.conf information

Code:
rpcuser=testuser
rpcpassword=testpassword
testnet=1
prune=550
server=1
[test]
rpcallowip=0.0.0.0/0
rpcport=8332
bind=127.0.0.1
minconf=1

and this is my docker compose conf file



Code:
app:
build:
  context: .
restart: always
volumes:
  - .:/app
extra_hosts:
  - "host.docker.internal:host-gateway"

then in my python script i'm trying to connect to the bitcoin node using this:

connection_url="http://%s:%s@localhost:8332/wallet/testwallet"
credentials=('testuser','testpassword')
rpc_connection = AuthServiceProxy(connection_url % credentials)
rpc_connection.getnewaddress()

when I make call to this script I get this error in return [Errno 111] Connection refused

Ps: when I run the same script outside of docker container it works fine Any solutions?? ++ is it safe to run the node and connect to it using a script like this? locally?
Post
Topic
Board Announcements (Altcoins)
Re: [ANN] Egano (EGN) Egalitarian & Anonymous single unit crypto based on CryptoNote
by
Exchangman
on 24/03/2018, 18:33:09 UTC
Hi guys i want to finish up your listing and this is what i need
RPC address
RPC user
kzv_rpc
RPC password
From where i get these information.?
Post
Topic
Board Announcements (Altcoins)
Re: [ANN][GCH] Galaxy Cash, PoW, PoS, Multialgo, Masternodes, No Premine
by
Exchangman
on 24/03/2018, 17:57:57 UTC
Hi guys i want to finish up your listing and this is what i need
RPC address
RPC user
kzv_rpc
RPC password
From where i get these information.?