:: [Libbitcoin] libbitcoin server prox…
Top Page
Delete this message
Reply to this message
Author: Police Terror
Date:  
To: libbitcoin
Subject: [Libbitcoin] libbitcoin server proxy for multiple nodes
Hello,

Sometimes nodes can go down, stop responding or their blockchain doesn't
update. Maybe the VPS is switched off, a firewall blockchain ports or a
Bitcoin network split (on small networks like testnet).

For this I've created this request forwarding proxy:

https://github.com/RojavaCrypto/libitcoin-server-proxy

Here are the config values in main.py:

local_port = 8081
remotes = [
    ("tcp://163.172.84.141:9091", "tcp://163.172.84.141:9092"),
    ("tcp://163.172.84.141:10091", "tcp://163.172.84.141:10092")
]


If I connect to this proxy and make libbitcoin-server requests on port
8081, it will forward the request to one of those nodes, then give me
the response back.

It selects the nodes that sent a heartbeat less than 10 secs ago, and
then chooses the node with the maximum current block height in the list.