IP address and port not accessable for my multichain node


#1
I am developing a blockchain application in multichain platform. my blockchain is running on the following ip and port 172.17.0.4, 6273 respectively but when i am trying to send a cUrl request to this port its not working. 

root@tahadhailey-blockchian-5280110:/home/ubuntu/.multichain/chain1# curl -vvvv multichainrpc:CYeoxgR14cyptsTavbvcPXnLtcJULfRBaCj4DChfDEf8 --data ‘{“jsonrpc”: “1.0”, “id”:“curltest”, “method”: “getinfo”, “params”: [] }’ -H ‘content-type: text/plain;’ http://172.17.0.4:6272

  • Rebuilt URL to: multichainrpc:CYeoxgR14cyptsTavbvcPXnLtcJULfRBaCj4DChfDEf8/
  • Hostname was NOT found in DNS cache
  • Could not resolve host: multichainrpc
  • Closing connection 0
    curl: (6) Could not resolve host: multichainrpc
  • Rebuilt URL to: http://172.17.0.4:6272/
  • Hostname was NOT found in DNS cache
  • Trying 172.17.0.4…
  • connect to 172.17.0.4 port 6272 failed: Connection refused
  • Failed to connect to 172.17.0.4 port 6272: Connection refused
  • Closing connection 1
    curl: (7) Failed to connect to 172.17.0.4 port 6272: Connection refused

Please guide i am very confused.
is there a firewall thats blocking the curl request to the port or do i have to whitelist the ips. Then how to do it.??
Can i get access to the ip and port ? i am using free version of cloud9
Active servers running


#2

Only ports 8080, 8081 and 8082 are internet facing for hosted Cloud9 workspaces, so 6272 will not work. Please see our documentation on ports for more information and do note that these ports only support HTTP and WebSockets for internet facing applications.

One alternative is that instead of sending your cURL requests to 172.17.0.4:6272 you can send them to localhost:6272.


#3

I have tried using localhost:6272 instead of cUrl but i get the same errro :

  • Rebuilt URL to: multichainrpc:CYeoxgR14cyptsTavbvcPXnLtcJULfRBaCj4DChfDEf8/
  • Hostname was NOT found in DNS cache
  • Could not resolve host: multichainrpc
  • Closing connection 0
    curl: (6) Could not resolve host: multichainrpc
  • Rebuilt URL to: http://localhost:6272/
  • Hostname was NOT found in DNS cache
  • Trying ::1…
  • Connected to localhost (::1) port 6272 (#1)

POST / HTTP/1.1
User-Agent: curl/7.35.0
Host: localhost:6272
Accept: /
content-type: text/plain;
Content-Length: 71

  • upload completely sent off: 71 out of 71 bytes
  • HTTP 1.0, assume close after body
    < HTTP/1.0 401 Authorization Required
    < Date: Wed, 06 Sep 2017 10:09:28 +0000
    < Server: bitcoin-json-rpc/v0.10.0.0-unk
    < WWW-Authenticate: Basic realm=“jsonrpc”
    < Content-Type: text/html
    < Content-Length: 296
    <
Error

401 Unauthorized.

* Closing connection 1

#4

Can you share the full command that you are running? It looks like http://localhost:6272 expects authorization information.


#5

root@tahadhailey-blockchian-5280110:/home/ubuntu/.multichain/chain1# curl -vvvv multichainrpc:CYeoxgR14cyptsTavbvcPXnLtcJULfRBaCj4DChfDEf8 --data ‘{“jsonrpc”: “1.0”, “id”:“curltest”, “method”: “getinfo”, “params”: [] }’ -H ‘content-type: text/plain;’ http://localhost:6272

Multichain Credentials
username = multichainrpc
password = CYeoxgR14cyptsTavbvcPXnLtcJULfRBaCj4DChfDEf8

Note: Command starts from cURL


#6

It looks like you’re not passing the credentials correctly.

Does this work?

curl -vvvv --data ‘{“jsonrpc”: “1.0”, “id”:“curltest”, “method”: “getinfo”, “params”: [] }’ -H ‘content-type: text/plain;’ http://multichainrpc:CYeoxgR14cyptsTavbvcPXnLtcJULfRBaCj4DChfDEf8@localhost:6272

#7

NO its not working

got this error

  • Rebuilt URL to: “1.0”,/
  • Input domain encoded as `UTF-8’
  • Hostname was NOT found in DNS cache
  • Could not resolve host: xn--1-ohn.xn--0,-z2t
  • Closing connection 0
    curl: (6) Could not resolve host: xn--1-ohn.xn--0,-z2t
  • Rebuilt URL to: “id”:“curltest”,/
  • Input domain encoded as `UTF-8’
  • Hostname was NOT found in DNS cache
  • Could not resolve host: xn–id-v2tg
  • Closing connection 1
    curl: (6) Could not resolve host: xn–id-v2tg
  • Rebuilt URL to: “method”:confused:
  • Input domain encoded as `UTF-8’
  • Hostname was NOT found in DNS cache
  • Could not resolve host: xn–method-oi0coa
  • Closing connection 2
    curl: (6) Could not resolve host: xn–method-oi0coa
  • Rebuilt URL to: “getinfo”,/
  • Input domain encoded as `UTF-8’
  • Hostname was NOT found in DNS cache
  • Could not resolve host: xn–getinfo,-2p3dra
  • Closing connection 3
    curl: (6) Could not resolve host: xn–getinfo,-2p3dra
  • Rebuilt URL to: “params”:confused:
  • Input domain encoded as `UTF-8’
  • Hostname was NOT found in DNS cache
  • Could not resolve host: xn–params-oi0coa
  • Closing connection 4
    curl: (6) Could not resolve host: xn–params-oi0coa
    curl: (3) [globbing] bad range specification in column 2
    curl: (3) [globbing] unmatched close brace/bracket in column 1
  • Hostname was NOT found in DNS cache
  • Could not resolve host: text
  • Closing connection 5
    curl: (6) Could not resolve host: text
    bash: ’: command not found

#8

It looks like the quoting is wrong in the paste that you gave. Try this:

curl -vvvv --data '{"jsonrpc": "1.0", "id":"curltest", "method": "getinfo", "params": [] }' -H 'content-type: text/plain;' http://multichainrpc:CYeoxgR14cyptsTavbvcPXnLtcJULfRBaCj4DChfDEf8@localhost:6272

#9

Thanks a lot it worked!! Thank you very much


#10

If i want to do a cURL request in postman. What ip should i use instead of localhost ??


#11

You can only access ports 8080, 8081 and 8082 outside of your workspace, so you will need to change your application to listen on one of those ports instead. If you listen on port 8080 you can then connect to your application from outside of your container using https://<workspacename>-<username>.c9users.io.

See our documentation on ports in hosted workspaces for more information.