Skip to content

Extract contracts artifacts downloading to the main Makefile#3126

Merged
dimpar merged 12 commits intomainfrom
make-download-artifacts
Aug 8, 2022
Merged

Extract contracts artifacts downloading to the main Makefile#3126
dimpar merged 12 commits intomainfrom
make-download-artifacts

Conversation

@nkuba
Copy link
Copy Markdown
Member

@nkuba nkuba commented Aug 4, 2022

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 goerli instead of CONTRACTS_NPM_PACKAGE_TAG=local go generate ./....

nkuba added 8 commits August 4, 2022 13:14
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
@nkuba nkuba requested a review from pdyraga August 4, 2022 11:33
@nkuba nkuba self-assigned this Aug 4, 2022
@nkuba nkuba requested a review from a team August 4, 2022 22:55
Comment thread Makefile Outdated
@threshold-network/solidity-contracts \
@keep-network/tbtc-v2

# Working directory where contracts artifacts should be fetched to.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[...] should be strored.

Comment thread Makefile Outdated
./keep-client start --help >> docs/development/cmd-help

# TODO: Consider extracting `download_artifacts` step from go generate command.
.PHONY: all
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about making development and goerli phony as well?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should do that!

@dimpar
Copy link
Copy Markdown
Contributor

dimpar commented Aug 8, 2022

I've tested the execution, and the tmp folder with the artifacts were created successfully.

nkuba added 2 commits August 8, 2022 15:22
Phony targets should be defined for all non-file targets.
@nkuba nkuba requested a review from dimpar August 8, 2022 13:34
@dimpar dimpar merged commit 155f72e into main Aug 8, 2022
@dimpar dimpar deleted the make-download-artifacts branch August 8, 2022 13:42
@pdyraga pdyraga added this to the v2.0.0-m1 milestone Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants