<p>What worked for me was sending a <code>ping</code> message. Also, the <code>addr</code> message didn't come directly. I had to keep listening on the same port for at least a second.</p>

<p>You can use the <a href="https://bitcoin.stackexchange.com/questions/14371/what-is-a-dns-seed-node-vs-a-seed-node">dns seeds</a> as a starting point, however a large portion of nodes might still only give you their own address. If anyone knows why I'm curious to hear, but I think every client just has its own way of dealing with these messages.</p>

<pre><code>Version -&gt;
&lt;- Version, Verack
Verack -&gt;
Ping -&gt;
GetAddr -&gt;
&lt;- Pong, Ping, ManyMoreThings
&lt;- Addr
</code></pre>

CC BY-SA 3.0
2017-08-16T11:22:39.093Z
2017-08-16T11:22:39.093Z
vicsn
<p>I am writing a simple program that connects to nodes in order to index them, kind of like blockchain.info nodes works. Doing this in GLang using the btcd/wire library to create the messages, the message sequence is as follows:</p>

<pre><code>Version -&gt;
&lt;- Version
&lt;- Version Acknowledge
&lt;- Ping
Pong -&gt;
GetAddr -&gt;
&lt;- Addr
</code></pre>

<p>However upon reading the list of addresses returned they all are either empty or contain a single address that corresponds to that nodes address (I.E. it returns its own address).</p>

<p>From reading the wiki I know nodes only return addresses of connected nodes that have a timestap less than 3 hours ago, and that there are certain dns nodes and seed nodes. Are there any nodes that will always return connected peers regardless of their age? Or any way to bootstrap the process? How does a normal full node connect to more than a handful of nodes when these may never return anything (if they have been alive for more than 3 hours, then they will only return something on new connections)?</p>

<nodes><seed>
GetAddr not returning connected node addresses
RichyHBM
# GetAddr not returning connected node addresses

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

I am writing a simple program that connects to nodes in order to index them, kind of like blockchain.info nodes works. Doing this in GLang using the btcd/wire library to create the messages, the message sequence is as follows:

```
Version ->
<- Version
<- Version Acknowledge
<- Ping
Pong ->
GetAddr ->
<- Addr

```

However upon reading the list of addresses returned they all are either empty or contain a single address that corresponds to that nodes address (I.E. it returns its own address).

From reading the wiki I know nodes only return addresses of connected nodes that have a timestap less than 3 hours ago, and that there are certain dns nodes and seed nodes. Are there any nodes that will always return connected peers regardless of their age? Or any way to bootstrap the process? How does a normal full node connect to more than a handful of nodes when these may never return anything (if they have been alive for more than 3 hours, then they will only return something on new connections)?

**Tags:** nodes, seed


---

## 1 answers

### Answer by username_1 on 2017-08-16. Score: 2

What worked for me was sending a `ping` message. Also, the `addr` message didn't come directly. I had to keep listening on the same port for at least a second.

You can use the [dns seeds](https://bitcoin.stackexchange.com/questions/14371/what-is-a-dns-seed-node-vs-a-seed-node) as a starting point, however a large portion of nodes might still only give you their own address. If anyone knows why I'm curious to hear, but I think every client just has its own way of dealing with these messages.

```
Version ->
<- Version, Verack
Verack ->
Ping ->
GetAddr ->
<- Pong, Ping, ManyMoreThings
<- Addr

```


---

