1

I am trying to start carthagenet.sh in RPC mode on Ubuntu 18.04

$ ./carthagenet.sh start --rpc-port 8732

It appears to start fine:

v7.0: Pulling from tezos/tezos
Digest: sha256:da126e8d6bf137a9b326c3992c0e464622b94e2ee42b7d311df158212b8ae153
Status: Image is up to date for tezos/tezos:v7.0
docker.io/tezos/tezos:v7.0
Creating network "carthagenet_default" with the default driver
Creating carthagenet_node_1     ... done
Creating carthagenet_upgrader_1                   ... done
Creating carthagenet_baker-006-PsCARTHA-test_1    ... done
Creating carthagenet_endorser-alpha-test_1        ... done
Creating carthagenet_endorser-006-PsCARTHA_1      ... done
Creating carthagenet_baker-006-PsCARTHA_1         ... done
Creating carthagenet_accuser-alpha_1              ... done
Creating carthagenet_accuser-006-PsCARTHA-test_1  ... done
Creating carthagenet_accuser-alpha-test_1         ... done
Creating carthagenet_endorser-006-PsCARTHA-test_1 ... done
Creating carthagenet_baker-alpha-test_1           ... done
Creating carthagenet_endorser-alpha_1             ... done
Creating carthagenet_baker-alpha_1                ... done
Creating carthagenet_accuser-006-PsCARTHA_1       ... done

However, as soon as I run any command I get an error:

$ ./carthagenet.sh client list known addresses
Error response from daemon: Container 9920d6b346868d3d5491c0cd88eee100189c470d2107fa49cde6086568ec1383 is restarting, wait until the container is running

I used the following command to debug issues with the docker container:

docker logs --tail 50 --follow --timestamps 9920d6b346868d3d5491c0cd88eee100189c470d21

It appears the docker container keeps trying to restart with this error message:

2020-05-14T07:02:29.592446544Z Current public chain: 2018-06-30T16:07:32Z.
2020-05-14T07:02:29.593149945Z Local chain data: 2018-06-30T16:07:32Z.
2020-05-14T07:02:29.593724545Z Updating the node configuration...
2020-05-14T07:02:29.666034593Z tezos-node: unknown option `--rpc-port'.
2020-05-14T07:02:29.666059993Z Usage: tezos-node config [OPTION]... [OPERATION]
2020-05-14T07:02:29.666064593Z Try `tezos-node config --help' or `tezos-node --help' for more information.

All documentation I find seems to suggest --rpc-port is the correct option. Where could I be having issues?

2 Answers 2

0

It seems carthagenet.sh has a bug. Documentation in the file says we should run

./carthagenet.sh start --rpc-port 8732

Doing this will update the .tezos-carthagenet/docker-compose.yml to have the following command and ports:

command: tezos-node --network carthagenet --rpc-port 8732
ports:
  - "19732:19732"

However, as I said in my question, the docker container will not start because of the unexpected --rpc-port argument being passed in. So, I took a look at the update_compose_file() method in the bash script that updates the docker-compose.yml file before the container starts:

update_compose_file() {
    ...

    if [ "$#" -ge 2 ] && [ "$1" = "--rpc-port" ] ; then
        export_rpc="
      - \"$2:8732\""
        shift 2
    fi

    cat > "$docker_compose_yml" <<EOF
    ...
}

If if statement never gets executed because $1 contains the string --network. Remember the argument array will look like:

$1: --network
$2: carthagenet
$3: --rpc-port
$4: 8732

We need to change the if statement to read "$3" = "--rpc-port". Similarly, with that fixed, we need to update the conditional code to contain $4:8732, not $2, as well as update shift 2 to shift 4 to erase both sets of arguments for the rest of the bash script to run properly.

Rerunning the ./carthagenet.sh start --rpc-port 8732 command will then update the docker-compose.yml file correctly to

command: tezos-node --net-addr :19732
ports:
  - "19732:19732"
  - "8732:8732"

allowing RPC calls to work from the command line.

0

The node fails to start because --rpc-port is being added to the Docker Compose start command arguments for the tezos-node executable. The correct exec switch is --rpc-addr. The current documentation is incorrect or inconsistent. An alternative tool that helps you manages mainnet, zeronet, and carthagenet containers is teztool. https://gitlab.com/nomadic-labs/teztool

Docker Compose

/Users/username/.tezos-carthagenet/docker-compose.yml

Carthagenet Command

./carthagenet.sh start --rpc-addr 8732
1

Your Answer

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

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