polkadot icon indicating copy to clipboard operation
polkadot copied to clipboard

`--port` and `--listen-address` are seemingly ignored, polkadot always binds to port 30333

Open Nexus2k opened this issue 3 years ago • 1 comments

When I try to start polkadot with the following argument list: "polkadot" "--name=MY_NODE", "-lINFO", "--chain=polkadot", "--validator", "--rpc-methods=Unsafe", "--rpc-external", "--rpc-cors=all", "--listen-addr=/ip4/0.0.0.0/tcp/30334", "--public-addr=/ip4/1.2.3.4/tcp/30334", # External addr doesn't matter here "--prometheus-external", "--no-mdns", "--pruning=1000", "--telemetry-url=wss://telemetry.polkadot.io/submit/ 1"

I still see the binary binding to Port 30333. Also when using --port 30334 instead of the --listen-addr parameter it still keeps binding to port 30333 locally.

Nexus2k avatar Jun 04 '22 07:06 Nexus2k

For reproduction, I use the parity/polkadot:0.9.23 docker image. The full docker compose file:

version: '3'
        services:
            polkadot:
                image: parity/polkadot
                container_name: '{{ docker_name }}'
                command:
                    [
                        "--name={{ node_name }}",
                        "-l{{ logging_filter }}",
                        "--chain={{ chain }}",
                        "--validator",
                        "--rpc-methods=Unsafe",
                        "--rpc-external",
                        "--rpc-cors=all",
                        "--listen-addr=/ip4/0.0.0.0/tcp/{{ p2p_listen }}",
                        "--public-addr=/ip4/{{ ansible_default_ipv4.address }}/tcp/{{ p2p_listen }}",
                        "--prometheus-external",
                        "--no-mdns",
                        "--pruning=1000",
                        "--telemetry-url=wss://telemetry.polkadot.io/submit/ 1",
                        "--telemetry-url={{ telemetry_url }} 1"
                    ]
                volumes:
                - "{{ db_path }}:/polkadot"
                ports:
                - "{{ rpc_listen }}:9933"
                - "{{ ws_listen }}:9944"
                - "{{ metrics_listen }}:9615"
                - "{{ p2p_listen }}:{{ p2p_listen }}"
                hostname: '{{ docker_name }}'
                restart: unless-stopped

Replace the stuff in {{ }} with data matching your setup. As mentioned if the p2p_listen port is not matching 30333 the container still binds a socket to 30333 regardless. My deployment repo is at https://github.com/Nexus2k/polkadot-ansible

Nexus2k avatar Jun 04 '22 07:06 Nexus2k