git lfs install
to setup lfs on for repo.brew install coreutils
pinata-ssh-forward
to start Pinata. You don't need to worry about pinata-ssh-mount
as the Makefile scripts do that part automatically.ssh-add
install-git-hooks.sh
script to install git hooks after you initially clone the repository.pip3 install --upgrade yasi
yasi --no-exit --no-backup --no-warning --no-output --indent-comments --uniform --default-indent 2 --dialect clojure <file>
make format
from the root or the phylum directory.yasi
will look for the config file in the current directory first, and if it doesn't find it, it will look in the home directory. You can create a soft link from your home directory to the real config file. There's a script that can do this for you, just run: ./scripts/install-yasi-config.sh
SUBSTRATE_PLUGIN_FILE
environment variable as it contains the version number, in the default go test config and all the existing run configurations. We recommend installing Goland 2020.1 as it adds better go modules support and features around setting default environment variable for tests which we can utilise to simplify the setup. Due to the usage of go plugin for running the substrate the build environment has to be match what it was when the substrate plugin was built. We need to replicate all the configuration in the IDE to be able to run the tests through the IDE and get syntax working correctly.
1. Configuring GOROOT
You need to have the exact version of go as specified in .go-version
The easiest way to set this to required version is by installing that version of go directly, e.g. through brew on Darwin as opposed to using goenv
. After installing the specified version, navigate to Preferences > Go > GOROOT and ensure the correct version is selected.
2. Configuring build tags for setting up syntax highlighting in test files Navigate to Preferences > Go > 'Build Tags and Vendoring' and add all
to the custom tags input field. We'll utilise this custom tag when setting up test configurations.
3. Configuring the Go test template (requires at least Goland 2020.1) This will configure the defaults for test and allow you to create new valid test configs through the UI, for example when you click the run test button next to a certain test function, you'll be able to run that test without additional config.
NOTE: Configuring the default go tests allow you to profile the code through the UI as well! There are 2 environment variables which you need to set to custom values before each test, and any go command in general; GOPATH
and SUBSTRATE_PLUGIN_FILE
. There's a script that automates this process however there's no way of utilising it automatically in the IDE. Run that script to download the latest substrate plugin and by looking at the exported variables, find the valid values for the GOPATH
and SUBSTRATE_PLUGIN_FILE
env vars (as of now the GOPATH
value is /tmp/substrateplugingopath
) Navigate to Run > Edit Configurations... > Templates > Go Test.-parallel 50
. Feel free to experiment with this value and add additional relevant arguments in the future. Now every new test config that you create will automatically contain these 2 environment variables../.run/go_test.run.xml
Goland will automatically load this configuration for you (requires 2020.1+) You can use it to run the tests. You may also wish to create a run configuration for the different go test tags, this will allow you to run all the tests relevant to a feature.$ID_TOKEN
is generated by the IDP.ID_TOKEN
s for testing purposes. This endpoint requires your API_KEY
to be set to a special Luther key. When testing locally, the API_KEY
you specify in your environment will have this privileges. Example usage of the fake IDP:ID_TOKEN
with claims "iss", "sub" and "aud", in this case allowing you to set a COOKIE that will authenticate you as the special "martin" user. See descriptions in the above section for these claims./test/request
. This requires a valid admin API key. To use this endpoint, supply the request as a parameter. For example:make docker-login
target is being skipped. If you see this error make sure to run:./scripts/go-substrate-wrapper.sh
/tmp/substrateplugingopath/
with sudo
:make mem-up
docker system prune
to remove unused containers, networks, images (both dangling and unreferenced).\make up
or make mem-up
pinata-ssh-forward
, retry after running this.SUBSTRATE_VERSION
in common.mk
..run
also should be updated as the environment variables will now be outdated.