Skip to content

movementlabsxyz/movement

Repository files navigation

Discord badge Twitter handle

The Movement SDK is a collection of tools and libraries for building, deploying, and working with Movement Labs infrastructure. The SDK is designed to be modular and extensible, allowing developers to build custom tools and libraries on top of the core components as well as to interact with Movement Labs' own networks.

Note: unless otherwise specified assume all commands below are run after entering a nix shell with nix develop.

Organization

  • scripts: Scripts for running Movement Labs software. See the scripts README for more information about the organization of scripts.
  • process-compose: Process compose files for running Movement Labs software. These files are part of the standard flow for running and testing components in the Movement Network. See the scripts README for more information about the organization of scripts.
  • docker: Dockerfiles for building Movement Labs software and Docker compose files for orchestrating services. See the docker README for more information about the organization of Dockerfiles.
  • protocol-units: Protocol units for the Movement Network. These are the core building blocks of the Movement Network. See the protocol-units README for more information about the organization of protocol units.
  • networks: Network runner entry points for the Movement Network. These are the entry points for running the Movement Network. See the networks README for more information about the organization of network runners.
  • util: Utility crates for the Movement SDK. These crates provide useful functions, macros, and types for use in Movement SDK projects. See the util README for more information about the organization of utility crates.
  • proto: Protocol buffer definitions for the Movement Network. These definitions are used to generate code for interacting with the Movement Network. See the proto README for more information about the organization of protocol buffer definitions.

Naming Conventions

Because we are in early stages of the "movement" network we decided to version the network using formula one track names ("Monaco", "Monza", "Suzuka") instead of a more classical semantic versioning.

Naming Conventions Latest: SUZUKA

Prerequisites

Prerequisites - Just command

just is a handy way to save and run project-specific commands. Please install it following just install instructioins. macOS and debian based systems instructions below.

Just command - macOS

brew install just

Check install

just --version

Just command - debian

sudo apt update && sudo apt install --yes just

Check install

just --version

Prerequisites - Nix : the package manager

https://nix.dev/install-nix

Running Natively

m1-da-light-node

  • Features:
    • build: Build the m1-da-light-node binaries.
    • setup: Run setup for new m1-da-light-node network with single node.
    • local: Run a local Celestia Data Availability service. (Default.)
    • arabica: Run an Arabica Celestia Data Availability service. (Overrides local.)
    • test: Run the test suite for the m1-da-light-node. (Can be combined with local or arabica. Exits on completion by default.)
# example test with local  Celestia Data Availability service
just m1-da-light-node native build.setup.test.local

suzuka-full-node

  • Features:
    • build: Build the suzuka-full-node binaries.
    • setup: Run setup for new suzuka-full-node network with single node.
    • local: Run a local Celesta Data Availability service.
    • test: run the test suite for suzuka-full-node. (Can be combined with local. Exits on completion by default.)
# example test with local
just monza-full-node native build.setup.test.local

Run a Movement Node with Docker Compose

  1. Make sure you have installed the just command on your system. If not check the "Prerequisites" section of this repo.

  2. When running with docker compose specify your revision in a file .env at the root of the project. The file should look like this:

# /path/to/movement/.env
CONTAINER_REV=0fe2a4f28820c04ca0db07cdd44cafc98b792f3f

We recommend to use the latest commit of the "main" branch:

GIT_ROOT=$(git rev-parse --show-toplevel)
MOVEMENT_ENV_FILE="${GIT_ROOT}/.env"
[[ -n "${GIT_ROOT}" ]] \
  && echo  "CONTAINER_REV=$(git rev-parse HEAD)" > "${MOVEMENT_ENV_FILE}"
echo "INFO: movement version is $(cat ${MOVEMENT_ENV_FILE})"

suzuka-full-node

  • Features:
    • setup: Run setup for new suzuka-full-node network with single node.
    • local: Run a local Celesta Data Availability service.

Note: Currently, both setup and local must be used. We only support running the suzuka-full-node with a local Celesta Data Availability service via Docker Compose.

# example setup with local
just suzuka-full-node docker-compose setup.local

Under the hood, just runs

# working directory = GIT_ROOT
GIT_ROOT=$(git rev-parse --show-toplevel)
docker compose --env-file .env \
               --file docker/compose/suzuka-full-node/docker-compose.yml \
               --file docker/compose/suzuka-full-node/docker-compose.setup.yml \
               --file docker/compose/suzuka-full-node/docker-compose.local.yml \
               up

Note: if you want to recreate the network, but not rely on the just target above, please read through the scripts to identify the correct docker-compose files to run.

Note For attesters in order to receive rewards you need to launch the node in Attester mode. To do this you will need to provide a private key at runtime. This feature is not implemented yet, at this moment.

Services

suzuka-full-node

Both native and docker-compose runners will serve the following services listening on the specified default addresses:

Note: Only APIs intended for the end-user are listed here. For a full list of services, please refer to respective docker-compose files.

Troubleshooting

cp: cannot stat '': No such file or directory when running just suzuka-full-node native build.setup.test.local

Try the following nix.conf:

build-users-group = nixbld
experimental-features = nix-command flakes repl-flake
bash-prompt-prefix = (nix:$name)\040
max-jobs = auto
extra-nix-path = nixpkgs=flake:nixpkgs
upgrade-nix-store-path-url = https://install.determinate.systems/nix-upgrade/stable/universal

ledger_info.is_some()

The current revision does not support graceful restarts of the network from an existing config. For testing purposes, please delete you .movement directory and run the setup again.

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.