This environment is meant to support Trezor development - both Firmware and Suite and other related projects. Its main goals are:
- Provide an easy websocket server that is capable of:
- Launching/stopping different versions of the firmware emulator.
- Launching/stopping trezord-go (Bridge).
- Send simple debug commands to the emulator.
- Enable full integration testing of Suite, firmware emulator and Bridge using the websocket server.
- Provide a HTML page that communicates with the server. This allows the developers to perform the actions above.
- To be Nix-native but also offer Docker image to allow non-NixOS developers to use it.
You can also run trezor-user-env "natively" if you are on NixOS but we mainly support the Docker way as described here.
You need:
- Docker (to run NixOS in a container).
- Run in terminal:
xhost +
- Download the latest docker build:
docker-compose -f ./docker/compose.yml pull trezor-user-env-unix
- Run it:
docker-compose -f ./docker/compose.yml up trezor-user-env-unix
- Open http://localhost:21326.
For a future use you can omit the second step and run up
(the third step) directly. However, you will not have the latest master builds then!
You need:
Download these as you are used to. We recommend using nix
or brew
, but that's your fight.
- Run XQuartz and leave it running on the background. Wait till it is launched.
- In XQuartz settings go to Preferences > Security and enable "Allow connections from network clients".
- Open a new terminal window (not in XQuartz) and add yourself to the X access control list:
xhost +127.0.0.1
(you will probably need to logout/login after XQuartz installation to havexhost
command available) - Download the latest docker build:
docker-compose -f ./docker/compose.yml pull trezor-user-env-mac
- Run it:
docker-compose -f ./docker/compose.yml up trezor-user-env-mac
- Open http://localhost:21326.
For a future use you can omit the second step and run up
(the third step) directly. However, you will not have the latest master builds then!
Currently not supported, but should work using docker as well.
In case you need to modify something in trezor-user-env you have two options.
If you are using NixOS you can do the changes locally and then run the controller yourself. Run it via nix-shell controller/shell.nix --run 'python controller/main.py'
. Make sure you have run {firmware,suite,trezord-go}/bin/download.sh
beforehand otherwise you'll have old binaries.
This is suitable for smaller changes or things you can check via the HTML dashboard easily. However, if you are adding some functionality to trezor-user-env mainly because of Suite end-to-end tests, it is probably better to go the CI way (below). Otherwise you would need to run the whole Suite test suite locally.
The simpler but less flexible way is to let the CI build it. You can create a branch, commit your changes and then push them. The CI will build it for you and tag the appropriate docker image as test
. You can then modify all scripts/commands and use registry.gitlab.com/satoshilabs/trezor/trezor-user-env/trezor-user-env:test
instead of registry.gitlab.com/satoshilabs/trezor/trezor-user-env/trezor-user-env
which defaults to the latest
tag which equals trezor-user-env's master. Suite's docker-compose files in the docker
subdirectory are the place where you want to change this.