rand-chain / rust-randchain

(WIP) Official implementation of the RandChain protocol
GNU General Public License v3.0
1 stars 0 forks source link

p2p: Add seednode service #64

Closed SebastianElvis closed 3 years ago

SebastianElvis commented 3 years ago

There should be a seednode so that nodes can find each other. The seednode runs the DNS protocol. Nodes can query peers from the seednode. A reference implementation is https://github.com/sipa/bitcoin-seeder. Perhaps we can fork it.

SebastianElvis commented 3 years ago

Just find a Rust implementation of dnsseed https://github.com/dongcarl/dnsseed-rust. It was initially developed by TheBlueMatt and is currently maintained by Carl Dong. Not sure if we can use this one or not. I'll double check.

SebastianElvis commented 3 years ago

Ah TheBlueMatt is still actively developing this repo, but at https://git.bitcoin.ninja/?p=dnsseed-rust;a=summary It should work.

SebastianElvis commented 3 years ago

Decided to use TheBlueMatt's Rust implementation. We use the repo with commit id ca19f8036d82bcc7a4100219bad3f16b9a91d69a. Our dnsseed repo is at https://github.com/rand-chain/dnsseed

SebastianElvis commented 3 years ago

After reading the code of git.bitcoin.ninja/?p=dnsseed-rust;a=summary, I still decide not to use it, as

  1. It is still a scanner without DNS functionality
  2. The code seems still incomplete. There are a lot of unsafe operations and has almost no documentation/comments.

Instead, I find Zcash provides a complete solution, including the DNS deployment and Golang-based seeder implementation that seems to be elegant. See https://github.com/ZcashFoundation/coredns-zcash and https://github.com/ZcashFoundation/dnsseeder.

Before the DNS stuff, I will first try to launch a private cluster without DNS seed server.

SebastianElvis commented 3 years ago

Please find https://github.com/rand-chain/dnsseeder for the seeder plugin, and https://github.com/rand-chain/coredns-randchain for the CoreDNS server Dockerfile using the seeder plugin.

Currently, CoreDNS cannot communicate with the RandChain node (via the P2P endpoint). The reason is likely to be #75