Multichain Web Demo - Error: HTTP 0

+2 votes

I have 2 PCs in my network - laptop with IP address 192.168.0.11 and desktop with IP address 192.168.0.10

My laptop is Windows 10 running Apache 2.4.29 and PHP 5.6.32.

I have installed the multichain software version 1.0.2 on both PCs. I have created chain1 on the laptop and connected to it from the desktop. I can run both getinfo and getpeerinfo from both PCs and they show the correct information.

When I run the web demo on my laptop it shows nothing but

Error: HTTP 0
http://127.0.0.1:6311/

I have stepped through the web demo with my debugger and the response to curl_exec() is always false. Below is the output from curl_getinfo():

array(26) {
["url"]=> string(22) "http://127.0.0.1:6311/"
["content_type"]=> NULL
["http_code"]=> int(0)
["header_size"]=> int(0)
["request_size"]=> int(257)
["filetime"]=> int(-1)
["ssl_verify_result"]=> int(0)
["redirect_count"]=> int(0)
["total_time"]=> float(0)
["namelookup_time"]=> float(1.0E-6)
["connect_time"]=> float(1.0E-6)
["pretransfer_time"]=> float(1.0E-6)
["size_upload"]=> float(48)
["size_download"]=> float(0)
["speed_download"]=> float(0)
["speed_upload"]=> float(48)
["download_content_length"]=> float(-1)
["upload_content_length"]=> float(48)
["starttransfer_time"]=> float(1.0E-6)
["redirect_time"]=> float(0)
["redirect_url"]=> string(0) ""
["primary_ip"]=> string(9) "127.0.0.1"
["certinfo"]=> array(0) {}
["primary_port"]=> int(6311)
["local_ip"]=> string(9) "127.0.0.1"
["local_port"]=> int(60247)
}

I have checked my Apache logs and no error is shown.

I have checked my firewall, which is managed by Norton Security, and it shows that it has allowed inbound traffic on port 6311.

Why am I getting an empty response with each curl_exec() ?

I have even tried replacing curl_exec() with fsockopen/fputs/fgets but the result is the same - no error, empty response

asked Nov 29, 2017 by Tony Marston

1 Answer

0 votes
Is 6311 definitely the API port number, and not the peer-to-peer port number? There are two different interfaces for these two types of connections.
answered Nov 29, 2017 by MultiChain
This is the output from multichaind when I created chain1:

multichaind chain1 -daemon

MultiChain 1.0.2 Daemon (latest protocol 10009)

Looking for genesis block...
Genesis block found

Other nodes can connect to this node using:
multichaind chain1@192.168.179.1:6311


This host has multiple IP addresses, so from some networks:

multichaind chain1@192.168.98.1:6311
multichaind chain1@192.168.0.11:6311

Node started

6311 is the only port number shown, so that is the one I am using.
Yes that is the port for other nodes. The Web Demo is not an node, but a client. The Web Demo docs tell you how to find the RPC port.
The README.MD file says the following on the port number "see rpc-port from chain parameters", but it does not identify where these "chain parameters" can be found.

I had a look in the params.dat file and found this line: "default-rpc-port = 6310"

I switched my port number in the config.txt file from 6311 to 6310 and it worked! I would suggest that the documentation be updated to be explicit instead of misleading.
Noted - we've tried to make this clearer in the example config file and README.
...