Skip to content
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

--network is ignored when --host is used #1121

Closed
ryokik opened this issue Jul 13, 2023 · 3 comments · Fixed by #1131
Closed

--network is ignored when --host is used #1121

ryokik opened this issue Jul 13, 2023 · 3 comments · Fixed by #1131
Assignees
Labels

Comments

@ryokik
Copy link
Contributor

ryokik commented Jul 13, 2023

If --host is specified, --network is ignored, so nothing can be deployed with the flow deploy command.

Steps to reproduce

  1. clone https://github.com/ryokik/example-flow-project (or flow setup and add some contracts)
  2. Start emulator flow emulator
  3. Deploy contracts with host option flow deploy --host 127.0.0.1:3569 --network emulator
スクリーンショット 2023-07-13 12 50 49

Additional Info

I am using jest for automated testing.
I use a different port than usual to run emulator in parallel.

Looking at the implementation, it appears that when host is specified, the internal name is "custom".

return &config.Network{Name: "custom", Host: hostFlag, Key: networkKeyFlag}, nil

@ryokik
Copy link
Contributor Author

ryokik commented Jul 13, 2023

Also, when '--host' is specified, references (imports) between contracts cannot be resolved.
This also seems to be caused by the fact that the network name is internally set to "custom".

@sideninja
Copy link
Contributor

You are right, but I wonder if you think this is a issue? the way I was thinking about is, if you have a custom host for a network you would define that in "networks" section in flow.json and then just use that network name on the deploy.

@ryokik
Copy link
Contributor Author

ryokik commented Jul 26, 2023

I run flow emulators in parallel for automated testing.
Each has a different port: 127.0.0.1:3569, 127.0.0.1:3570, 127.0.0.1:3571 ...

When --network flag is used, I have to define networks like emulator-1, emulator-2, emulator-3, and the same number of duplicate deployments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants