<h2>The issue</h2>

<p>I am attempting to use the <code>getnodeaddresses</code> RPC call to return all addresses known by a node in a docker network. I'm using the <code>regtest</code> environment. The RPC call returns an empty array although nodes have been added on the referent node using the <code>add</code> RPC call.</p>

<h2>Expected behavior </h2>

<p>The <code>getnodeaddresses</code> RPC call should return nodes added via the <code>add</code> RPC call.</p>

<h2>Actual behavior </h2>

<p>No addresses are returned, i.e., an empty array is returned:</p>

<pre><code>bitcoin-cli -regtest --datadir=/root/.bitcoin/ getnodeaddresses 5
[
]
</code></pre>

<h2>Reproduction </h2>

<p>Setup a regtest network of 11 nodes. No mining has been done, and the <code>~/.bitcoin</code> folder contains only <code>bitcoin.conf</code> with the following content:</p>

<pre><code>[regtest]
regtest=1
server=1
rpcport=8332
port=8333
</code></pre>

<p>Connect to the referent node and run the command:
<code>bitcoin-cli -regtest --datadir=/root/.bitcoin/ addnode "$p:8333" add</code> where <code>p</code> is the other node address  for every node the referent node wants to add.</p>

<p>Run the commands on the referent node:</p>

<pre><code>bibitcoin-cli -regtest --datadir=/root/.bitcoin/ getconnectioncount
10

bibitcoin-cli -regtest --datadir=/root/.bitcoin/ getpeerinfo       

