"error: couldn't connect to server" when blockchain was created

+2 votes

I create the blockchain with:

multichain-util create test-db \
-default-network-port=4000 \

Then I start the node with:

multichaind test-db -rpcallowip= -autosubscribe=streams -daemon

And I get the proper output, stating that the node has been started successfully and is ready. And when I want to make calls against the API, f.e.:

multichain-cli test-db getinfo


multichain-cli test-db -port=4000 -rpcport=4001 getinfo

I get "error: couldn't connect to server"

asked Apr 15 by milkncookiez
Make sure that your firewall allows this port.

1 Answer

+2 votes
Best answer

Actually here is what happened: when I would pass the value to -default-rpc-port as a number, directly, it worked. But since I was lifting the node thru a bash script, I was passing the value thru an env var. And the problem was there - the env var was somehow set incorrectly, and therefore the value was not passed to the -default-rpc-port parameter. I discovered that by inspecting the params.dat config file of the blockchain. The RPC port was set to 0 which made me realize it is not being set with the value I want it to. :)

answered Apr 16 by milkncookiez
selected Apr 16 by milkncookiez
Great, thanks for solving your own question!