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

Provide a local development ("local devnet") configuration as a start. #446

Merged
merged 3 commits into from
Oct 26, 2023

Conversation

vitropy
Copy link
Contributor

@vitropy vitropy commented Oct 24, 2023

This (finally?) provides a "local devnet" configuration intended to
replace the need for developers who are working with multiple components
of an Entropy network (in development/testing mode) to handle those
components independently. I.e., instead of invoking the entropy and
server binaries individually, the entire build and start up routine is
now encapsulated inside a docker compose build && docker compose up
invocation. If this works well, this will also become the basis on which
tests in CI can spin up an Entropy network to test against, as well.

There are a number of things to note about this change, most of which
are thoroughly commented inline, but some that deserve special call out:

  1. Static comilation with GNU libc is not actually fully static. :(
    We still need to include the libnss_files and libnss_dns shared
    objects from the container image's build stage in order for the
    entropy binary to successfully make DNS queries. This wasn't
    necessary before, because those code paths were never called by an
    Entropy network only using IP addresses (or 127.0.0.1, locally).
    However, the local-devnet chain introduced here cannot know IP
    addresses ahead of time, so we need name resolution and thus hit
    this very, very annoying bug.
  2. The new --chain local-devnet option introduced here is specifically
    for use in combination with the Docker Compose docker-compose.yaml
    configuration provided here, as well. It'll fail with another setup.

As an aside, this is my first Rust contribution. Be gentle. <3

@vercel
Copy link

vercel bot commented Oct 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
entropy-core 🛑 Canceled (Inspect) Oct 26, 2023 6:36pm

node/cli/src/admin.rs Outdated Show resolved Hide resolved
node/cli/src/admin.rs Outdated Show resolved Hide resolved
@HCastano
Copy link
Collaborator

Can you make a separate PR for the RustFmt stuff?

@vitropy vitropy changed the title Generate custom chain spec for local devnet setups in Docker Compose. Provide a local development ("local devnet") configuration as a start. Oct 26, 2023
@vitropy vitropy marked this pull request as ready for review October 26, 2023 06:41
@vitropy vitropy requested a review from ameba23 October 26, 2023 06:50
This (finally?) provides a "local devnet" configuration intended to
replace the need for developers who are working with multiple components
of an Entropy network (in development/testing mode) to handle those
components independently. I.e., instead of invoking the `entropy` and
`server` binaries individually, the entire build and start up routine is
now encapsulated inside a `docker compose build && docker compose up`
invocation. If this works well, this will also become the basis on which
tests in CI can spin up an Entropy network to test against, as well.

There are a number of things to note about this change, most of which
are thoroughly commented inline, but some that deserve special call out:

1. Static comilation with GNU libc is not actually fully static. :(
    We still need to include the `libnss_files` and `libnss_dns` shared
    objects from the container image's `build` stage in order for the
    `entropy` binary to successfully make DNS queries. This wasn't
    necessary before, because those code paths were never called by an
    Entropy network only using IP addresses (or `127.0.0.1`, locally).
    However, the `local-devnet` chain introduced here cannot know IP
    addresses ahead of time, so we need name resolution and thus hit
    this very, very annoying bug.
1. The new `--chain local-devnet` option introduced here is specifically
    for use in combination with the Docker Compose `docker-compose.yaml`
    configuration provided here, as well. It'll fail with another setup.

As an aside, this is my first Rust contribution. Be gentle. <3
@vitropy vitropy merged commit 519db3b into master Oct 26, 2023
3 of 10 checks passed
@vitropy vitropy deleted the vi/local-devnet-chain-spec branch October 26, 2023 16:07
@HCastano
Copy link
Collaborator

@vitropy this broke the CI, there were some updates introduced in #435 that weren't reflected here

node/cli/src/chain_spec.rs Show resolved Hide resolved
node/cli/src/admin.rs Show resolved Hide resolved
@vitropy
Copy link
Contributor Author

vitropy commented Oct 26, 2023

@vitropy this broke the CI, there were some updates introduced in #435 that weren't reflected here

I saw it. It was those changes and lint checks, but both are already resolved now and master is passing in CI now.

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