Issue trying to connect to community testnet via podman container

I’m trying to connect a node to the community testnet.
I’m not sure if that’s still running, but I’m running into an issue even before that.

my connection attempt

$ ./tc_run.sh
Error: rootlessport listen tcp my.ip.v4.address:12345: bind: cannot assign requested address

tc_run.sh

#!/bin/bash

./run.sh -n 0 -x community_test -a my.ip.v4.address -p 12345 -i ghcr.io/safenetwork-community/joinnode-ipv4:main

run.sh

#!/bin/sh

usage()
{
  echo "Usage: [-n node_number] [-x network_name] [-a address] [-p port] [-d cli_dir] [-s storage_dir] [-i image]"
}

ROOT_IP='127.0.0.1'
NODE_NUMBER=1
ROOT_PORT=12000
CLI_DIR=~/.local/share/safe/cli/
IMAGE=localhost/joinnode-ipv4

while getopts ':n:x:a:p:d:s:i:h' c
do
  case $c in
    n) NODE_NUMBER=$OPTARG ;;
    x) NETWORK_NAME=$OPTARG ;;
    a) ROOT_IP=$OPTARG ;;
    p) ROOT_PORT=$OPTARG ;;
    d) CLI_DIR=$OPTARG ;;
    s) STORAGE_DIR=$OPTARG ;;
    i) IMAGE=$OPTARG ;;
    h|?) usage ;;
  esac
done

ROOT_PORT=`expr $ROOT_PORT + $NODE_NUMBER`

if [ ! -d $CLI_DIR ]
then
  mkdir -p $CLI_DIR
fi

podman unshare chown 1000:1000 -R ~/.local/share/safe/cli

podman run \
--name joinnode-ipv4_$NODE_NUMBER \
--restart unless-stopped \
--publish $ROOT_IP:$ROOT_PORT:$ROOT_PORT/tcp \
--publish $ROOT_IP:$ROOT_PORT:$ROOT_PORT/udp \
--env ROOTCLI_IP=$ROOT_IP \
--env ROOTCLI_PORT=$ROOT_PORT \
--mount type=bind,source=$CLI_DIR,destination=/home/admin/.safe/cli/ \
-d $IMAGE

Dockerfile

# Build SafeNetwork docker container
FROM docker.io/library/alpine:3.14
LABEL version="1.1"
LABEL maintainer="Folât Pjêrsômêj"
LABEL release-date="2021-11-18"

# Update and install dependencies
RUN apk update && apk add \
  bash \
  curl \
  jq

RUN addgroup -g 1000 admin
RUN adduser -s /bin/bash --ingroup admin --uid 1000 --disabled-password admin
USER admin
WORKDIR /home/admin

# Install latest safe network version
RUN curl -s https://raw.githubusercontent.com/safenetwork-community/safenetwork-dockerfiles/main/scripts/sn_install.sh -o /tmp/sn_install.sh
RUN bash /tmp/sn_install.sh

RUN ls -lha /home/admin/.safe/node

# Set ENV PATH (after build will be used to find the safe node command)
ENV PATH=$PATH:/home/admin/.safe:/home/admin/.safe/node

# Adding a list of networks to join
RUN curl -s https://raw.githubusercontent.com/safenetwork-community/safenetwork-dockerfiles/main/scripts/sn_add_networks.sh -o /tmp/sn_add_networks.sh
RUN bash /tmp/sn_add_networks.sh

# Default env values
ENV JOINNODE_PORT=12000
ENV NETWORK_NAME="local-ipv4"

# Expose PORT of the node
EXPOSE $JOINNODE_PORT

# Assign volume
VOLUME /home/admin/.safe/cli

# Launch safe join node
ENTRYPOINT safe networks switch $NETWORK_NAME && RUST_LOG=safe_network=info,qp2p=info ~/.safe/node/sn_node --skip-igd

Port forwarding on my modem

1 Like