Skip to main content

Building and running Rosetta from source code

In Running with Docker, you learned that the Docker container runs the mina daemon, mina-archive, and Rosetta API.

If you already have mina-archive up and running, you can also build and run the Rosetta API natively and wire it to the existing mina daemon and mina-archive.

tip

To run mina daemon and mina-archive natively, follow the Archive Node page instructions.

The easiest way to build Rosetta natively is to use the Nix development environment.

  1. Clone the official mina repository and switch to the compatible branch.

  2. If you don't already have Nix on your machine, install it following the steps in the nix/README.md.

  3. Run the ./nix/pin.sh script to enable submodules to be available to the build:

    ./nix/pin.sh
  4. Launch the development shell:

    nix develop mina
  5. Build Rosetta app:

    dune build --profile=mainnet src/app/rosetta
  6. After a successful build, the Rosetta app is available here: _build/default/src/app/rosetta/rosetta.exe

    You can run it with following command:

    MINA_ROSETTA_MAX_DB_POOL_SIZE=64 \
    _build/default/src/app/rosetta/rosetta.exe --port 3087 \
    --graphql-uri <URL to Mina GraphQL instance>
    --archive-uri postgres://<username>:<password>@<host>:<port>/<db_name>