You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi I have a bitcoind run in testnet, I found the sample code is misleading, people who run it the first time will get 500 internal server error, the full reproduce step is as follow:
1. btcd config:
# Generated by https://jlopp.github.io/bitcoin-core-config-generator/# This config should be placed in following path:# ~/.bitcoin/bitcoin.conf# [core]# Specify the location of the configuration file. To use non-default location, create a default location config file containing this setting.
conf=~/.bitcoind/bitcoin.conf
# Specify a non-default location to store blockchain and other data.# datadir=/mnt/bitcoin/bitcoind/testnet# [debug]# Run this node on the Bitcoin Test Network.
testnet=1
# [rpc]# Accept command line and JSON-RPC commands.
server=1
# Accept public REST requests.
rest=1
# RPC user
rpcuser=rpcuser
# RPC password
rpcpassword=rpcpass
# RPC allow ip (allow all)
rpcallowip=0.0.0.0/0
# RPC bind
rpcbind=0.0.0.0
2. check the port listend
port 18332 for testnet rpc connection is listening
➜ ~ netstat -apnt
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:18332 0.0.0.0:* LISTEN 16025/bitcoind
tcp 0 0 0.0.0.0:18333 0.0.0.0:* LISTEN 16025/bitcoind
3. check the port from local
telnet successful
pro:go-bitcoind shiming$ telnet 10.211.55.7 18332
Trying 10.211.55.7...
Connected to ubuntu.shared.
Escape character is '^]'.
Connection closed by foreign host.
2018/10/06 11:26:25 HTTP error: 500 Internal Server Error
2018/10/06 11:26:25 <nil>
2018/10/06 11:26:25 HTTP error: 500 Internal Server Error
7. bitcoind debug.log
those rows begin with "Received a POST request for" is the log, but no detail logs, dosen't explain the 500 internal server error. But at least it is connected
......
2018-10-06 03:58:35 sending getheaders (933 bytes) peer=0
2018-10-06 03:58:35 Received a POST request for / from 10.211.55.2:62473
2018-10-06 03:58:35 ThreadRPCServer method=walletpassphrase
2018-10-06 03:58:35 Received a POST request for / from 10.211.55.2:62473
2018-10-06 03:58:35 ThreadRPCServer method=backupwallet
2018-10-06 03:58:35 copied wallet.dat to /tmp/wallet.dat
2018-10-06 03:58:35 Received a POST request for / from 10.211.55.2:62473
2018-10-06 03:58:35 ThreadRPCServer method=dumpprivkey
2018-10-06 03:58:35 tor: Error connecting to Tor control socket
2018-10-06 03:58:35 tor: Not connected to Tor control port 127.0.0.1:9051, trying to reconnect
2018-10-06 03:58:36 received: headers (162003 bytes) peer=0
......
8. my sample code suggestion
looking into the issue by add trace info and invoke another simple client methods, I found it actually successful connected, my code is as below
Hi I have a bitcoind run in testnet, I found the sample code is misleading, people who run it the first time will get 500 internal server error, the full reproduce step is as follow:
1. btcd config:
2. check the port listend
port 18332 for testnet rpc connection is listening
3. check the port from local
telnet successful
pro:go-bitcoind shiming$ telnet 10.211.55.7 18332 Trying 10.211.55.7... Connected to ubuntu.shared. Escape character is '^]'. Connection closed by foreign host.
4. run bitcoind
bitcoind -debug=1
5. run sample code
6. get err
7. bitcoind debug.log
those rows begin with "Received a POST request for" is the log, but no detail logs, dosen't explain the 500 internal server error. But at least it is connected
8. my sample code suggestion
looking into the issue by add trace info and invoke another simple client methods, I found it actually successful connected, my code is as below
The text was updated successfully, but these errors were encountered: