No addresses returned by getnodeaddresses RPC call

0

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

user3223162

Posted 2019-09-30T09:40:08.820

Reputation: 101

There’s no getnodeaddress RPC call so it shouldn’t be surprising this fails. You probably mean getnewaddress.Anonymous 2019-09-30T12:15:51.280

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 2019-09-30T13:23:58.063

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.Anonymous 2019-09-30T13:25:21.330

Might be, I have opened an issue and will follow up here when it gets resolveduser3223162 2019-09-30T13:26:39.307

Sorry for my mistake there.Anonymous 2019-09-30T13:27:00.793

No worries, we are here to discuss :Duser3223162 2019-09-30T13:27:56.643

No answers