I'm using bitcoin 0.16.1 on a centos7 server
I'm trying to get the balance using rpc
The bitcoin.conf file is as follows:
testnet=1
maxconnections=20
server=1
rest=1
rpcauth=btxxxxxxxo:xxxxxxxxxxx
rpcport=8332
keypool=150
prune=0
The problem arises when I want to check the balance of an address with curl.
curl -v -u bxxxxxo:TBcxxxxxxxxs --data-binary '{"jsonrpc": "2.0", "method":"getbalance","params":["2N1vKxxxxxxxxxasdasdasdasdgG"],"id":3}' -H 'content-type: text/plain;' http://192.168.100.25:8332/```
result:
- About to connect() to 192.168.100.25 port 8332 (#0)
- Trying 192.168.100.25...
- Connected to 192.168.100.25 (192.168.100.25) port 8332 (#0)
- Server auth using Basic with user 'btxxxxxxdo'
POST / HTTP/1.1 Authorization: Basic YnRjbxxxxxxxxxxGRKxxxxxQ== User-Agent: curl/7.29.0 Host: 192.168.100.25:8332 Accept: / content-type: text/plain; Content-Length: 105
- upload completely sent off: 105 out of 105 bytes < HTTP/1.1 200 OK < Content-Type: application/json < Date: Wed, 11 Jul 2018 02:41:38 GMT < Content-Length: 42 < {"result":0.00000000,"error":null,"id":3}
- Connection #0 to host 192.168.100.25 left intact
but if I consult the same bitcoin address with bitcoin-cli I get the real balance of the account.
what am I doing wrong?
why do I get zero balance with rpc and with cli everything works fine?