<p>The basic problem you need to solve is this: B knows about other nodes on the network, and needs to inform A of this.  So, your coin's protocol will have to include some way for this to happen.</p>

<p>In Bitcoin, node A would send a <code>getaddr</code> message to B, and  B would respond with an <code>addr</code> message, listing other nodes it knows about (in this case, C).  Then A can try to connect directly to these nodes.  See <a href="https://en.bitcoin.it/wiki/Protocol_documentation" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Protocol_documentation</a> for more information about these messages.  If you started with the Bitcoin source for your altcoin, then you should investigate why this isn't happening.</p>

<p>A seed node is a special case of this, to handle the situation where a brand-new client doesn't yet know about any other nodes on the network.  Someone promises to operate a node that should stay working reliably and be available at a specific IP address or DNS name (a so-called DNS seed).  This address or DNS name can then be hard-coded in the client source code, so that new clients will try that node first.  See <a href="https://bitcoin.stackexchange.com/questions/14371/what-is-a-dns-seed-node-vs-a-seed-node">What is a DNS seed node vs a Seed Node?</a>. Using the <code>getaddr</code>/<code>addr</code> protocol, the seed node can then inform the client of other nodes.  Once the client connects to some of those nodes, it can find out about additional nodes, and so on until the client reaches whatever connection limit it has configured.</p>

<p>In some cases the seed node might be configured to <em>only</em> respond to <code>getaddr</code> requests and not to any other type of request, so that it does not get overloaded with relaying blocks, transactions, etc, and stays available for its main job of helping clients find each other.</p>

CC BY-SA 3.0
2016-11-18T03:35:06.367Z
Thank you very much, Nate!
It's exactly what I've read in Mastering Bitcoin that A should receive B's nodes which includes C but it doesn't work the same in my case. In addition, I started with Litecoin source code so there may be some changes in Litecoin related to this problem, I'm gonna look up more about this.
Speaking about seed node, can you give me more specific info such as how to configure my client to only respond to `getaddr`, we will have to code or it is just about edit settings like `maxMoney`, `rpcport`,...?
hoanghs13
CC BY-SA 3.0
2017-09-29T15:41:30.177Z
@hoanghs13 Did you finally manage to set the seeder node? I'm trying to do the same, but apparently the only viable way is to set up a DNS seeder.
FedFranz
CC BY-SA 3.0
2016-11-17T13:48:24.753Z
2016-11-17T14:20:03.903Z
2017-04-13T12:47:36.647Z
Nate Eldredge
<p>I'm testing a new altcoin that I've created between several computers in LAN but encounter a situation as follow: </p>

<p>Computer A's client connects to computer B's client through the B's IP in the <code>addnode</code> field in the config file and only B's IP is specified in it. The same thing happens between B and C as C only knows B through the config file. It seems that there is no connection between A and C since the the command <code>getpeerinfo</code> in both A and C doesn't show the other's IP. Indeed, when I shut down the client on computer B, the two clients on A and C become disconnected to the network.</p>

<p>So my question is: <strong>what should I do to make A and C connected since they share a common peer's connection</strong>? (assuming that the new common connections are random, not known in advance to be included in the config file)</p>

<p>I've read somewhere that there are seed nodes which stores IPs of clients which have connected to them and that they usually don't need to keep connecting to those new nodes, just save the addresses in the database and disconnect. In case of new peer connects to the network, those seed nodes will help to provide list of peers' IPs. So <strong>how can I configure a node to be a seed node</strong>? <strong>Is it in this case the DNS seed</strong>? (I guess it's not)</p>

<p>Thank you in advance and all kinds of help will be highly appreciated.</p>

<altcoin><seed>
How to let a peer connect to a peer's peer?
hoanghs13
# How to let a peer connect to a peer's peer?

(Asked by: username_0 on 2016-11-17)

I'm testing a new altcoin that I've created between several computers in LAN but encounter a situation as follow:

Computer A's client connects to computer B's client through the B's IP in the `addnode` field in the config file and only B's IP is specified in it. The same thing happens between B and C as C only knows B through the config file. It seems that there is no connection between A and C since the the command `getpeerinfo` in both A and C doesn't show the other's IP. Indeed, when I shut down the client on computer B, the two clients on A and C become disconnected to the network.

So my question is: **what should I do to make A and C connected since they share a common peer's connection**? (assuming that the new common connections are random, not known in advance to be included in the config file)

I've read somewhere that there are seed nodes which stores IPs of clients which have connected to them and that they usually don't need to keep connecting to those new nodes, just save the addresses in the database and disconnect. In case of new peer connects to the network, those seed nodes will help to provide list of peers' IPs. So **how can I configure a node to be a seed node**? **Is it in this case the DNS seed**? (I guess it's not)

Thank you in advance and all kinds of help will be highly appreciated.

**Tags:** altcoin, seed


---

## 1 answers

### Answer by username_1 on 2016-11-17. Score: 1

The basic problem you need to solve is this: B knows about other nodes on the network, and needs to inform A of this. So, your coin's protocol will have to include some way for this to happen.

In Bitcoin, node A would send a `getaddr` message to B, and B would respond with an `addr` message, listing other nodes it knows about (in this case, C). Then A can try to connect directly to these nodes. See <https://en.bitcoin.it/wiki/Protocol_documentation> for more information about these messages. If you started with the Bitcoin source for your altcoin, then you should investigate why this isn't happening.

A seed node is a special case of this, to handle the situation where a brand-new client doesn't yet know about any other nodes on the network. Someone promises to operate a node that should stay working reliably and be available at a specific IP address or DNS name (a so-called DNS seed). This address or DNS name can then be hard-coded in the client source code, so that new clients will try that node first. See [What is a DNS seed node vs a Seed Node?](https://bitcoin.stackexchange.com/questions/14371/what-is-a-dns-seed-node-vs-a-seed-node). Using the `getaddr`/`addr` protocol, the seed node can then inform the client of other nodes. Once the client connects to some of those nodes, it can find out about additional nodes, and so on until the client reaches whatever connection limit it has configured.

In some cases the seed node might be configured to *only* respond to `getaddr` requests and not to any other type of request, so that it does not get overloaded with relaying blocks, transactions, etc, and stays available for its main job of helping clients find each other.

> **Comments:**
> **username_0**: Thank you very much, Nate! It's exactly what I've read in Mastering Bitcoin that A should receive B's nodes which includes C but it doesn't work the same in my case. In addition, I started with Litecoin source code so there may be some changes in Litecoin related to this problem, I'm gonna look up more about this. Speaking about seed node, can you give me more specific info such as how to configure my client to only respond to `getaddr`, we will have to code or it is just about edit settings like `maxMoney`, `rpcport`,...?  
> **username_2**: @username_0 Did you finally manage to set the seeder node? I'm trying to do the same, but apparently the only viable way is to set up a DNS seeder.  

---

