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

feat: starting with port 0 #36

Merged
merged 4 commits into from
Jul 10, 2024
Merged

feat: starting with port 0 #36

merged 4 commits into from
Jul 10, 2024

Conversation

hamdiallam
Copy link
Contributor

@hamdiallam hamdiallam commented Jul 9, 2024

We dont want to have to specify both the anvil & simulator ports when the anvil port is an implementation detail.

In order to simplify config, we provide the ability to start anvil on port 0, meaning whatever is available on the host. This way we don't need to predefine this port. Since anvil is an external process, we extract the port by waiting for the Listening on log emitted when starting anvil.

Fixes

Only apply the genesis arg to anvil if present in the config

@hamdiallam hamdiallam requested a review from a team as a code owner July 9, 2024 18:19
anvil/anvil.go Outdated
return fmt.Errorf("error writing to genesis file: %w", err)
}

defer os.Remove(tempFile.Name())
Copy link
Contributor Author

@hamdiallam hamdiallam Jul 9, 2024

Choose a reason for hiding this comment

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

After anvil starts, we don't need this tempfile. Can remove immediately when this function, Start, returns. It's consumed in memory on anvil startup

supersim.go Outdated Show resolved Hide resolved
@hamdiallam hamdiallam force-pushed the supersim.testsuite branch from f152658 to 803a3de Compare July 9, 2024 21:11
supersim.go Outdated Show resolved Hide resolved
@hamdiallam hamdiallam force-pushed the supersim.testsuite branch from d12c18b to a4e7947 Compare July 10, 2024 15:48
@hamdiallam hamdiallam changed the title feat: starting anvil with port 0 feat: starting with port 0 Jul 10, 2024
@hamdiallam hamdiallam changed the base branch from supersim.testsuite to main July 10, 2024 15:49
@hamdiallam hamdiallam merged commit 13aa0ec into main Jul 10, 2024
3 checks passed
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.

2 participants