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 <!--- What behavior did you expect? -->
The getnodeaddresses RPC call should return nodes added via the add RPC call.
Actual behavior <!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->
No addresses are returned, i.e., an empty array is returned:
bitcoin-cli -regtest --datadir=/root/.bitcoin/ getnodeaddresses 5
[
]
Reproduction <!--- How reliably can you reproduce the issue, what are the steps to do so? -->
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:
bitcoin-cli -regtest --datadir=/root/.bitcoin/ getconnectioncount
10
bitcoin-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 <!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->
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<!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->
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