[
  {
    "id": 2,
    "addr": "10.0.0.3:53378",
     # Cut out part of response
{
    "id": 11,
    "addr": "10.0.0.4:36236",
    "addrbind": "10.0.0.2:8333",
    "services": "000000000000040d",
    "relaytxes": true,
    "lastsend": 1569835448,
    "lastrecv": 1569835448,
    "bytessent": 464,
    "bytesrecv": 488,
    "conntime": 1569835207,
    "timeoffset": 0,
    "pingtime": 0.001063,
    "minping": 0.000456,
    "version": 70015,
    "subver": "/Satoshi:0.18.0/",
    "inbound": true,
    "addnode": false,
    "startingheight": 303,
    "banscore": 0,
    "synced_headers": -1,
    "synced_blocks": -1,
    "inflight": [
    ],
    "whitelisted": false,
    "minfeefilter": 0.00001000,
    "bytessent_per_msg": {
      "feefilter": 32,
      "ping": 96,
      "pong": 96,
      "sendcmpct": 66,
      "sendheaders": 24,
      "verack": 24,
      "version": 126
    },
    "bytesrecv_per_msg": {
      "feefilter": 32,
      "getaddr": 24,
      "ping": 96,
      "pong": 96,
      "sendcmpct": 66,
      "sendheaders": 24,
      "verack": 24,
      "version": 126
    }
  }
]

bitcoin-cli -regtest --datadir=/root/.bitcoin getnodeaddresses 5
[
]

</code></pre>

<h2>Bitcoin core version </h2>

<pre><code>bitcoin-cli -version
Bitcoin Core RPC client version v0.18.0.0-g2472733a24a9364e4c6233ccd04166a26a68cc65
bitcoind -version 
Bitcoin Core Daemon version v0.18.0.0-g2472733a24a9364e4c6233ccd04166a26a68cc65
</code></pre>

<p>Installed via the repository <code>ppa:bitcoin/bitcoin</code></p>

<h2>OS</h2>

<p>Docker container info:</p>

<pre><code>lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:    18.04
Codename:   bionic
</code></pre>

<p>Host info:</p>

<pre><code>lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:    18.04
Codename:   bionic

cat /proc/cpuinfo  | grep 'name'| uniq
model name  : Intel(R) Core(TM) i7-4600M CPU @ 2.90GHz
</code></pre>

<p>1 TB SSD disk</p>

CC BY-SA 4.0
2019-09-30T12:15:51.280Z
There’s no `getnodeaddress` RPC call so it shouldn’t be surprising this fails. You probably mean `getnewaddress`.
Claris
CC BY-SA 4.0
2019-09-30T13:23:58.063Z
I believe you are wrong, https://github.com/bitcoin/bitcoin/commit/a2eb6f540538d32725aecf678301a96247db6fd9 is the pull request adding the command to the codebase, and it is contained in release v0.18.0
user3223162
CC BY-SA 4.0
2019-09-30T13:25:21.330Z
You’re right, I was thinking of a similar altcoins RPC. It’s probably not returning any results because it’s not able to discover it’s public IP address? Not sure how that’s meant to function clearly.
Claris
CC BY-SA 4.0
2019-09-30T13:26:39.307Z
Might be, I have opened an issue and will follow up here when it gets resolved
user3223162
CC BY-SA 4.0
2019-09-30T13:27:00.793Z
Sorry for my mistake there.
Claris
CC BY-SA 4.0
2019-09-30T13:27:56.643Z
No worries, we are here to discuss :D
user3223162
<json-rpc><network>
No addresses returned by getnodeaddresses RPC call
user3223162
# No addresses returned by getnodeaddresses RPC call

(Asked by: username_0 on 2019-09-30)

## The issue

I am attempting to use the `getnodeaddresses` RPC call to return all addresses known by a node in a docker network. I'm using the `regtest` environment. The RPC call returns an empty array although nodes have been added on the referent node using the `add` RPC call.

## Expected behavior

The `getnodeaddresses` RPC call should return nodes added via the `add` RPC call.

## Actual behavior

No addresses are returned, i.e., an empty array is returned:

```
bitcoin-cli -regtest --datadir=/root/.bitcoin/ getnodeaddresses 5
[
]

```

## Reproduction

Setup a regtest network of 11 nodes. No mining has been done, and the `~/.bitcoin` folder contains only `bitcoin.conf` with the following content:

```
[regtest]
regtest=1
server=1
rpcport=8332
port=8333

```

Connect to the referent node and run the command:
`bitcoin-cli -regtest --datadir=/root/.bitcoin/ addnode "$p:8333" add` where `p` is the other node address for every node the referent node wants to add.

Run the commands on the referent node:

```
bibitcoin-cli -regtest --datadir=/root/.bitcoin/ getconnectioncount
10

bibitcoin-cli -regtest --datadir=/root/.bitcoin/ getpeerinfo       

[
  {
    "id": 2,
    "addr": "10.0.0.3:53378",
     # Cut out part of response
{
    "id": 11,
    "addr": "10.0.0.4:36236",
    "addrbind": "10.0.0.2:8333",
    "services": "000000000000040d",
    "relaytxes": true,
    "lastsend": 1569835448,
    "lastrecv": 1569835448,
    "bytessent": 464,
    "bytesrecv": 488,
    "conntime": 1569835207,
    "timeoffset": 0,
    "pingtime": 0.001063,
    "minping": 0.000456,
    "version": 70015,
    "subver": "/Satoshi:0.18.0/",
    "inbound": true,
    "addnode": false,
    "startingheight": 303,
    "banscore": 0,
    "synced_headers": -1,
    "synced_blocks": -1,
    "inflight": [
    ],
    "whitelisted": false,
    "minfeefilter": 0.00001000,
    "bytessent_per_msg": {
      "feefilter": 32,
      "ping": 96,
      "pong": 96,
      "sendcmpct": 66,
      "sendheaders": 24,
      "verack": 24,
      "version": 126
    },
    "bytesrecv_per_msg": {
      "feefilter": 32,
      "getaddr": 24,
      "ping": 96,
      "pong": 96,
      "sendcmpct": 66,
      "sendheaders": 24,
      "verack": 24,
      "version": 126
    }
  }
]

bitcoin-cli -regtest --datadir=/root/.bitcoin getnodeaddresses 5
[
]

```

## Bitcoin core version

```
bitcoin-cli -version
Bitcoin Core RPC client version v0.18.0.0-g2472733a24a9364e4c6233ccd04166a26a68cc65
bitcoind -version 
Bitcoin Core Daemon version v0.18.0.0-g2472733a24a9364e4c6233ccd04166a26a68cc65

```

Installed via the repository `ppa:bitcoin/bitcoin`

## OS

Docker container info:

```
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:    18.04
Codename:   bionic

```

Host info:

```
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:    18.04
Codename:   bionic

cat /proc/cpuinfo  | grep 'name'| uniq
model name  : Intel(R) Core(TM) i7-4600M CPU @ 2.90GHz

```

1 TB SSD disk

**Tags:** json-rpc, network

> **Comments:**
> **username_1**: There’s no `getnodeaddress` RPC call so it shouldn’t be surprising this fails. You probably mean `getnewaddress`.  
> **username_0**: I believe you are wrong, https://github.com/bitcoin/bitcoin/commit/a2eb6f540538d32725aecf678301a96247db6fd9 is the pull request adding the command to the codebase, and it is contained in release v0.18.0  
> **username_1**: You’re right, I was thinking of a similar altcoins RPC. It’s probably not returning any results because it’s not able to discover it’s public IP address? Not sure how that’s meant to function clearly.  
> **username_0**: Might be, I have opened an issue and will follow up here when it gets resolved  
> **username_1**: Sorry for my mistake there.  
> **username_0**: No worries, we are here to discuss :D  

---

## 0 answers

