1

I'm trying to run a substrate node through docker container but i am not able to with this command:

docker run -p 9944:9944 -p 30333:30333 -p 9933:9933 -p 9615:9615 docker.io/decentration/supersig-node:latest --dev --port 30333 --ws-port 9944 --rpc-port 9933

The logs look like this:

2022-09-21 13:21:19 〽️ Prometheus exporter started at 127.0.0.1:9615    
2022-09-21 13:21:19 Running JSON-RPC HTTP server: addr=127.0.0.1:9933, allowed origins=None    
2022-09-21 13:21:19 Running JSON-RPC WS server: addr=127.0.0.1:9944, allowed origins=None 

enter image description here

but i'm not getting any errors from the console.

What am i missing from the command?

Update: i am allowing insecure messages but still not working from docker. Also i have a mac m2. I found that it can work on mac Intel chip. also if you add --unsafe-ws-external to the command then it should work fine.

enter image description here

4
  • It only works in Firefox for me because of some policy. Are you using MacOS? Docker behaves a bit different there as well. Sep 21, 2022 at 13:51
  • ok so the above command works for you on firefox, I will check that. Yes indeed im using MacOS. So its not necessarily an error in the command... Sep 21, 2022 at 14:22
  • Try --net=host instead of the ports. It should only be used for local development and not deployment. Sep 21, 2022 at 15:15
  • i tried --net=host replacing the -p ports, but then it attaches to 0.0.0.0 instead of 127.0.0.1, so i try to connect to ws://0.0.0.0:9944 and i get ...insecure access deprecated. Sep 21, 2022 at 15:20

3 Answers 3

2

Try boot with:

--unsafe-ws-external --rpc-cors all
8
  • i tried this but then i try connect via ws://0.0.0.0:9944 instead of 127.0.0.1. And then the console error is WS endpoint= ws://0.0.0.0:9944 The page at 'https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F0.0.0.0%3A9944#/addresses' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://0.0.0.0:9944/'. This endpoint should be available via WSS. Insecure access is deprecated. + ...Connecting to a non-secure WebSocket server from a secure origin is deprecated. then i try wss:// and get: API-WS: disconnected from wss://0.0.0.0:9944: 1006:: Abnormal Closure Sep 21, 2022 at 14:47
  • Yep, to solve that you just need to follow Guantong's answer. Sep 21, 2022 at 14:49
  • my insecure content is already set to Allow. I wonder if the command is working for anyone, perhaps its my mac m2 on chrome with Docker, because it works fine without Docker. Sep 21, 2022 at 14:53
  • From your screenshot, I think you are still in 'secure' mode. Sep 21, 2022 at 15:06
  • that was an old screenshot, now insecure mode is allowed, and still same behaviour. i updated the main comment to show that. Sep 21, 2022 at 15:13
2

It seems we have found one of the problems could be. There is a problem for Mac M1/M2 chips related to port forwarding with Docker.

https://forums.docker.com/t/port-forward-not-working-on-a-macos-installation-but-works-on-others/77401/6

To guarantee it works, you need to run it over wss:// secure websocket connection, using reverse nginx proxy.

1

Have you tried allowing Insecure content?Chrome allows you to connect to wss by default, but you are using ws. So you could try to allow insecure content for development

  1. enter image description here
  2. enter image description here
1
  • hey, i tried this but i think its a docker thing, because if i run a node-template outside of docker then it works fine. Sep 21, 2022 at 14:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.