If you cannot get the binary approach to work, you can run Matchstick in an Ubuntu-based Docker container. This is useful for quick trials or isolated environments.
Setup
- Install Docker.
- Create a
Dockerfile in your subgraph project root. Use the template from this file and replace <MATCHSTICK_VERSION> with your desired version (found in releases). - Build the image:
docker build -t matchstick .
Running Tests
Run the container by mounting your project directory. Use an absolute path for the source.
Basic run:
docker run -it --rm --mount type=bind,source=<absolute/path/to/project>,target=/matchstick matchstick
Passing arguments (e.g., specific datasource or coverage):
Use the ARGS environment variable to pass flags to Matchstick:
docker run -e ARGS="gravity" -it --rm --mount type=bind,source=<absolute/path/to/project>,target=/matchstick matchstick
Troubleshooting Docker
- Permission Denied Error: If you encounter
error from sender: failed to xattr node_modules/binary-install-raw/bin/binary-<platform>: permission denied during build, create a .dockerignore file in your root folder and add:node_modules/binary-install-raw/bin
- Persistence: The command uses a bind mount, so changes made during the run will persist on your host machine, and you do not need to rebuild the image after code changes.
docker build -t matchstick .
docker run -it --rm --mount type=bind,source=<absolute/path/to/project>,target=/matchstick matchstick