Conversation
On developer machine contracts are deployed to local geth instance. We need to use them in the client, instead of downloading a package from NPM registry. Here we add support for local artifacts. The make command will fetch the artifacts from local directories. The directories can be provided by the caller, e.g.: make local local_threshold_path=/other/path/threshold If the directories are not provided default paths are assumed.
The target name has changed in the Makefile so we need to update it here as well.
| # make all environment=mainnet | ||
|
|
||
| all: download_artifacts generate build cmd-help | ||
| local: |
There was a problem hiding this comment.
When we run Geth on our local we use the "development" name. But here we use "local" name to fetch the artifacts for the "development" env and in the logs I see:
Environment local
even though the installation scripts run for "development". Do you think we can stick to "development" name in this case?
There was a problem hiding this comment.
Network and environment names got confusing. We've got following networks in hardhat:
hardhat(default) - local hardhat nodedevelopment- local geth nodegoerli- public test networkmainnet- public main network
To use contracts packages as dependencies during the development, in the CI we build artifacts and publish them to NPM tagged development. These artifacts can be used as compiled artifacts but we cannot use the addresses to call them, as they were deployed to internal CI's hardhat node during the CI workflow execution.
In the client, we also pull those packages tagged development to build the client with the latest version of contract bindings.
An alternative path is when a developer wants to deploy contracts on their own machine and use the artifacts in the client. The network in hardhat they use is development, to not confuse it with the package the client already expects, I used the name local.
I'm open to straighten it up. But since renaming will have quite significant impact I'd like to have a broader discussion.
There was a problem hiding this comment.
I think it makes sense to have a development name for local geth node. It also was fine for the packages to be named development pre local geth node time. But yea, now it's a bit confusing.
I would rename development npm packages to ex. integration since they run on CI and drop the development package name. However, I'm not sure how much time and effort it takes to do it.
Maybe we can start smaller, and change the logs from Environment: local -> development and add the explanation in the comments?
There was a problem hiding this comment.
We could rename the development network in the hardhat.config.ts in all projects to local. The package we publish to the NPM Registry will still be tagged development.
WDYT @michalinacienciala?
But let's not block this PR on that.
There was a problem hiding this comment.
We could rename the development network in the hardhat.config.ts in all projects to local. The package we publish to the NPM Registry will still be tagged development.
WDYT @michalinacienciala?
Sounds good to me, I prefer this from changing the names of the packages.
|
Tested by running installation scripts and building using |
This PR uses changes made in #3129 to use the locally deployed artifacts. Now `install.sh` will build the client with the local artifacts. Also, `start.sh` can be used now to start a client. To start a client we need to: Manually configure `config.toml` in the `/configs` dir. Providing contract addresses is no longer required for "development" env. Next: - run `scripts/install.sh` - run `scripts/initialize.sh --stake-owner <address>` - run `scripts/start.sh` Available params for `start.sh` - `KEEP_ETHEREUM_PASSWORD` env var. If not provided, "password" is used - flag: `--config-dir` path to the config file. `/configs` is default
Depends on: #3126
On developer machine contracts are deployed to local geth instance. We need to use them in the client, instead of downloading a package from NPM registry.
Here we add support for local artifacts. The make command will fetch the artifacts from local directories and use them for client build.
This is useful if a developer wants to generate bindings for locally deployed contracts.
What is more, the client will embed the addresses of locally deployer contracts, so running the client locally won't require setting the addresses in the configuration file or
--developerflags.The directories can be provided by the caller, e.g.:
make local local_threshold_path=/other/path/threshold
If the directories are not provided default paths are assumed: