Closed easeev closed 4 years ago
You are using the -rpcssl
command-line parameter and this requires the node itself to be running with the same parameter. Could that be the problem?
Similar result without this parameter:
$ ./multichain-cli nw-123-456-7 -rpcconnect=nd-123-456-789.p2pify.com -rpcport=80 -rpcuser=focused-koala -rpcpassword=shadow-sierra-sketch-edison-bonded-paging
MultiChain 2.0.2 RPC client
Interactive mode
nw-123-456-7: getinfo
{"method":"getinfo","params":[],"id":"81549545-1561687280","chain_name":"nw-123-456-7"}
error: couldn't parse reply from server
Chainstack JSON-RPC API is exposed through a dedicated ingress and not directly from the node. Perhaps that helps to understand the problem better.
Well yes, if you have some intermediate layer between the node and the incoming JSON-RPC request, that will probably explain the problem. You should be able to debug this by looking at the difference between the original response and the forwarded one.
Debugged a little. Looks like the multichain-cli
request is sent with Host: 127.0.0.1
header which breaks the flow:
OK, thanks for working it out. This is a legitimate HTTP header so I think the intermediate layer needs to be able to process it, no?
Well, the intermediate layer is happy to process it if the value is correct and not 127.0.0.1
:)
See https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html:
The Host field value MUST represent the naming authority of the origin server or gateway given by the original URL.
OK, understood, we'll look into it.
This should be fixed in the latest builds released today - please confirm.
It works, thanks!
$ ./multichain-cli nw-123-456-78 -rpcconnect=nd-123-456-789.p2pify.com -rpcport=443 -rpcuser=focused-koala -rpcpassword=shadow-sierra-sketch-edison-bonded-paging -rpcssl
MultiChain 2.0.3 RPC client
Interactive mode
nw-123-456-78: getinfo
{"method":"getinfo","params":[],"id":"85616894-1576762628","chain_name":"nw-123-456-78"}
{
"version" : "2.0.3",
...
}
I'm using Chainstack for network and node deployment.
I can interact with RPC via multiple methods described here (curl) and here (JavaScript and Python libraries) but not with
multichain-cli
.I'm getting the error providing all required parameters:
What could be the issue? Am I missing something?