Extract contracts artifacts downloading to the main Makefile#3126
Merged
Extract contracts artifacts downloading to the main Makefile#3126
Conversation
We moved the artifacts downloading to a main Makefile. Now it's enough to run `make` in the root directory to download the artifacts and build the client. To run make for sepcific network(environment) the command should be executed as, e.g. make environment=goreli No need to set the CONTRACTS_NPM_PACKAGE_TAG env variable.
The common problems we experienced on generation were caused by missing artifacts directory. The error was unclear in such situation, so here we explicitly check if the directory exists and error if not.
Instead of reporting the command output on generation which prints a lot of noise, we output error messages.
It's now simpler to run make for specific environment, the commands are: `make development`, `make goerli`, in the future we will have `make mainnet`. For now the default command (the first one in the Makefile is for development, so it's enough to run just `make` to build client with development environmnet.
We don't need to print the verbose output of all files extracted.
Update dockerfile to reflect changes introduced to the code generation
The `pkg/gen` directory no longer exists.
Update gitignore after changes to code generation
dimpar
reviewed
Aug 8, 2022
| @threshold-network/solidity-contracts \ | ||
| @keep-network/tbtc-v2 | ||
|
|
||
| # Working directory where contracts artifacts should be fetched to. |
| ./keep-client start --help >> docs/development/cmd-help | ||
|
|
||
| # TODO: Consider extracting `download_artifacts` step from go generate command. | ||
| .PHONY: all |
Contributor
There was a problem hiding this comment.
What do you think about making development and goerli phony as well?
Contributor
|
I've tested the execution, and the |
Phony targets should be defined for all non-file targets.
dimpar
approved these changes
Aug 8, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In this PR we extract artifacts downloading to the main Makefile, instead of doing it in the bindings generation process.
This is preparation for multi-network clients and supporting local developer machine's contracts artifacts.
Also, the execution experience was improved. To run generation and building for goerli environment you have to run
make goerliinstead ofCONTRACTS_NPM_PACKAGE_TAG=local go generate ./....