Skip to content

Issue #336 Multi-chain support - run a second instance of ganache-cli with Chain Id #1 #482

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 29, 2022

Conversation

elpiel
Copy link
Member

@elpiel elpiel commented Mar 28, 2022

  • scripts - ethereum - Dockerfile - add CHAIN_ID env. var
  • scripts - ethereum - add snapshot_contracts_{CHAIN_ID} snapshots
  • scropts - ethereum - ganache-cli - use CHAIN_ID env. var.
  • docker-compose.harness.yml - run second instance of ganache-cli
  • test_harness - Makefile - start second ganache-cli service
  • test_harness - add deployment for contracts on second chain
  • test_harness - Setup - add logger & logging

elpiel added 6 commits March 28, 2022 17:53
- scripts - ethereum - Dockerfile add CHAIN_ID env. var
- scripts - ethereum - add snapshot_contracts_{CHAIN_ID} snapshots
- scropts - ethereum - ganache-cli - use CHAIN_ID env. var.
- docker-compose.harness.yml - run second instance of ganache-cli
- test_harness - Makefile - start second ganache-cli service
- test_harness - add deployment for contracts on second chain
- test_harness - Setup - add logger & logging
scripts - ethereum - use snapshot folder based on CHAIN_ID
@elpiel elpiel marked this pull request as ready for review March 29, 2022 10:29
@@ -28,7 +29,7 @@ pub mod deposits;
/// NOTE: Current the snapshot and test setup use a single Chain.
///
/// Uses Chain #1337 from the [`GANACHE_CONFIG`] static to init the contracts
pub static SNAPSHOT_CONTRACTS: Lazy<Contracts> = Lazy::new(|| {
pub static SNAPSHOT_CONTRACTS_1337: Lazy<Contracts> = Lazy::new(|| {
Copy link
Member Author

Choose a reason for hiding this comment

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

We should think of better way to setup and test when using multi-chain. This is sufficient for the time being.

# The Chain Id that will be passed to `ganache-cli`
ENV CHAIN_ID=
# The snapshot contracts directory that will be used
ARG SNAPSHOT_CONTRACTS=
Copy link
Member Author

Choose a reason for hiding this comment

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

Env. variables cannot be used in COPY, this is why we are passing a build argument of the snapshot directory that will be loaded by Ganache-cli

@elpiel elpiel requested a review from simzzz March 29, 2022 10:32
@elpiel elpiel merged commit b56c9ba into aip-61-adex-v5 Mar 29, 2022
@elpiel elpiel linked an issue Apr 11, 2022 that may be closed by this pull request
@elpiel elpiel deleted the issue-336-second-ganache-instance branch April 12, 2022 10:25
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.

Multi-chain support (EVM chains)
2 participants