SChernykh / p2pool

Decentralized pool for Monero mining
GNU General Public License v3.0
1.03k stars 123 forks source link

Add `gupax.io` to DNS seed nodes #286

Closed hinto-janai closed 7 months ago

hinto-janai commented 7 months ago

main.gupax.io points to the same nodes as seeds.p2pool.io

mini.gupax.io same as seeds-mini.p2pool.io

Tested on main/mini as-is and with gupax.io as the only source.

SChernykh commented 7 months ago

More seed nodes are welcome, but this domain just copies what's already there? I only added the second domain because p2pool.io was blocked in many anti-crypto mining DNS lists ever since it was used by Bitcoin's P2Pool.

It would be better if gupax.io pointed at your own, independent, seed nodes. Seed nodes must be run 24/7 on a fast connection (ports must also be open for incoming connections).

hinto-janai commented 7 months ago

Added 185.112.146.134:37889, 185.112.146.134:37888 in the front, should be good for a year - I can remove the other nodes but wouldn't backup be good?

SChernykh commented 7 months ago

Having backup is fine.

P.S. I need to think about a better system for the initial sync process. DNS can be blocked too easily.

hinto-janai commented 7 months ago

Hardcode IPs - update per release as needed?

SChernykh commented 7 months ago

Hardcoded IPs are also easy to ban. I was thinking about some dynamic solution, but googling "p2p bootstrap" and similar stuff doesn't bring any good ideas.

hinto-janai commented 7 months ago

Ugly but would practically work - bootstrap off Monero nodes, e.g:

get_monero_peer_ips() {
    # return ips using existing dns system, seed nodes, etc
}

find_p2pool_peer() {
    for ip in get_monero_peer_ips() {
        if ip.has_18083_or_18084_open() {
            maybe_p2pool_peers += ip;
        }
    }

    return maybe_p2pool_peers; # array of ips
}

bootstrap() {
    # assume monero nodes with 18083/18084 open
    # might be running p2pool nodes as well,
    # we only need 1 to bootstrap so success
    # rate is high.
    for maybe in find_p2pool_peer() {
        maybe.attempt_connection();
    }
}

This is basically what https://github.com/plowsof/listen_for_zmq does. Could just scan the entire network too as a last resort - shouldn't take too long if done asynchronously.

More complex but would also work would be DNS list via .onion (can't be blocked).

SChernykh commented 7 months ago

This is already implemented: https://github.com/SChernykh/p2pool/blob/master/src/p2p_server.cpp#L342