movementlabsxyz / movement

The Movement Network is a Move-based L2 on Ethereum.
Apache License 2.0
72 stars 61 forks source link

Issue setting up movement node, follower node and some doc issues #712

Open lokesh-lync opened 1 week ago

lokesh-lync commented 1 week ago

Describe the bug Not able to run movement node and follower node

Expected behavior Expected to be able to run the node properly

To Reproduce

Environment: AWS

I followed this doc: https://github.com/movementlabsxyz/movement/blob/main/docs/movement-node/run/manual/README.md There are some issues in this doc itself:

  1. In the step 4 mentioned in the doc:
    
    DOT_MOVEMENT_PATH="~/.movement"
    export DOT_MOVEMENT_PATH
    echo "DOT_MOVEMENT_PATH=${DOT_MOVEMENT_PATH}" >> "${MOVEMENT_ENV_FILE}"

mkdir -p "${DOT_MOVEMENT_PATH}" docker compose \ -f docker/compose/suzuka-full-node/docker-compose.yml \ -f docker/compose/suzuka-full-node/docker-compose.setup-local.yml \ -f docker/compose/suzuka-full-node/docker-compose.celestia-local.yml \ pull

Here it is trying to pull docker images using the docker-compose files in this  directory: https://github.com/movementlabsxyz/movement/tree/main/docker/compose/suzuka-full-node

This issue is that only `docker-compose.yml` file is present in that directory. And I figure `docker-compose.setup-local.yml` has been renamed to `docker-compose.local.yml` but it does not reflect in the doc.

So, I did some modifications to be able to run the node. Here is a bash script that I am using to run the node using systemd:
```bash
rm -rf ~/movement/.env
rm -rf ~/.movement

GIT_ROOT=$(git rev-parse --show-toplevel)
MOVEMENT_ENV_FILE="${GIT_ROOT}/.env"
[[ -n "${GIT_ROOT}" ]] && touch "${MOVEMENT_ENV_FILE}"
mkdir -p ~/.movement

CONTAINER_REV=$(git rev-parse HEAD)
[[ -n "${CONTAINER_REV}" ]] \
  && export CONTAINER_REV=${CONTAINER_REV} \
  && echo "REV=${CONTAINER_REV}" >> "${MOVEMENT_ENV_FILE}"
echo "INFO: movement version is"
cat ${MOVEMENT_ENV_FILE}

DOT_MOVEMENT_PATH="~/.movement"
export DOT_MOVEMENT_PATH
echo "DOT_MOVEMENT_PATH=${DOT_MOVEMENT_PATH}" >> "${MOVEMENT_ENV_FILE}"

AWS_ACCESS_KEY_ID="------OMMITED------"
export AWS_ACCESS_KEY_ID
echo "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" >> "${MOVEMENT_ENV_FILE}"

AWS_DEFAULT_REGION="us-east-1"
export AWS_DEFAULT_REGION
echo "AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}" >> "${MOVEMENT_ENV_FILE}"

AWS_SECRET_ACCESS_KEY="------OMMITED------"
export AWS_SECRET_ACCESS_KEY
echo "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" >> "${MOVEMENT_ENV_FILE}"

docker compose \
        -f docker/compose/suzuka-full-node/docker-compose.yml \
        -f docker/compose/suzuka-full-node/docker-compose.local.yml \
        pull

cat "${MOVEMENT_ENV_FILE}"
DOT_MOVEMENT_PATH=/home/ubuntu/.movement

docker images | { head -1 ; grep movementlabsxyz ; }

printenv | grep --quiet USER \
  && printenv | grep --quiet CONTAINER_REV \
  && echo "INFO: Using USER=${USER} and CONTAINER_REV=${CONTAINER_REV}" \
  && envsubst < docs/movement-node/run/manual/suzuka-full-node.service.template \
              > docs/movement-node/run/manual/suzuka-full-node.service

docker compose --env-file .env -f docker/compose/suzuka-full-node/docker-compose.yml -f docker/compose/suzuka-full-node/docker-compose.local.yml up

And here is my systemd service file:

[Unit]
Description=Suzuka Full Node
After=network.target

[Service]
Type=simple
User=ubuntu
WorkingDirectory=/home/ubuntu/movement
ExecStart=/bin/bash /home/ubuntu/movement/run.sh
Restart=on-failure

[Install]
WantedBy=multi-user.target

It seems to work but the output that I get from http://<IP-ADDRESS>:30731/v1

{
  "chain_id": 27,
  "epoch": "1",
  "ledger_version": "11",
  "oldest_ledger_version": "0",
  "ledger_timestamp": "1729258776245102",
  "node_role": "validator",
  "oldest_block_height": "0",
  "block_height": "4",
  "git_hash": "7a0e210fe29e2c81c378568eba2b467a7ef6a56e"
}

Here you can see it shows the latest block height to be 4 and is stuck there.

Here are some docker logs to debug: https://github.com/lokesh-lync/docker-logs-movement-node-setup

Then I tried running the follower node using this doc: https://github.com/movementlabsxyz/movement/blob/main/docs/movement-node/run/manual/follower-node/README.md

I used this command after setting env variables:

just suzuka-full-node docker-compose follower

This is the output I got:

[+] Running 6/6                                                                   0.1s ✘ Container setup                       Error                                  31.9s
 ✔ Container celestia-light-node         Recr...                                10.2s  ✔ Container celestia-light-node-synced  Recreated                               0.1s  ✔ Container m1-da-light-node            Recreat...                             10.2s
 ✔ Container suzuka-full-node            Recreat...                              0.3s
 ✔ Container suzuka-faucet-service       Re...                                  10.2s
dependency failed to start: container setup exited (1)
error: Recipe `suzuka-full-node` failed on line 6 with exit code 1

The output now for http://localhost:30731/v1 :

curl http://localhost:30731/v1curl: (7) Failed to connect to localhost port 30731 after 0 ms: Couldn't connect to server

docker ps:

CONTAINER ID   IMAGE                                                                                               COMMAND                  CREATED             STATUS                       PORTS                                                                                      NAMES
6b80e7c2ac81   ghcr.io/movementlabsxyz/m1-da-light-node-celestia-bridge:b00020ae3184865b2025d1d31744371afc632a21   "/app/m1-da-light-no…"   About an hour ago   Up About an hour (healthy)   0.0.0.0:26658->26658/tcp, :::26658->26658/tcp                                              m1-da-light-node-celestia-bridge
1d2f527a74cf   ghcr.io/movementlabsxyz/m1-da-light-node-celestia-appd:b00020ae3184865b2025d1d31744371afc632a21     "/app/m1-da-light-no…"   About an hour ago   Up About an hour (healthy)   0.0.0.0:9090->9090/tcp, :::9090->9090/tcp, 0.0.0.0:26657->26657/tcp, :::26657->26657/tcp   m1-da-light-node-celestia-appd

As you can see some containers are stopped now.

mzabaluev commented 1 day ago

This is the output I got:

[+] Running 6/6                                                                   0.1s ✘ Container setup                       Error                                  31.9s
 ✔ Container celestia-light-node         Recr...                                10.2s  ✔ Container celestia-light-node-synced  Recreated                               0.1s  ✔ Container m1-da-light-node            Recreat...                             10.2s
 ✔ Container suzuka-full-node            Recreat...                              0.3s
 ✔ Container suzuka-faucet-service       Re...                                  10.2s
dependency failed to start: container setup exited (1)
error: Recipe `suzuka-full-node` failed on line 6 with exit code 1

Can you attach logs from the setup container that has failed?