Hello,
I'm able to connect to bitcoind remotely from my laptop using following CURL command:
curl --user user:password --data-binary '{"jsonrpc":"2.0","id":"curltest","method":"getblockchaininfo","params":[]}' -H 'content-type:text/plain;'
http://1.2.3.4:18332 -v
but I'm not able to call the lightingd remotely from my laptop using following CURL command:
curl --user user:password --data-binary '{"jsonrpc":"2.0","id":"curltest","method":"listpeers","params":[]}' -H 'content-type:text/plain;'
http://1.2.3.4:9735 -v
Trying 1.2.3.4:9735...
* connect to 1.2.3.4 port 9735 failed: Connection refused
* Failed to connect to 1.2.3.4 port 9735 after 517 ms: Connection refused
* Closing connection 0
curl: (7) Failed to connect to 1.2.3.4 port 9735 after 517 ms: Connection refused
Lightningd is running and I opened 9735 on the firewall. I can successfully run "lightning-cli -testnet listpeers" on the node locally.
When running "netstat -anpe | grep "9735" | grep "lightning"" I see there's already an established session on 9735.
tcp 0 0 1.2.3.4:34918 5.6.7.8:9735 ESTABLISHED 1000 41663 1508/lightning_conn
tcp6 0 0 :::19735 :::* LISTEN 1000 40773 1508/lightning_conn
Should I use another port for json-rpc access and leave 9735 for node/peer communication?
I already added 0.0.0.0/0 as rpcallow for testing in the bitcoin.conf file.
Anyone know how I should access lightning json-rpc remotely?
thanks,
Pecheur
Also, I know there's "lightning-cli connect" to connect remotely using the CLI.
But I would like to use JSON-RPC calls instead. First using CURL then using a nodejs request.