0

code:

from bitcoinrpc.authproxy import AuthServiceProxy
class ProxyService:
    def getProxy(self) -> AuthServiceProxy:
        return AuthServiceProxy("http://%s:%[email protected]:8332" % ("xx", "xxx")) # this only works locally as 127.0.0.1

bitcon.config

datadir=/xxxx/Bitcoin
dbcache=2000
txindex=1
server=1
rpcuser=xx
rpcpassword=xx
rpcport=8332
disablewallet=1

I am running this on Ubuntu droplet. connection works when i connect locally as 127.0.0.1:8332

but when i try connection to the ip of my node (locally or remotely) I get "connection refused"

also i can confirm my node is up

enter image description here

1 Answer 1

3

Make sure to set

rpcallowip=<ip>

for each of your remote IPs, to whitelist them.

You can also use a netmask instead of IP. If you have a dynamic IP, use this feature!

For example, if your laptop's IP always starts with 237.94, you can set it to

rpcallowip=237.94.0.0/255.255.0.0

Then it'll allow all IPs that start with those numbers. Make sure to set a really strong password, though.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.